ToolSchema Forge

Deterministic LLM tool-schema conversion, linting and MCP manifest generation for OpenAI (incl. strict mode), Anthropic, Gemini and MCP, paid per call in USDC on Base via x402.

Pay per call with x402: USDC on Base (eip155:8453), payTo 0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa. No signup, no API key. Unpaid calls get 402 with a PAYMENT-REQUIRED header.

Machine-readable: /openapi.json · /llms.txt · /health · Listed on PayAPI Market

POST /v1/tool-schema/convert $0.01

Converts one LLM tool/function definition (OpenAI, Anthropic, Gemini, MCP or plain JSON Schema; format auto-detected) into one or more target provider formats. Applies each provider's schema rules: OpenAI strict mode (all fields required, optional fields made nullable, additionalProperties false), Gemini's OpenAPI subset (no $ref, nullable, string enums), $ref inlining and name sanitising. Returns converted tools plus a list of every change made. Deterministic, no LLM.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/tool-schema/convert -H 'content-type: application/json' -d '{"tool":{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city.","parameters":{"type":"object","properties":{"city":{"type":"string","description":"City name"},"unit":{"type":"string","enum":["c","f"]}},"required":["city"]}}},"targets":["openai_strict","gemini"]}'
Example response
{
  "detected": "openai",
  "results": {
    "openai_strict": {
      "tool": {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get the current weather for a city.",
          "strict": true,
          "parameters": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "City name"
              },
              "unit": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "c",
                  "f",
                  null
                ]
              }
            },
            "required": [
              "city",
              "unit"
            ],
            "additionalProperties": false
          }
        }
      },
      "issues": [
        {
          "provider": "openai_strict",
          "path": "/properties/unit",
          "code": "optional_made_nullable",
          "message": "Optional property \"unit\" was made nullable and required",
          "severity": "warning",
          "fixed": true
        },
        {
          "provider": "openai_strict",
          "path": "/additionalProperties",
          "code": "additional_properties_forced",
          "message": "additionalProperties must be false for OpenAI Structured Outputs",
          "severity": "warning",
          "fixed": true
        }
      ]
    },
    "gemini": {
      "tool": {
        "name": "get_weather",
        "description": "Get the current weather for a city.",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "description": "City name"
            },
            "unit": {
              "type": "string",
              "enum": [
                "c",
                "f"
              ]
            }
          },
          "required": [
            "city"
          ]
        }
      },
      "issues": []
    }
  }
}

POST /v1/tool-schema/lint $0.005

Checks one LLM tool/function definition against the schema rules of OpenAI (incl. strict mode), Anthropic, Gemini and MCP without changing it. Returns a compatible true/false flag per provider and every problem with its JSON pointer path, so a tool can be fixed before an API call is rejected. Deterministic, no LLM.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/tool-schema/lint -H 'content-type: application/json' -d '{"tool":{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city.","parameters":{"type":"object","properties":{"city":{"type":"string","description":"City name"},"unit":{"type":"string","enum":["c","f"]}},"required":["city"]}}},"targets":["openai_strict","gemini","anthropic"]}'
Example response
{
  "detected": "openai",
  "compatible": {
    "openai_strict": false,
    "gemini": true,
    "anthropic": true
  },
  "issues": [
    {
      "provider": "openai_strict",
      "path": "/properties/unit",
      "code": "optional_made_nullable",
      "message": "Optional property \"unit\" was made nullable and required",
      "severity": "warning",
      "fixed": false
    },
    {
      "provider": "openai_strict",
      "path": "/additionalProperties",
      "code": "additional_properties_forced",
      "message": "additionalProperties must be false for OpenAI Structured Outputs",
      "severity": "warning",
      "fixed": false
    }
  ]
}

POST /v1/openapi/to-tools $0.02

Converts an OpenAPI 3.0/3.1 or Swagger 2.0 JSON spec into one LLM tool definition per operation, in OpenAI, OpenAI strict, Anthropic, Gemini, MCP or JSON Schema format. Path, query and header parameters become properties; the JSON request body becomes a 'body' property; local $refs are inlined. Optional filter by operationId or 'METHOD /path'. Deterministic, no LLM.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/openapi/to-tools -H 'content-type: application/json' -d '{"spec":{"openapi":"3.0.3","info":{"title":"Pets","version":"1.0.0"},"paths":{"/pets/{id}":{"get":{"operationId":"getPet","summary":"Get a pet by id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}}}},"target":"anthropic"}'
Example response
{
  "count": 1,
  "tools": [
    {
      "name": "getPet",
      "description": "Get a pet by id",
      "input_schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      }
    }
  ],
  "skipped": [],
  "issues": []
}

POST /v1/tool-schema/batch-convert $0.05

