Skip to main content
Glama

Cross-chain x402 pay

x402_cross_chain_pay
Read-only

The executable package for paying any x402 endpoint from the other chain: the dry-run plan, the unsigned Relay bridge transactions (approve + deposit, shortfall only), and the EIP-3009 typed data to sign for the settlement. Returns unsigned transactions only — the agent signs the bridge steps on the origin chain, waits for the bridge to land, signs the typed data, and POSTs it to the product URL as an X-PAYMENT header. Never signs, never takes a private key.

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>",
      "from": "<from>"
    },
    "name": "x402_cross_chain_pay"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoAttribution tag for traffic measurement. Default "grok".
urlYesThe x402 URL to pay — it must return a 402 payment challenge.
fromYesThe wallet address that will sign (0x...). Never a private key. Omit it when a walletToken is passed — the wallet is resolved from the token instead.
returnUrlNoOptional https:// link back to your agent flow. The signing page shows it as a button after the transaction confirms, with ?tx=<hash>&status=confirmed added. Anything that is not an https:// URL is ignored.
walletTokenNoA wallet token from /sign?connect=1: connect once, store the token, and pass it instead of from on every prepare call. The wallet is resolved from the token (signature-checked, 90-day expiry). When both are passed they must name the same wallet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

The annotations declare readOnlyHint=true on a tool whose name says 'pay', which would otherwise be confusing; the description resolves that by stating 'Returns unsigned transactions only — never signs, never takes a private key.' It also discloses the 'shortfall only' deposit behavior and that the agent, not the tool, performs the signing and submission. It does not cover whether the plan or unsigned transactions expire, which is the main remaining behavioral gap.

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 definition is a single dense paragraph that front-loads what the tool returns before describing the agent's follow-up workflow, with no filler sentences. It is slightly long and reads as one run-on block rather than separated output/next-steps sections, which is the only reason it is not a 5.

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?

There is no output schema, and the description fully compensates by enumerating the three returned artifacts and the shortfall-only deposit rule. Combined with the 100%-documented input schema and the safety annotations, an agent has everything needed to call this tool and act on its response.

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 every parameter (ref, url, from, returnUrl, walletToken) is already documented in the schema itself. The description adds only indirect context, tying the output to 'the product URL' and the X-PAYMENT header, without clarifying parameter behavior beyond what the schema states. Baseline 3 is appropriate here.

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 ('paying any x402 endpoint from the other chain') and enumerates exactly what the call produces: the dry-run plan, unsigned Relay bridge transactions, and the EIP-3009 typed data. Framing it as 'the executable package' implicitly separates it from the quote-only sibling x402_cross_chain_quote, so an agent can pick it 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 Guidelines4/5

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

It lays out the full invocation sequence — sign bridge steps on the origin chain, wait for the bridge to land, sign the typed data, POST it to the product URL as an X-PAYMENT header — which is exactly the context an agent needs to use the result correctly. It stops short of explicit when-not-to-use guidance or naming the quote tool as a prerequisite step, which keeps it out of 5 territory.

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.