Skip to main content
Glama

Pay an exact amount with any token

pay_exact

Make sure a recipient gets EXACTLY a set amount (e.g. 10 USDC on Base), paid with whatever token and chain you hold (e.g. SOL on Solana). Ideal for paying invoices, topping up an x402/agent wallet, or funding gas on another chain. Returns the exact amount to send and a deposit address.

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": {
      "token": "<token>",
      "amount_out": "<amount_out>",
      "pay_with_token": "<pay_with_token>",
      "recipient": "<recipient>",
      "refund_address": "<refund_address>"
    },
    "name": "pay_exact"
  }
}

Input Schema

NameRequiredDescriptionDefault
testNoTest mode: true = no real money. You get a fake deposit address that completes by itself in ~15s, so you can test status, invoices, receipts and webhooks for free.
chainNoChain the recipient receives on, e.g. 'base'.
speedNoOptional. Default 'best_price': Swap Ripper quotes two networks at once and uses whichever is cheaper for you (and the other if one fails); the reply's route_choice shows both. 'fast' forces the ~seconds Relay route.
tokenYesToken the recipient must receive, e.g. 'USDC'.
referrerNoOptional: your NEAR account (e.g. 'myagent.near'). You earn 1/3 of the service fee on every swap routed with it. The user pays the same.
recipientYesAddress that receives the output, ON THE DESTINATION CHAIN.
amount_outYesExact amount the recipient must receive, e.g. '10'.
request_idNoRecommended: your own unique ID for this payment (e.g. a UUID). Retrying with the same request_id returns the SAME payment instructions, so you never pay twice.
slippage_bpsNoMax slippage in basis points (default 100 = 1%, range 10-500).
pay_with_chainNoChain you pay from, e.g. 'solana'.
pay_with_tokenYesToken you will pay with, e.g. 'SOL'.
refund_addressYesAddress for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / request_id
      Added value: +{
      +  "description": "Recommended: your own unique ID for this payment (e.g. a UUID). Retrying with the same request_id returns the SAME payment instructions, so you never pay twice.",
      +  "type": "string"
      +}
    • addedInput schema / properties / speed
      Added value: +{
      +  "description": "Optional. Default 'best_price': Swap Ripper quotes two networks at once and uses whichever is cheaper for you (and the other if one fails); the reply's route_choice shows both. 'fast' forces the ~seconds Relay route.",
      +  "enum": [
      +    "best_price",
      +    "fast"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / test
      Added value: +{
      +  "description": "Test mode: true = no real money. You get a fake deposit address that completes by itself in ~15s, so you can test status, invoices, receipts and webhooks for free.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true), the description usefully discloses that the call returns instructions rather than moving funds — 'the exact amount to send and a deposit address'. It still says nothing about fee structure, quote/deposit-address expiry, or minimum amounts, which matter for a cross-chain payment flow. The routing/slippage behavior is only explained in the schema, not the description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the core guarantee (exact amount out), followed by use cases and the return value. No repetition of schema content and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, five-required cross-chain payment tool with no output schema, the description covers intent, use cases, and what comes back, which compensates for the missing output schema. It falls short on operational specifics an agent would want — fee handling, how long the deposit address stays valid, and what happens if the sent amount differs.

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 including test mode, speed, slippage, and referrer is already documented in the schema. The description only reinforces the destination-chain vs. source-chain distinction implied by 'token and chain you hold'. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource with precise scope: deliver an EXACT output amount regardless of the token/chain the payer holds, with a concrete example (10 USDC on Base, paid with SOL on Solana). That 'exact output' framing implicitly distinguishes it from swap/pay-style siblings, but it never names an alternative tool, so sibling differentiation is left to inference.

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 gives concrete when-to-use contexts: paying invoices, topping up an x402/agent wallet, funding gas on another chain. What's missing is the negative case — when to prefer a plain swap or the generic pay tool instead of an exact-output payment.

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.