Skip to main content
Glama

x402, crypto, defi, base, usdc, evm, security, sec-edgar, news, web-search

Pre-flight x402 security audit

x402_endpoint_audit
Read-onlyIdempotent

[$0.002] Pre-flight x402 endpoint security firewall. Probes any x402 URL before payment to detect wallet-drain price spikes, SIWx origin spoofing, fake USDC contracts, and prompt injections. Do not use for EVM calldata/Permit2 vetting (use workflow_tx_guardian) or token bytecode scans (use token_contract_audit). method sets the HTTP probe verb (GET vs POST) used to trigger the 402 header, deep_audit=true runs prompt-injection checks, and max_acceptable_usd caps price validation. Live HTTP probe, read-only; requires x402 USDC or Stripe MPP (10 free lifetime calls via /api/free/*) at 30-60 req/min.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "x402_endpoint_audit"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoTarget x402 endpoint URL to inspect (https only)
methodNoHTTP method for the unpaid probePOST
deep_auditNoAdd one local-LLM prompt-injection audit of the 402 metadata
session_tokenNoOptional prepaid session token (x402s_...) from https://apix402data.com/pay after the 10-call free preview.
max_acceptable_usdNoYour maximum acceptable price in USD

Output Schema

NameRequiredDescriptionDefault
probeNo
cachedNo
checksNo
pay_toNo
networkNo
endpointNo
warningsNo
final_urlNo
deep_auditNo
risk_levelNo
risk_scoreNo
target_urlNo
safe_to_payNo
x402_versionNo
schema_versionNo
payment_optionsNo
quoted_price_usdNo
max_acceptable_usdNo
stripe_mpp_offeredNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / session_token
      Added value: +{
      +  "description": "Optional prepaid session token (x402s_...) from https://apix402data.com/pay after the 10-call free preview.",
      +  "type": "string"
      +}
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, open-world and non-destructive, and the description still adds real operational context: a live HTTP probe, a $0.002 cost, x402 USDC or Stripe MPP payment requirement, 10 free lifetime calls via /api/free/*, and a 30-60 req/min rate limit. This is exactly the auth/cost/limit context annotations cannot express.

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?

Front-loaded with purpose, then exclusions, then parameter semantics, then operational constraints - a logical order with no filler sentences. The bracketed price tag and 'security firewall' framing are slightly promotional but each sentence still carries information.

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?

For a paid, externally-facing probe with an output schema present, the description covers everything an agent needs before calling: safety profile, cost, payment/auth path, free tier, rate limits, and sibling routing. Return values are correctly left to the output schema.

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%, so the baseline is 3, but the description goes further by explaining why `method` matters (it triggers the 402 header), what `deep_audit=true` actually adds (local-LLM prompt-injection checks), and that `max_acceptable_usd` caps price validation. Only `session_token` is left to 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?

States a specific verb and resource ('Probes any x402 URL before payment') plus the exact threat classes it detects (price spikes, SIWx origin spoofing, fake USDC contracts, prompt injections). It also names the two siblings it is not, so the agent can discriminate without opening another schema.

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

Usage Guidelines5/5

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

Explicit timing ('pre-flight ... before payment') and explicit exclusions with redirects: EVM calldata/Permit2 vetting goes to workflow_tx_guardian, bytecode scans to token_contract_audit. Both when-to-use and when-not-to-use are covered.

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