{"openapi":"3.1.0","info":{"title":"ToolSchema Forge","version":"1.0.0","description":"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.","x-guidance":"Use POST /v1/tool-schema/convert to translate one LLM tool definition into OpenAI, OpenAI strict, Anthropic, Gemini, MCP or JSON Schema format. Use POST /v1/tool-schema/lint to check provider compatibility without changing the tool. Use POST /v1/openapi/to-tools to generate tool definitions from an OpenAPI 3.x or Swagger 2.0 JSON spec. Use POST /v1/tool-schema/batch-convert to convert up to 50 tools in one call with per-tool errors. Use POST /v1/mcp/manifest to build an MCP server manifest (tools with input schemas, server info, capabilities, HTTP bindings) plus a TypeScript stub from an OpenAPI spec or a tools list. Use POST /v1/cookbook ($7.00, empty JSON body) to buy the Tool-Schema Cookbook & Template Pack; the response contains private download URLs. All take a JSON body (or GET with ?body=<url-encoded JSON> at the same price); see each requestBody example."},"servers":[{"url":"https://toolschema-forge.toolschemaforge.workers.dev"}],"components":{"securitySchemes":{}},"paths":{"/v1/tool-schema/convert":{"post":{"operationId":"tool_schema_convert","summary":"Convert an LLM tool definition between OpenAI, OpenAI strict, Anthropic, Gemini, MCP and JSON Schema formats","description":"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. Price: $0.01 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$0.01","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"object","description":"Tool definition in any supported format (OpenAI chat/responses, Anthropic, Gemini, MCP, or {name, description, parameters})."},"targets":{"type":"array","items":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"minItems":1,"description":"Target formats. Default: all."}},"required":["tool"]},"example":{"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"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"detected":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"results":{"type":"object","additionalProperties":{"type":"object","properties":{"tool":{"type":"object"},"issues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"fixed":{"type":"boolean"}},"required":["provider","path","code","message","severity","fixed"]}}}}}},"required":["detected","results"]},"example":{"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":[]}}}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/v1/tool-schema/lint":{"post":{"operationId":"tool_schema_lint","summary":"Check an LLM tool definition for compatibility with each provider's schema rules","description":"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. Price: $0.005 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$0.005","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"object","description":"Tool definition in any supported format."},"targets":{"type":"array","items":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"minItems":1,"description":"Providers to check. Default: all."}},"required":["tool"]},"example":{"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"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"detected":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"compatible":{"type":"object","additionalProperties":{"type":"boolean"}},"issues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"fixed":{"type":"boolean"}},"required":["provider","path","code","message","severity","fixed"]}}},"required":["detected","compatible","issues"]},"example":{"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}]}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/v1/openapi/to-tools":{"post":{"operationId":"openapi_to_tools","summary":"Turn an OpenAPI 3.x / Swagger 2.0 spec into ready-to-use LLM tool definitions","description":"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. Price: $0.02 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$0.02","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spec":{"type":"object","description":"OpenAPI 3.x or Swagger 2.0 document as JSON."},"target":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"],"description":"Output format. Default openai."},"include":{"type":"array","items":{"type":"string"},"description":"Optional operationIds or 'METHOD /path' strings to include."},"maxTools":{"type":"integer","minimum":1,"maximum":128}},"required":["spec"]},"example":{"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"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"tools":{"type":"array","items":{"type":"object"}},"skipped":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"reason":{"type":"string"}}}},"issues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"fixed":{"type":"boolean"}},"required":["provider","path","code","message","severity","fixed"]}}},"required":["count","tools","skipped","issues"]},"example":{"count":1,"tools":[{"name":"getPet","description":"Get a pet by id","input_schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}],"skipped":[],"issues":[]}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/v1/tool-schema/batch-convert":{"post":{"operationId":"tool_schema_batch_convert","summary":"Convert up to 50 LLM tool definitions between OpenAI, OpenAI strict, Anthropic, Gemini, MCP and JSON Schema in one call","description":"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. Price: $0.05 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$0.05","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.050000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object"},"minItems":1,"maxItems":50,"description":"1-50 tool definitions in any supported format."},"targets":{"type":"array","items":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"minItems":1,"description":"Target formats. Default: all."}},"required":["tools"]},"example":{"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"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"ok":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"name":{"type":["string","null"]},"detected":{"type":["string","null"]},"outputs":{"type":["object","null"]},"issues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"fixed":{"type":"boolean"}},"required":["provider","path","code","message","severity","fixed"]}},"error":{"type":["string","null"]}},"required":["index","name","detected","outputs","issues","error"]}},"duplicate_names":{"type":"array","items":{"type":"string"}}},"required":["count","ok","failed","results","duplicate_names"]},"example":{"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":[]}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/v1/mcp/manifest":{"post":{"operationId":"mcp_manifest","summary":"Generate a complete MCP server manifest and TypeScript server stub from an OpenAPI spec or a list of tools","description":"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. Price: $0.15 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$0.15","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.150000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"openapi":{"type":"object","description":"OpenAPI 3.x or Swagger 2.0 document as JSON. Give this or tools."},"tools":{"type":"array","items":{"type":"object"},"minItems":1,"maxItems":100,"description":"Tool definitions in any supported format. Give this or openapi."},"server":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"}},"description":"Optional server info overrides."},"include":{"type":"array","items":{"type":"string"},"description":"Optional operationIds or 'METHOD /path' strings to include (openapi input)."}}},"example":{"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"}}]}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"server":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"}}},"protocolVersion":{"type":"string"},"capabilities":{"type":"object"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"inputSchema":{"type":"object"},"annotations":{"type":"object"}}}},"http_bindings":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"baseUrl":{"type":["string","null"]}}}},"issues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","openai_strict","anthropic","gemini","mcp","jsonschema"]},"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"fixed":{"type":"boolean"}},"required":["provider","path","code","message","severity","fixed"]}},"skipped":{"type":"array","items":{"type":"object"}},"stub":{"type":"object","properties":{"filename":{"type":"string"},"language":{"type":"string"},"dependencies":{"type":"object"},"code":{"type":"string"}}}},"required":["server","protocolVersion","capabilities","tools","http_bindings","issues","skipped","stub"]},"example":{"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());"}}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/v1/cookbook":{"post":{"operationId":"cookbook","summary":"Buy the Tool-Schema Cookbook & Template Pack (PDF guide + 23 tool templates in 6 formats + MCP starter server) and get private download links","description":"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. Price: $7.00 USDC per call (x402, Base).","tags":["paid"],"x-x402":{"price":"$7.00","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x7a3C00Ef0969378A3E74455cde3Dc87C0f016dfa","scheme":"exact"},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"7.000000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false},"example":{}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","description":"128-bit random order id (32 hex chars); keep it private"},"status":{"type":"string","enum":["paid"]},"product":{"type":"string"},"order_page":{"type":"string","description":"Private order page with both download links"},"downloads":{"type":"object","properties":{"pdf":{"type":"string"},"zip":{"type":"string"}},"required":["pdf","zip"]}},"required":["order_id","status","product","order_page","downloads"]},"example":{"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"}}}}},"400":{"description":"Invalid JSON body or unsupported tool/spec format. Body: {error, message}."},"402":{"description":"Payment required: x402 challenge in the PAYMENT-REQUIRED header (USDC on Base)."},"413":{"description":"Body larger than 256 KB."}}}},"/health":{"get":{"operationId":"health","summary":"Free health check","tags":["free"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/cookbook":{"get":{"operationId":"cookbookPage","summary":"Free product page for the Tool-Schema Cookbook & Template Pack ($7, crypto checkout via NOWPayments)","tags":["free"],"security":[],"responses":{"200":{"description":"OK","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/openapi.json":{"get":{"operationId":"openapi","summary":"This OpenAPI document","tags":["free"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/llms.txt":{"get":{"operationId":"llms_txt","summary":"Plain-text summary for LLM agents","tags":["free"],"security":[],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}