Skip to main content
Glama

Fix plan for an x402 endpoint ($0.05 via x402)

x402_fix
Read-only

Paid ($0.05 via x402 in USDC on Base, Solana, Monad, Polygon, Arbitrum, Avalanche, Algorand, Stellar or NEAR, or in RLUSD on the XRP Ledger): diagnoses your x402 endpoint, then returns per problem the concrete change as code for your stack (express, next, hono, node, python, generic), filled in with your own payTo, amount, network and route. A working endpoint gets improvements too (ERC-8004 identity, Base Builder Code, x402scan ownership proof, skill.md, browser paywall, Bazaar output schema), each with code. For the endpoint's owner; the diagnosis is included. Same as GET /api/v1/fix. The answer carries a signed receipt (EIP-191, bound to your arguments) that proves later which verdict you got.

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": {
      "url": "<url>"
    },
    "name": "x402_fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe x402 endpoint (public http(s) URL), e.g. https://api.example.com/paid
bodyNoExample JSON request body, for a POST route that checks its input before the 402 (implies POST). Without it, {} is sent and the requestBody example in the endpoint's /openapi.json is tried.
stackNoYour server stack (default: detected)

Output Schema

NameRequiredDescriptionDefault
urlNo
fixesNoEach problem with steps and code for your stack
acceptsNoOnly on an unpaid call: the x402 payment options
overallNo
receiptNoSigned receipt (EIP-191) binding the answer to your arguments
summaryNo
unfixedNo
improvementsNoNot wrong, but makes the service easier to find, trust or pay: steps and code

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / method
      Removed value: -{
      -  "description": "HTTP method of the paid route (default: GET, then POST)",
      -  "enum": [
      -    "GET",
      -    "POST"
      -  ],
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • addedOutput schema / properties / improvements
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Not wrong, but makes the service easier to find, trust or pay: steps and code"
      +}
  3. Changed9 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +{}
    • changedOutput schema / properties / accepts / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/properties/fixes/anyOf/0"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / fixes / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": {},
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / overall / anyOf
      Added value: +[
      +  {
      +    "description": "pass, warn or fail",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / overall / description
      Removed value: -"pass, warn or fail"
    • removedOutput schema / properties / overall / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
    • changedOutput schema / properties / receipt / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / unfixed / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/properties/fixes/anyOf/0"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": {},
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / body
      Added value: +{
      +  "description": "Example JSON request body, for a POST route that checks its input before the 402 (implies POST). Without it, {} is sent and the requestBody example in the endpoint's /openapi.json is tried.",
      +  "maxLength": 16384,
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "accepts": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/properties/fixes/anyOf/0"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Only on an unpaid call: the x402 payment options"
      +    },
      +    "fixes": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": {},
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Each problem with steps and code for your stack"
      +    },
      +    "overall": {
      +      "description": "pass, warn or fail",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "receipt": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Signed receipt (EIP-191) binding the answer to your arguments"
      +    },
      +    "summary": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "unfixed": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/properties/fixes/anyOf/0"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "url": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  6. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds materially more: a $0.05 x402 payment with an enumerated set of accepted chains and assets, and a signed EIP-191 receipt bound to the arguments that lets the caller later prove which verdict was returned. That payment/auth and verifiability context is exactly what annotations cannot convey. It still omits payment-failure behavior (what happens if the x402 payment is rejected).

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?

The core action is front-loaded in the first sentence and every clause carries information. It is dense and long, and the nine-chain enumeration plus the parenthetical improvement list inflate the sentence well past what an agent needs to select the tool. Tighter phrasing would improve scanability.

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?

An output schema exists, so return values need not be explained; the description still usefully characterizes the shape of the answer (per-problem code, improvements, signed receipt). Payment cost and accepted networks are covered. The only real gap is failure/payment-decline behavior and whether the $0.05 applies per call or per problem found.

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 the schema already documents url, body and stack, including the enum values that the description merely repeats. The description adds a little meaning by explaining what the returned code is filled in with (payTo, amount, network, route), which tells the agent why url matters. Baseline 3 is appropriate when the schema carries the parameter burden.

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?

States a specific verb and resource: diagnoses an x402 endpoint and returns per-problem concrete code changes for a named stack, plus improvements for working endpoints. The scope is narrow and clearly differentiated from generic diagnostics by the 'returns code filled in with your own payTo, amount, network and route' clause. It never explicitly names the sibling x402_diagnose, so differentiation is inferred from the output rather than stated.

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?

'For the endpoint's owner; the diagnosis is included' weakly signals the use case and implies you don't need a separate diagnosis call. However, no alternative tool is named and no when-not condition is given, so an agent must infer whether x402_diagnose or x402_preflight should be used first.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.