Skip to main content
Glama

Agent Toolkit (all-in-one)

Check a paid x402 API before paying: real USDC contract, sane price, valid wallet, same site, no injected instructions

check_x402_payment

[Agent Shield] Calls the endpoint without paying, reads its HTTP 402 x402 offer (v1 body or v2 PAYMENT-REQUIRED header) and checks each payment option: is the asset the official USDC contract for that network, is the price reasonable, is payTo a valid (non-zero) address, does the payment resource match the site, and do descriptions contain prompt injection. Returns price in USD, grade A-F and findings. Never pays. Price 0.002 USDC per call; first 3 calls per day free.

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": "check_x402_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe paid endpoint URL
bodyNoOptional JSON body to send when probing
methodNoHTTP method to probe with (default POST)
paymentNoOptional x402 payment (base64 X-PAYMENT header value). Not needed while the free daily sample lasts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the no-payment probe behavior, enumerates the five checks performed (USDC contract identity, price sanity, valid payTo, resource/site match, prompt-injection in descriptions), and states the return shape (price in USD, grade A-F, findings). It does not say how non-402 responses, timeouts, or unreachable hosts are reported, which matters for a network probe.

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?

The probe-and-never-pay behavior is front-loaded in the first sentence, followed by the return shape and cost, so the agent gets the essentials first. The middle sentence is long and comma-heavy from the checklist enumeration, but every clause carries checkable information rather than filler.

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

Completeness4/5

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

There is no output schema, so the description correctly compensates by naming the returned fields (price in USD, grade, findings) and the pricing model. For a four-parameter tool with nested body input this is nearly complete; only error and non-402 handling are left unspecified.

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

Parameters3/5

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

Schema description coverage is 100%, so all four parameters — url, body, method, payment — are already documented and the baseline is 3. The description adds context for `payment` (the free daily sample means it is usually unnecessary) and explains why a `body` might be sent (probing the offer), but adds no format or default detail beyond the schema.

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?

The description names a concrete verb sequence — calls the endpoint without paying, reads its HTTP 402 x402 offer (v1 body or v2 PAYMENT-REQUIRED header), and validates each payment option. The 'x402 payment offer' resource is specific enough that an agent can separate this from generic URL readers like safe_read_url or check_domain_trust 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 title and first clause establish the usage context clearly: run this before paying a pay-per-call API. 'Never pays' sets a hard expectation and 'first 3 calls per day free' tells the agent there is a low-cost trial. It stops short of explicit when-not guidance or naming a sibling alternative for non-x402 URL reads.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.