Skip to main content
Glama

Settlens

Should I pay this x402 request?

evaluate_payment_requirements
Read-onlyIdempotent

Call this on every HTTP 402 response BEFORE paying. Give it the PAYMENT-REQUIRED header value, the URL you requested and your spending policy (pay_to, assets, networks and max_amount, optionally schemes). Offline: it decodes and validates the x402 V2 payment request with the official @x402/core schema, checks that it is bound to the URL you requested, validates every payment option (scheme, CAIP-2 network, amount, asset, payTo, timeout window) and applies your policy to each option, since you pay with only one. Returns decision 'pay', 'review' (ask the human first) or 'do_not_pay' (never pay), the reasons, and the payment options that satisfy your policy (acceptable). It does not check balances, settlement or what the token at asset does, and it never pays.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policyNoYour spending policy, applied to each advertised payment option. Set at least pay_to, assets, networks and max_amount: without all four, the decision can never be 'pay'.
resource_urlNoThe exact URL you requested. Strongly recommended: without it the resource binding cannot be confirmed and the decision is at best 'review'.
payment_requiredYesThe raw PAYMENT-REQUIRED response header value (Base64 JSON), the same object as a JSON string, or the decoded object.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
checksYes
reasonsYes
summaryYes
decisionYes
acceptableYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: the evaluation is offline, uses the official @x402/core schema, enforces URL binding, validates each payment option (scheme, CAIP-2 network, amount, asset, payTo, timeout), applies the policy per option because only one is paid, and explicitly never pays. It also discloses a degradation path (missing resource_url caps the decision at 'review').

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 imperative action and timing are front-loaded in the first sentence, followed by inputs, then behavior, then the return contract and exclusions. It is dense and mostly earns its length, though the long middle sentence enumerating validated fields is heavier than needed.

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 present, the description still summarizes the return contract (decision values, reasons, acceptable options) without over-explaining. For a 3-parameter tool with nested policy objects and full schema coverage, an agent has everything needed to call it correctly and interpret the result.

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% and each policy field (pay_to, assets, networks, max_amount, schemes) is documented in the schema with examples and matching rules. The description restates which inputs to supply and adds the rationale that the policy is applied to each option 'since you pay with only one,' but adds no syntax or format detail beyond the schema. Baseline 3 is appropriate.

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 specific verb and resource ('decodes and validates the x402 V2 payment request') and states the exact decision output ('pay', 'review', 'do_not_pay'). It is clearly distinguishable from siblings like verify_payment_signature or verify_attestation, which verify artifacts rather than evaluate requirements against a policy.

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 trigger is explicit and well-placed: 'Call this on every HTTP 402 response BEFORE paying.' It also scopes out adjacent concerns ('does not check balances, settlement or what the token at asset does, and it never pays'). It does not name alternative tools or say when NOT to call it, so it stops 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources