Skip to main content
Glama

Scan one x402 endpoint for a well-formed 402 challenge

scan_endpoint
Read-onlyIdempotent

Probes one x402 endpoint to verify it returns a valid HTTP 402 payment challenge, validates required envelope fields and MPP dual-stack support, and reports findings without sending a payment.

Instructions

Free, local, no-payment health probe for one x402 endpoint. GETs the URL (retries once as POST with {} on a 405), then checks: is the response HTTP 402; does it carry a valid PAYMENT-REQUIRED envelope (Base64 JSON with numeric x402Version and a non-empty accepts[] where every entry has scheme/network/asset/payTo/amount), falling back to checking the body for an x402Version field; and does it also advertise MPP dual-stack via WWW-Authenticate: Payment. Grades A (valid envelope + MPP dual-stack), B (valid envelope only), C (402 but the envelope is missing or malformed), or F (not 402, unreachable, or serving paid content for free). Never sends a PAYMENT-SIGNATURE and cannot spend funds — this only inspects the challenge shape. Refuses non-http(s) URLs, localhost/.internal/.local hosts, private/reserved IPs, and ports outside 80/443/8080/8443; never follows redirects; caps the response body at 64KB; makes at most 2 requests.

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": {
      "url": "<url>"
    },
    "name": "scan_endpoint"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe x402 endpoint URL to probe, e.g. https://api.example.com/paid-route

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.9

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only and idempotent, but the description adds substantial context beyond them: it discloses the GET-then-POST-on-405 retry, the absence of PAYMENT-SIGNATURE, that no funds can be spent, the rejection of localhost/private IPs/non-standard ports, no redirect following, a 64KB body cap, and a hard limit of 2 requests. These are exactly the behavioral constraints an agent needs to predict side effects and failures.

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?

Purpose and safety constraints are front-loaded, and every clause carries information relevant to calling or interpreting the tool. The middle section packs the validation logic and grading rubric into a dense semicolon chain, which is efficient but slightly harder to parse than discrete sentences or bullets.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by fully specifying the return semantics via the A/B/C/F grading rubric and by enumerating the exact validation checks performed. Combined with the request caps and refusal rules, an agent has everything needed to interpret results and avoid misuse.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single url parameter is already well documented, so baseline is high. The description adds meaning beyond the schema by clarifying how the URL is used (GET, with a POST-with-{} retry on 405) and by listing the host/scheme/port restrictions that the schema does not encode.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('health probe for one x402 endpoint') and immediately bounds the scope with 'one' and 'local, no-payment', which distinguishes it from scan_batch and census_stats. An agent knows exactly what operation this performs without opening the schema.

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

Usage Guidelines4/5

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

The phrase 'Free, local, no-payment health probe for one x402 endpoint' establishes the use context, and 'one' implicitly signals the single-endpoint scope versus a batch tool. It never explicitly says when not to use it or names scan_batch as the alternative for multiple URLs, so it falls short of a 5.

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

Deploy Server

Other Tools