Agent Protocol Inspector via x402 Wire v2: A Technical Tutorial
Call 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.
Agent Protocol Inspector 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.
The Endpoint
POST /api/v1/agent-protocol-inspector/x402-v2
Price: $0.02 per call
Body: { "url": "<URL to scan>" }
The 402 Challenge
curl -i -X POST https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2 \
-H "Content-Type: application/json" \
-d '{"url":"example.com"}'
Same shape as every other ContextIQ v2 route: the actual challenge is base64-encoded JSON in the PAYMENT-REQUIRED response header, not the body.
{
"x402Version": 2,
"resource": { "url": "https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2" },
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "20000", "payTo": "0x4eba5ea3cf0f3fc307099317e17e54390f7a4c58", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }],
"extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "POST", "schema": { "properties": { "url": { "type": "string" } }, "required": ["url"] } } } } }
}
Option A: API Key
curl -X POST https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2 \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"example.com"}'
Option B: Pay With x402, No API Key
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { wrapFetchWithPayment } from "@x402/fetch";
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const client = createWalletClient({ account, transport: http(), chain: base });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPayment("https://contextiq.trango-compute.com/api/v1/agent-protocol-inspector/x402-v2", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "example.com" }),
});
console.log(await res.json());
The Response
Real output from a live scan (ContextIQ's own domain, run today):
{
"target": "https://contextiq.trango-compute.com",
"origin": "https://contextiq.trango-compute.com",
"protocols": {
"mcp": { "status": "not_detected", "evidence": [] },
"a2a": { "status": "not_detected", "evidence": [] },
"ard": { "status": "not_detected", "evidence": [] }
},
"llmsTxt": { "found": true, "url": "https://contextiq.trango-compute.com/llms.txt" },
"detectedCount": 0
}
Each 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.
Worth 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."
Try It
Agent Protocol Inspector 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.
Follow Trango Compute on LinkedIn
We post updates on new tools, context engineering patterns, and LLM cost research.