Promptyard
Schema

OpenAPI → Tool Definitions

Extract tool definitions from an OpenAPI 3.x spec for OpenAI or Anthropic.

Target
2 operations extracted

Extracts application/json request bodies + path/query parameters. Other content types (form data, multipart, octet-stream) are skipped. $refs are not yet resolved — inline your shared schemas first.

When this is useful

If you\'re wrapping an existing REST API for an LLM agent, the OpenAPI spec already describes every operation, parameter, and required field. Converting to tool definitions by hand is tedious and error-prone; this tool does the mechanical conversion so you can focus on iterating on descriptions.

Use the output as a starting point. Often you\'ll want to: drop endpoints the agent shouldn\'t use, sharpen descriptions for tool selection, add strict: true for OpenAI structured outputs, or split a single endpoint into multiple narrower tools to reduce hallucinated misuse.

FAQ

What about <code>$ref</code>s and shared schemas?
Not resolved yet. Inline your shared schemas (use a tool like swagger-cli bundle) before pasting. Future versions will resolve $ref to the same document.
Why are non-JSON content types skipped?
Tool calling assumes structured arguments. multipart/form-data, file uploads, and HTML form bodies don't round-trip through a JSON tool definition. Build a JSON wrapper for those endpoints if you need them.
How do you generate the tool name?
Use operationId when present. Otherwise we synthesize verb_path with non-alphanumerics replaced by underscores, capped at 64 chars (the OpenAI tool name limit).
Does this work for AsyncAPI / GraphQL / gRPC?
No. OpenAPI 3.x only. AsyncAPI is a different spec; GraphQL has its own type system; gRPC uses Protocol Buffers. Each would need a dedicated converter.

Common pitfalls

  • Exposing all 50 endpoints to the agent — pick the 3–5 it actually needs. More tools = more confusion.
  • Using auto-generated descriptions verbatim. The model picks tools based on these; rewrite for clarity.
  • Forgetting that the agent calls these tools without authentication context. Inject auth in your handler, not in the schema.
  • Treating extracted tool names (get_weather_city) as canonical — rename to match your domain language.

Related tools