A2A Agent Card validate
FREE with proof-of-workor $0.002 in USDC
POST /api/a2a-card-validateValidate an A2A (Agent2Agent protocol) Agent Card: required fields, skill shape, transport names, capability flags - spec v0.3 structural core.
Details
Returns errors, interop warnings, and a normalized summary (skills, interfaces, capabilities). Deterministic mini-A2A tooling - check a card before your agent trusts it.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
card | object | yes | the Agent Card JSON (object or JSON string) |
Free call, no wallet
Fetch a challenge, solve its sha256 puzzle (16 leading zero bits), resend with X-Pow-Solution.
import { createHash } from "node:crypto";
const lz = (b) => { let t = 0; for (const x of b) { if (!x) { t += 8; continue; } t += Math.clz32(x) - 24; break; } return t; };
const c = await (await fetch("https://agent402.tools/api/pow/challenge?slug=a2a-card-validate")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/a2a-card-validate", { method: "POST", headers: { "X-Pow-Solution": c.token + ":" + n, "Content-Type": "application/json" }, body: JSON.stringify({"card":{"protocolVersion":"0.3.0","name":"Sample Weather Agent","description":"A sample A2A Agent Card served as a static example for card tooling. This describes a fictional weather agent, not a live A2A endpoint.","url":"https://example.com/a2a/v1","preferredTransport":"JSONRPC","version":"1.0.0","provider":{"organization":"Example Org","url":"https://example.com"},"capabilities":{"streaming":true,"pushNotifications":false,"stateTransitionHistory":false},"defaultInputModes":["application/json","text/plain"],"defaultOutputModes":["application/json"],"skills":[{"id":"get-forecast","name":"Get weather forecast","description":"Returns a city's 5-day forecast.","tags":["weather","forecast"],"examples":["What is the weather in Paris this week?"]}]}}) });Python:
import hashlib, json, urllib.request
def zero_bits(digest):
n = 0
for b in digest:
if b:
return n + 8 - b.bit_length()
n += 8
return n
c = json.load(urllib.request.urlopen("https://agent402.tools/api/pow/challenge?slug=a2a-card-validate"))
n = 0
while zero_bits(hashlib.sha256(f"{c['challenge']}:{n}".encode()).digest()) < c["difficulty"]:
n += 1
req = urllib.request.Request("https://agent402.tools/api/a2a-card-validate", method="POST", data="{\"card\":{\"protocolVersion\":\"0.3.0\",\"name\":\"Sample Weather Agent\",\"description\":\"A sample A2A Agent Card served as a static example for card tooling. This describes a fictional weather agent, not a live A2A endpoint.\",\"url\":\"https://example.com/a2a/v1\",\"preferredTransport\":\"JSONRPC\",\"version\":\"1.0.0\",\"provider\":{\"organization\":\"Example Org\",\"url\":\"https://example.com\"},\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":false},\"defaultInputModes\":[\"application/json\",\"text/plain\"],\"defaultOutputModes\":[\"application/json\"],\"skills\":[{\"id\":\"get-forecast\",\"name\":\"Get weather forecast\",\"description\":\"Returns a city's 5-day forecast.\",\"tags\":[\"weather\",\"forecast\"],\"examples\":[\"What is the weather in Paris this week?\"]}]}}".encode(), headers={"X-Pow-Solution": f"{c['token']}:{n}", "Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(req)))Example request
curl -i -X POST https://agent402.tools/api/a2a-card-validate \
-H "Content-Type: application/json" \
-d '{"card":{"protocolVersion":"0.3.0","name":"Sample Weather Agent","description":"A sample A2A Agent Card served as a static example for card tooling. This describes a fictional weather agent, not a live A2A endpoint.","url":"https://example.com/a2a/v1","preferredTransport":"JSONRPC","version":"1.0.0","provider":{"organization":"Example Org","url":"https://example.com"},"capabilities":{"streaming":true,"pushNotifications":false,"stateTransitionHistory":false},"defaultInputModes":["application/json","text/plain"],"defaultOutputModes":["application/json"],"skills":[{"id":"get-forecast","name":"Get weather forecast","description":"Returns a city'\''s 5-day forecast.","tags":["weather","forecast"],"examples":["What is the weather in Paris this week?"]}]}}'Watch a call get paid
Request
POST /api/a2a-card-validate402
$0.002 USDCSign
PAYMENT-SIGNATURESettle
on 14 chainsAnswer
200 OKReceipt
Agent402-ReceiptEd25519Example response
{
"valid": true,
"errors": [],
"warnings": [],
"summary": {
"name": "Sample Weather Agent",
"skillCount": 1
}
}| Field | Type | Always present | In the example |
|---|---|---|---|
valid | boolean | yes | true |
errors | array | yes | 0 items in the example |
warnings | array | yes | 0 items in the example |
summary | object | yes | 2 fields: name, skillCount |
From an MCP client
catalog.call {
"slug": "a2a-card-validate",
"params": {
"card": {
"protocolVersion": "0.3.0",
"name": "Sample Weather Agent",
"description": "A sample A2A Agent Card served as a static example for card tooling. This describes a fictional weather agent, not a live A2A endpoint.",
"url": "https://example.com/a2a/v1",
"preferredTransport": "JSONRPC",
"version": "1.0.0",
"provider": {
"organization": "Example Org",
"url": "https://example.com"
},
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": false
},
"defaultInputModes": [
"application/json",
"text/plain"
],
"defaultOutputModes": [
"application/json"
],
"skills": [
{
"id": "get-forecast",
"name": "Get weather forecast",
"description": "Returns a city's 5-day forecast.",
"tags": [
"weather",
"forecast"
],
"examples": [
"What is the weather in Paris this week?"
]
}
]
}
}
}Hosted connector (https://agent402.tools/mcp): free, rate-limited. Stdio package: npx -y agent402-mcp@0.18.0.
Errors and behavior
- Pay $0.002 per call over x402 or MPP, or free with proof-of-work (16 leading zero bits of sha256): this tool makes no outbound network call.
- Required:
card; a rejected input answers 4xx witherror,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A bodyless
GETorHEADreturns the same 402 quote. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.002" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/a2a-card-validate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"card": {
"protocolVersion": "0.3.0",
"name": "Sample Weather Agent",
"description": "A sample A2A Agent Card served as a static example for card tooling. This describes a fictional weather agent, not a live A2A endpoint.",
"url": "https://example.com/a2a/v1",
"preferredTransport": "JSONRPC",
"version": "1.0.0",
"provider": {
"organization": "Example Org",
"url": "https://example.com"
},
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": false
},
"defaultInputModes": [
"application/json",
"text/plain"
],
"defaultOutputModes": [
"application/json"
],
"skills": [
{
"id": "get-forecast",
"name": "Get weather forecast",
"description": "Returns a city's 5-day forecast.",
"tags": [
"weather",
"forecast"
],
"examples": [
"What is the weather in Paris this week?"
]
}
]
}
}),
});Get a wallet or run npx -y agent402-mcp@0.18.0 wallet new.