Skip to main content
Glama

validate_extension

Read-onlyIdempotent

Structurally validate an x402 extension payload, checking the typed { info, schema } envelope and known-extension fields before schema validation. Use it as a fast local gate.

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?

Annotations already declare readOnly, idempotent, non-destructive, and closed-world behavior, so the bar is lower; the description reinforces this with "No network" and adds the important limitation that validation is structural only, which is genuinely new context. What is missing is any hint about failure reporting (e.g., whether errors are returned as a list versus thrown), which matters for a validator.

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 scope and the field-check list are front-loaded, and the closing sentence efficiently delimits the tool's ceiling. Slightly dense with parenthetical lists, but no sentence is pure padding.

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 two-parameter read-only validator with no output schema, the description covers inputs, scope, and limits well. The remaining gap is the absence of any statement about what a validation result looks like beyond a vague "spec pointer," which an agent calling this cold would want to know.

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 schema already documents both `name` and `payload`, including that payload may be an entry, a map, or an array. The description restates those accepted shapes and clarifies the `name` tie-in for single entries, but adds no format or ordering detail beyond the schema. Baseline 3 is appropriate.

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?

Uses a specific verb+resource pair ("Structurally validate an x402 extension payload") and immediately enumerates the concrete checks performed (envelope, offer-and-receipt, payment_identifier, gas-sponsoring, sign-in-with-x, builder_code). This is clearly distinguishable from siblings like lint_scheme_spec or run_conformance without opening any schema.

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?

Explicitly bounds the tool: it is the structural gate, not full JSON-schema validation, and that full validation requires the extension's published schema. The exclusion is stated rather than implied. It stops short of naming which sibling to use when full schema validation is required, so routing is only partial.

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