Skip to main content
Glama

Moneda

pay_x402

Destructive

Pay for a resource using the x402 protocol (HTTP 402 Payment Required).

When an API returns HTTP 402 with x402 paymentRequirements, use this tool to initiate the payment. The payment requires user approval in the Moneda app before it executes.

Parameters map to x402 paymentRequirements fields:

  • payTo: the recipient wallet address from the 402 response

  • amount: the payment amount (e.g. "0.01")

  • currency: USD or EUR (maps to USDC or EURC on Base)

  • resource: the URL being paid for (shown to the user for context)

  • network: must match the Moneda deployment ("base" or "base-sepolia")

After calling this tool, poll get_payment_status every 10-15 seconds until a terminal status (COMPLETED, FAILED, EXPIRED, REJECTED). On COMPLETED the funds settle on-chain to payTo. Note: Moneda does not yet emit the x402 X-PAYMENT proof header, so a bare retry only unlocks the resource if its facilitator accepts on-chain settlement as proof.

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": {
      "amount": "<amount>",
      "currency": "<currency>",
      "payTo": "<payTo>",
      "resource": "<resource>",
      "network": "<network>"
    },
    "name": "pay_x402"
  }
}

Input Schema

NameRequiredDescriptionDefault
payToYesRecipient wallet address (0x-prefixed, 42 chars) from paymentRequirements.payTo.
amountYesPayment amount in human-readable form (e.g. "0.01"). From paymentRequirements.maxAmountRequired or the exact price.
networkYesBlockchain network from paymentRequirements.network. Must be "base" or "base-sepolia".
currencyYesPayment currency. USD maps to USDC, EUR maps to EURC.
resourceYesThe URL that returned HTTP 402. Stored for audit and shown to the user.
referenceNoOptional payment memo/reference (max 140 chars).
maxAmountRequiredNoMaximum amount from the 402 response, if different from amount.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only mark it destructive; the description adds far more: the payment requires user approval in the Moneda app before execution, funds settle on-chain to payTo on COMPLETED, and Moneda does not yet emit the X-PAYMENT proof header so a bare retry may not unlock the resource. These are non-obvious behavioral constraints an agent cannot infer from structured fields.

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 and trigger, then a scannable bullet list, then post-call guidance. Slightly long, with the currency/network mapping partially duplicated in the schema descriptions, but no sentence is wasted.

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 destructive payment tool with no output schema, the description covers the trigger, prerequisites (user approval), settlement behavior, the polling loop with get_payment_status and terminal statuses, and a deployment-specific caveat. An agent has everything needed to invoke and follow up correctly.

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%, but the description still adds value by mapping each parameter back to the x402 paymentRequirements fields and clarifying the currency semantics (USD→USDC, EUR→EURC on Base) and the network constraint. The 'base'/'base-sepolia' mapping is useful context beyond the enum-less 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 ('Pay for a resource using the x402 protocol') and grounds it in the concrete triggering condition (HTTP 402 with x402 paymentRequirements). This clearly separates it from generic payment siblings like initiate_payment and agent_execute_payment.

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?

Gives an explicit trigger ('When an API returns HTTP 402 with x402 paymentRequirements') and a follow-up protocol naming the sibling get_payment_status with a 10-15s polling cadence. It stops short of saying when NOT to use it versus initiate_payment/agent_execute_payment for non-x402 payments, which is the only gap.

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