Skip to main content
Glama

x402_manifest_from_openapi

Convert an OpenAPI 3.x or Swagger 2.0 spec into x402 V2 paywall manifests, route configs, discovery schemas, and well-known payment documents for mounting paid API endpoints.

Instructions

Turn an OpenAPI 3.x / Swagger 2.0 spec (JSON or YAML, URL or inline) into a ready-to-mount x402 V2 paywall: per-operation accepts[] (exact, CAIP-2 network, atomic USDC amount, payTo, EIP-712 extra), @x402/core route config, Bazaar discovery input/output schemas, a /.well-known/x402 document and a sample PAYMENT-REQUIRED payload. Costs 0.003 USDC on Base per successful call (x402). Without a payment key this tool returns the 402 challenge.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "payTo": "<payTo>"
    },
    "name": "x402_manifest_from_openapi"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoOpenAPI URL
specNoInline spec (POST)
payToYesReceiving address
priceNoDefault USD price per call
pricesNoJSON map {"GET /path": 0.002}
networkNoCAIP-2, default eip155:8453
base_urlNoOverride server URL

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the exact price (0.003 USDC on Base per successful call), the billing model (charged only on success), and the failure mode when no payment key is present (returns the 402 challenge). It stops short of stating whether the call is idempotent, whether anything is persisted server-side, or any rate limits.

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?

Effectively two sentences, front-loaded with the verb and resource, then the output inventory, then cost/payment gating. The parenthetical field list is dense but every element maps to a real output or requirement; no filler wording.

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?

For a 7-parameter, no-output-schema tool with no annotations, the description covers inputs, outputs, and payment semantics thoroughly enough to call it correctly. Remaining gaps are edge cases: malformed/oversized spec handling and error behavior beyond the 402 challenge.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. The description adds some semantic framing — that network values are CAIP-2, that amounts become atomic USDC, and that payTo/EIP-712 extra are per-operation fields — but it does not explain the price vs prices precedence, the base_url override behavior, or the interaction between url and spec.

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

Purpose5/5

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

States a specific transformation (OpenAPI 3.x / Swagger 2.0 spec -> x402 V2 paywall) and enumerates the concrete artifacts produced: per-operation accepts[], @x402/core route config, Bazaar discovery schemas, a /.well-known/x402 document and a sample PAYMENT-REQUIRED payload. Accepted input forms (JSON or YAML, URL or inline) are also named, so an agent can tell this apart from lint/convert siblings without opening the schema.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: you have an OpenAPI spec and want a mountable x402 paywall. The description does not name when to prefer this over siblings like openapi_to_mcp, mcp_manifest_lint, or playbook_x402_seller, and gives no exclusion criteria or prerequisites beyond the payment key.

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