Skip to main content
Glama

x402_scaffold_agent_card_extension

Read-onlyIdempotent

Generates spec-compliant HTTP 402 PAYMENT-REQUIRED headers and a S4-REJECT-005-safe signed A2A v1.0.1 agent-card.json + JWKS bundle with x402/AP2 extensions for ProtoJSON JWS verification.

Instructions

Generate spec-compliant HTTP 402 PAYMENT-REQUIRED JSON/base64 headers and a strict S4-REJECT-005-safe A2A v1.0.1 /.well-known/agent-card.json + /.well-known/jwks.json bundle with x402 & AP2 extensions signed in pure Python (RFC 8032 Ed25519 + RFC 8785 JCS) without breaking ProtoJSON JWS verification.

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": {
      "agent_name": "<agent_name>",
      "description": "<description>",
      "endpoint_url": "<endpoint_url>",
      "payee_address": "<payee_address>",
      "price_minor": "<price_minor>"
    },
    "name": "x402_scaffold_agent_card_extension"
  }
}

Input Schema

NameRequiredDescriptionDefault
kidNoOptional JWK/JWS `kid` identifier.
seedNoOptional 32-byte deterministic test seed (hex or base64url) in memory.
skill_idNoSkill identifier inside `agent-card.json` `skills[]`.paid-a2a-skill
agent_nameYesDisplay name for the A2A v1.0.1 agent.
skill_nameNoHuman-readable skill title inside `agent-card.json`.Paid A2A x402 Skill
descriptionYesCapability summary for the A2A agent and paid skill.
price_minorYesExact positive integer price in atomic units (e.g. `50000` = `0.050000` USDC).
endpoint_urlYesPublic `https://` A2A JSON-RPC or HTTP endpoint URL.
organizationNoOptional `provider.organization` name.
provider_urlNoOptional `provider.url` homepage.
caip2_networkNoCAIP-2 network (`eip155:8453`, `eip155:84532`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`, `stacks:1`).eip155:8453
payee_addressYesRecipient wallet/principal address (`payTo`) on `caip2_network`.
protocol_bindingNoA2A v1.0.1 `supportedInterfaces[0].protocolBinding`.JSONRPC
documentation_urlNoDocumentation URL placed in `documentationUrl`.https://khoaphan.dev/a2a-iq/
max_timeout_secondsNoMaximum authorization validity window (`maxTimeoutSeconds`).
enable_ap2_extensionNoInclude the AP2 `CartMandate` extension descriptor alongside `x402`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds meaningful behavior: signing uses RFC 8032 Ed25519 and RFC 8785 JCS, the output must be S4-REJECT-005-safe, and it must not break ProtoJSON JWS verification.

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?

It is a single front-loaded sentence with no filler, and the generated artifacts are placed early. The dense acronyms, slashes, and parenthetical standards make it harder to scan than necessary, but every clause is relevant.

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?

This is a complex 16-parameter signing/scaffolding tool with no output schema. The description names the generated artifacts and standards but does not explain the return shape, whether files are written, or how the generated header and bundle are structured in the response.

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 explains the parameters in detail and the baseline is 3. The description reinforces that AP2/x402 extensions and signed outputs are involved, but it does not add per-parameter meaning beyond 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?

States a specific verb, Generate, and precise resources: HTTP 402 PAYMENT-REQUIRED headers plus A2A agent-card.json and jwks.json bundles with x402/AP2 extensions. It is distinguishable from siblings by output, but it never explicitly names an alternative or scope boundary, so it falls short of a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use, when-not-to-use, prerequisite, or alternative-tool guidance. The description only implies it is for scaffolding a signed x402/AP2 agent-card bundle, leaving the agent to infer usage context.

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