{"slug": "agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial", "title": "Agent Protocol Inspector via x402 Wire v2: A Technical Tutorial", "summary": "ContextIQ's Agent Protocol Inspector now offers an x402 wire v2 endpoint at $0.02 per call that scans any URL for MCP, A2A, ARD, and llms.txt support, payable via an API key or the @x402/fetch library on Base (eip155:8453). A live scan of ContextIQ's own domain returned detectedCount: 0, with mcp, a2a, and ard all not_detected and llmsTxt found at https://contextiq.trango-compute.com/llms.txt. Each protocol returns status confirmed, indicated, or not_detected with evidence naming the specific .well-known path or response header checked.", "body_md": "# Agent Protocol Inspector via x402 Wire v2: A Technical Tutorial\n\nCall ContextIQ's Agent Protocol Inspector via x402 wire v2 to detect MCP, A2A, ARD, and llms.txt support on any URL, paid with @x402/fetch or an API key.\n\n[Agent Protocol Inspector](https://contextiq.trango-compute.com/agent-readiness-detector) checks whether a URL supports MCP (Model Context Protocol), A2A (Agent2Agent), ARD (Agentic Resource Discovery), or publishes an `llms.txt` file — the signals that tell you whether a service is actually built to be used by an autonomous agent, or just a regular website an agent happens to be able to scrape. This is a tutorial for its **x402 wire v2** endpoint.\n\n## The Endpoint\n\n```\nPOST /api/v1/agent-protocol-inspector/x402-v2\nPrice: $0.02 per call\nBody: { \"url\": \"<URL to scan>\" }\n```\n\n## The 402 Challenge\n\n```\ncurl -i -X POST https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"example.com\"}'\n```\n\nSame shape as every other ContextIQ v2 route: the actual challenge is base64-encoded JSON in the `PAYMENT-REQUIRED` response header, not the body.\n\n```\n{\n  \"x402Version\": 2,\n  \"resource\": { \"url\": \"https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2\" },\n  \"accepts\": [{ \"scheme\": \"exact\", \"network\": \"eip155:8453\", \"amount\": \"20000\", \"payTo\": \"0x4eba5ea3cf0f3fc307099317e17e54390f7a4c58\", \"asset\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\" }],\n  \"extensions\": { \"bazaar\": { \"info\": { \"input\": { \"type\": \"http\", \"method\": \"POST\", \"schema\": { \"properties\": { \"url\": { \"type\": \"string\" } }, \"required\": [\"url\"] } } } } }\n}\n```\n\n## Option A: API Key\n\n```\ncurl -X POST https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2 \\\n  -H \"Authorization: Bearer sk_live_...\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"example.com\"}'\n```\n\n## Option B: Pay With x402, No API Key\n\n``` js\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { base } from \"viem/chains\";\nimport { wrapFetchWithPayment } from \"@x402/fetch\";\n\nconst account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);\nconst client = createWalletClient({ account, transport: http(), chain: base });\nconst fetchWithPayment = wrapFetchWithPayment(fetch, client);\n\nconst res = await fetchWithPayment(\"https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ url: \"example.com\" }),\n});\n\nconsole.log(await res.json());\n```\n\n## The Response\n\nReal output from a live scan (ContextIQ's own domain, run today):\n\n```\n{\n  \"target\": \"https://contextiq.trango-compute.com\",\n  \"origin\": \"https://contextiq.trango-compute.com\",\n  \"protocols\": {\n    \"mcp\": { \"status\": \"not_detected\", \"evidence\": [] },\n    \"a2a\": { \"status\": \"not_detected\", \"evidence\": [] },\n    \"ard\": { \"status\": \"not_detected\", \"evidence\": [] }\n  },\n  \"llmsTxt\": { \"found\": true, \"url\": \"https://contextiq.trango-compute.com/llms.txt\" },\n  \"detectedCount\": 0\n}\n```\n\nEach protocol's `status` is `confirmed` (found and validated), `indicated` (some signal, e.g. a route exists but didn't fully validate), or `not_detected`. `evidence` names exactly what was checked and found, so a `confirmed` result isn't a black-box claim — you can see the specific `.well-known` path or response header that triggered it. `detectedCount` is a quick sum across the three protocols; `llmsTxt` is tracked separately since it's a content convention, not an agent-callable protocol.\n\nWorth internalizing from real-world scanning: most of the internet, including plenty of services that are perfectly usable by an agent via plain HTTP, will show `detectedCount: 0`. That's expected, not a failure — this tool answers \"does this URL declare agent-native protocol support,\" not \"can an agent use this at all.\"\n\n## Try It\n\n[Agent Protocol Inspector](https://contextiq.trango-compute.com/agent-readiness-detector) is free from the dashboard, or callable via the API above for checking a counterparty's agent-readiness before your own agent decides how to integrate with it.\n\nFollow Trango Compute on LinkedIn\n\nWe post updates on new tools, context engineering patterns, and LLM cost research.\n\n[Follow on LinkedIn](https://www.linkedin.com/company/trango-compute)", "url": "https://wpnews.pro/news/agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial", "canonical_source": "https://contextiq.trango-compute.com/blog/agent-protocol-inspector-v2-tutorial-mcp-a2a-ard", "published_at": "2026-09-14 00:00:00+00:00", "updated_at": "2026-09-28 15:20:05.275908+00:00", "lang": "en", "topics": ["agent-protocols", "ai-agents", "ai-tools", "developer-tools"], "entities": ["ContextIQ", "Agent Protocol Inspector", "Model Context Protocol", "Agent2Agent", "Agentic Resource Discovery", "@x402/fetch", "Base"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial", "markdown": "https://wpnews.pro/news/agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial.md", "text": "https://wpnews.pro/news/agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial.txt", "jsonld": "https://wpnews.pro/news/agent-protocol-inspector-via-x402-wire-v2-a-technical-tutorial.jsonld"}}