Skip to main content
Glama

Agent Shield (MCP tool-poisoning and x402 payment scanner)

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

check_x402_payment

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.3/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full disclosure burden and does so well: it makes a real outbound HTTP call (GET/POST) to a remote endpoint, explicitly never pays, and discloses the cost model (0.002 USDC per call, first 3 free daily). It also describes the return payload — price in USD, letter grade, and findings — so the agent knows what it gets back.

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 core action and the guarantee ('Never pays') come first, followed by the checklist of validations, then the return shape and pricing. It is a dense single block, but each clause maps to a real check and nothing is 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, and the description compensates by naming the returned fields (USD price, A-F grade, findings) and the cost of invocation. It stops short of describing failure behavior — timeouts, unreachable endpoints, non-402 responses — which an agent probing arbitrary URLs would benefit from knowing.

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 the baseline is 3; the description adds no per-parameter meaning beyond noting that the offer may arrive as a v1 body or a v2 PAYMENT-REQUIRED header. It reinforces that the `payment` header is unnecessary during the free sample, but that is already implied by the schema field description.

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 states a specific verb and resource — it probes a paid x402 endpoint without paying and validates each payment option — and enumerates exactly what is checked (USDC contract, price reasonableness, payTo validity, resource/site match, prompt injection). This is clearly distinct from the sibling scanning tools, which operate on MCP servers, tool definitions, and text rather than live x402 offers.

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?

Usage context is explicit and front-loaded: 'Check a paid x402 API before paying' tells the agent this is a pre-payment gate, and 'Never pays' reinforces the safe-probe framing. It does not name alternatives or state when-not to use it, but no competing sibling performs this function, so the omission is minor.

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.

Resources