x402_scaffold_agent_card_extension
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
| Name | Required | Description | Default |
|---|---|---|---|
| kid | No | Optional JWK/JWS `kid` identifier. | |
| seed | No | Optional 32-byte deterministic test seed (hex or base64url) in memory. | |
| skill_id | No | Skill identifier inside `agent-card.json` `skills[]`. | paid-a2a-skill |
| agent_name | Yes | Display name for the A2A v1.0.1 agent. | |
| skill_name | No | Human-readable skill title inside `agent-card.json`. | Paid A2A x402 Skill |
| description | Yes | Capability summary for the A2A agent and paid skill. | |
| price_minor | Yes | Exact positive integer price in atomic units (e.g. `50000` = `0.050000` USDC). | |
| endpoint_url | Yes | Public `https://` A2A JSON-RPC or HTTP endpoint URL. | |
| organization | No | Optional `provider.organization` name. | |
| provider_url | No | Optional `provider.url` homepage. | |
| caip2_network | No | CAIP-2 network (`eip155:8453`, `eip155:84532`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`, `stacks:1`). | eip155:8453 |
| payee_address | Yes | Recipient wallet/principal address (`payTo`) on `caip2_network`. | |
| protocol_binding | No | A2A v1.0.1 `supportedInterfaces[0].protocolBinding`. | JSONRPC |
| documentation_url | No | Documentation URL placed in `documentationUrl`. | https://khoaphan.dev/a2a-iq/ |
| max_timeout_seconds | No | Maximum authorization validity window (`maxTimeoutSeconds`). | |
| enable_ap2_extension | No | Include the AP2 `CartMandate` extension descriptor alongside `x402`. |