Skip to main content
Glama

validate_extension

Structurally validate x402 extension payloads by checking the { info, schema } envelope and known-extension fields, with optional spec pointers when full JSON-schema validation is needed.

Instructions

Structurally validate an x402 extension payload: checks the typed { info, schema } envelope and runs light known-extension field checks (offer-and-receipt, payment_identifier, gas-sponsoring, sign-in-with-x, builder_code). Pass payload as a single entry (with name), an extensions map keyed by name, or an array. Full JSON-schema validation needs the extension’s published schema; this is the structural gate plus a spec pointer. No network.

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": {
      "payload": "<payload>"
    },
    "name": "validate_extension"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoOptional extension name when `payload` is a single entry.
payloadYesAn extension entry, an extensions map, or an array of entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and discloses useful traits: it runs light known-extension checks, does not perform full JSON-schema validation, and uses no network. It does not explicitly state read-only/no-side-effect behavior or describe how failures are reported.

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

Conciseness5/5

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

The purpose and limitation are front-loaded in two dense sentences. The list of known-extension checks is specific and earns its place, with no filler.

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

Completeness3/5

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

The description covers scope, accepted input shapes, and the no-network limitation, which is useful for a low-complexity validator. With no output schema, it leaves an important gap by not explaining what the validation returns or how invalid payloads are reported.

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 coverage is 100%, so the input schema already documents both parameters and the three accepted payload shapes. The description restates those forms but adds little syntax or constraint detail beyond the schema.

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?

The description gives a specific verb and resource: structurally validate an x402 extension payload. It also scopes the operation to the typed { info, schema } envelope and light known-extension checks, distinguishing it from full JSON-schema validation.

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?

It explains when this structural gate is appropriate and notes that full JSON-schema validation requires the extension’s published schema. However, it does not explicitly route the agent among sibling tools such as run_conformance or check_compliance.

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