Batch version of tool-schema conversion: send up to 50 tool/function definitions in mixed formats (OpenAI, Anthropic, Gemini, MCP, JSON Schema; auto-detected) and get each converted to every target format, with per-tool change reports. One bad tool does not fail the batch. Also reports duplicate tool names, which provider APIs reject. Deterministic, no LLM.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/tool-schema/batch-convert -H 'content-type: application/json' -d '{"tools":[{"type":"function","function":{"name":"get_weather","description":"Get the current weather for a city.","parameters":{"type":"object","properties":{"city":{"type":"string","description":"City name"},"unit":{"type":"string","enum":["c","f"]}},"required":["city"]}}},{"name":"search_docs","description":"Search the documentation.","input_schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"]}}],"targets":["gemini","mcp"]}'
Example response
{
  "count": 2,
  "ok": 2,
  "failed": 0,
  "results": [
    {
      "index": 0,
      "name": "get_weather",
      "detected": "openai",
      "outputs": {
        "gemini": {
          "name": "get_weather",
          "description": "Get the current weather for a city.",
          "parameters": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "City name"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "c",
                  "f"
                ]
              }
            },
            "required": [
              "city"
            ]
          }
        },
        "mcp": {
          "name": "get_weather",
          "description": "Get the current weather for a city.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "City name"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "c",
                  "f"
                ]
              }
            },
            "required": [
              "city"
            ]
          }
        }
      },
      "issues": [],
      "error": null
    },
    {
      "index": 1,
      "name": "search_docs",
      "detected": "anthropic",
      "outputs": {
        "gemini": {
          "name": "search_docs",
          "description": "Search the documentation.",
          "parameters": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string"
              }
            },
            "required": [
              "query"
            ]
          }
        },
        "mcp": {
          "name": "search_docs",
          "description": "Search the documentation.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string"
              }
            },
            "required": [
              "query"
            ]
          }
        }
      },
      "issues": [],
      "error": null
    }
  ],
  "duplicate_names": []
}

POST /v1/mcp/manifest $0.15

Builds a complete Model Context Protocol (MCP) server manifest from an OpenAPI 3.x/Swagger 2.0 JSON spec or from a list of LLM tool definitions: MCP tools with input schemas, titles and behavior annotations, server info, capabilities block, HTTP bindings for each operation, and ready-to-run TypeScript stdio server code using the official MCP SDK. Deterministic, no LLM.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/mcp/manifest -H 'content-type: application/json' -d '{"openapi":{"openapi":"3.0.3","info":{"title":"Pets","version":"1.0.0"},"servers":[{"url":"https://api.example.com"}],"paths":{"/pets/{id}":{"get":{"operationId":"getPet","summary":"Get a pet by id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}}}}}'
Example response
{
  "server": {
    "name": "pets",
    "version": "1.0.0",
    "description": ""
  },
  "protocolVersion": "2025-06-18",
  "capabilities": {
    "tools": {
      "listChanged": false
    }
  },
  "tools": [
    {
      "name": "getPet",
      "title": "Get Pet",
      "description": "Get a pet by id",
      "inputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    }
  ],
  "http_bindings": [
    {
      "tool": "getPet",
      "method": "GET",
      "path": "/pets/{id}",
      "baseUrl": "https://api.example.com"
    }
  ],
  "issues": [],
  "skipped": [],
  "stub": {
    "filename": "server.ts",
    "language": "typescript",
    "dependencies": {
      "@modelcontextprotocol/sdk": "^1.17.0"
    },
    "code": "import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { ListToolsRequestSchema, CallToolRequestSchema } from \"@modelcontextprotocol/sdk/types.js\";\n// ... TOOLS array, Server setup, ListTools/CallTool handlers that call the bound HTTP endpoints ...\nawait server.connect(new StdioServerTransport());"
  }
}

POST /v1/cookbook $7.00

Buys the Tool-Schema Cookbook & Template Pack by Rowan Vale (ToolSchema Forge): a 24-page PDF guide to LLM tool schemas across OpenAI (incl. strict), Anthropic, Gemini and MCP, 23 ready-made tool templates in 6 formats, bundles, a lint report and a starter MCP server. On payment returns a new paid order with private download URLs for the PDF and the ZIP. Send an empty JSON object.

Example request
curl -X POST https://toolschema-forge.toolschemaforge.workers.dev/v1/cookbook -H 'content-type: application/json' -d '{}'
Example response
{
  "order_id": "0123456789abcdef0123456789abcdef",
  "status": "paid",
  "product": "Tool-Schema Cookbook & Template Pack",
  "order_page": "https://toolschema-forge.toolschemaforge.workers.dev/cookbook/order/0123456789abcdef0123456789abcdef",
  "downloads": {
    "pdf": "https://toolschema-forge.toolschemaforge.workers.dev/cookbook/download/0123456789abcdef0123456789abcdef/pdf",
    "zip": "https://toolschema-forge.toolschemaforge.workers.dev/cookbook/download/0123456789abcdef0123456789abcdef/zip"
  }
}

Get the Cookbook

Tool-Schema Cookbook & Template Pack by Rowan Vale: a PDF guide to writing LLM tool schemas that work across OpenAI, Anthropic, Gemini and MCP, 23 ready-made tool templates in every supported format, and a starter MCP server. $7.

Get the Cookbook ($7, pay with crypto) · AI agents: x402 POST /v1/cookbook ($7.00 USDC) returns the download links.

Why

Inputs are processed in memory and not stored.