Skip to main content
Glama

Diogenes Web3, DeFi & 402 Security MCP

Pre-Payment HTTP 402 (L402 / x402 / MPP) Invoice & Macaroon Fraud Verifier

verify_http402_payment_challenge
Read-onlyIdempotent

Decodes inbound HTTP 402 Payment Required challenges (L402 BOLT11 + Macaroon, x402 Solana USDC, MPP Base intents) to verify cryptographic payment-hash binding and block overcharge fraud. Use when auditing a 402 challenge header before an autonomous agent pays a Lightning invoice or USDC transfer; for checking on-chain Bitcoin L1 mempool feerates, use estimate_bitcoin_mempool_fees instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'www_authenticate' ('protocol_hint' defaults to 'L402'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
protocol_hintNoExpected HTTP 402 payment protocol; defaults to 'L402' when omitted.
www_authenticateYesRaw WWW-Authenticate or Payment-Required HTTP header string from a 402 response.

Output Schema

NameRequiredDescriptionDefault
protocol_detectedYesIdentified 402 settlement protocol ('L402', 'x402', or 'MPP').
overcharge_detectedYesTrue if the invoice amount exceeds the declared endpoint price ceiling.
payment_safety_verdictYesAuthorization recommendation ('SAFE_TO_PAY' or 'REJECT_HASH_MISMATCH').
macaroon_payment_hash_matches_bolt11YesTrue when the macaroon caveat hash matches the BOLT11 invoice payment hash.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses statelessness, a 32 KB payload ceiling, a 60 RPM rate limit, and that invalid input yields HTTP 400 — operational facts an agent cannot get from structured fields. Annotations already cover the safety profile, so this is pure added value.

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?

Three dense, well-ordered sentences: purpose, usage/alternative, operational constraints — properly front-loaded with no filler. It is somewhat run-on, and the '?demo=true' / '15 sats' fragment is compressed to the point of obscurity.

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 an output schema handling return values and annotations covering safety, the description still supplies what an agent needs to call correctly: input source (raw WWW-Authenticate header), default protocol, size/rate limits, and error behavior. Nothing material is missing.

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 coverage is 100%, so the baseline is 3; the description restates the 'protocol_hint' default of L402 which the schema already documents verbatim. The reference to '?demo=true' and 'L402 (15 sats)' is cryptic and maps to no declared parameter, adding ambiguity rather than semantics.

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 specific verbs (decodes, verifies) against a specific resource (inbound HTTP 402 payment challenges) and enumerates the three supported protocol shapes (L402 BOLT11+Macaroon, x402 Solana USDC, MPP Base). It explicitly names the sibling it is not (estimate_bitcoin_mempool_fees), so an agent can route 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 Guidelines5/5

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

Gives an explicit trigger — 'Use when auditing a 402 challenge header before an autonomous agent pays a Lightning invoice or USDC transfer' — plus a named alternative for the adjacent need. When-to-use and when-to-use-something-else are both present.

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.