Skip to main content
Glama

openapi_to_mcp

Convert an OpenAPI spec from a URL or inline JSON/YAML into MCP tool definitions with JSON Schema inputs, annotations, and HTTP forwarding hints for agent use.

Instructions

Convert an OpenAPI spec (JSON/YAML, URL or inline) into MCP tool definitions: LLM-safe unique names, descriptions, JSON Schema inputSchema (query/path/header params + JSON body), MCP annotations (readOnly/destructive/idempotent), plus HTTP forwarding hints and a ready tools/list response. Costs 0.003 USDC on Base per successful call (x402). Without a payment key this tool returns the 402 challenge.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "openapi_to_mcp"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoSpec URL
specNoInline spec (POST)
base_urlNoOverride server URL

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does well: it discloses pricing amount and currency, per-successful-call billing, the x402 protocol, and the 402 fallback behavior. It stops short of stating rate limits or whether the conversion is a pure transform with no side effects on the target API.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first clause, with the output inventory and then the commercial/payment caveat following in a logical order. The middle enumeration is dense but each item adds information; nothing is obviously redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must convey return values, and it does by listing the generated artifacts including a ready tools/list response. Only edge-case behavior beyond the 402 path (validation failures, partial conversions) is left unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds accepted input formats (JSON or YAML) and frames the url-versus-inline choice, which the schema descriptions do not mention. This meaningfully augments rather than repeats the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource — 'Convert an OpenAPI spec ... into MCP tool definitions' — and enumerates the concrete artifacts produced (unique names, descriptions, inputSchema, annotations, forwarding hints, tools/list response). It does not name a sibling, so an agent must infer the boundary with openapi_lint or mcp_manifest_lint, but the output list makes the scope unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operational context: input may be a URL or inline spec (JSON/YAML), and it discloses the x402 payment precondition including exactly what happens without a key (402 challenge). It does not state when to prefer it over linting or publishing siblings, which keeps it short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.