Skip to main content
Glama

Cleave for Agents: token swaps, cross-chain swaps and gas top-ups

Order native gas with USDC

cleave_get_gas
Idempotent

Offers orders for native gas (ETH, BNB or POL) on Ethereum, Arbitrum, Base, BNB Chain, Polygon or Optimism for a wallet that holds USDC on Ethereum, Arbitrum, Base, Optimism or Polygon but has no gas to send transactions. Called with the paying chain, the receiving chain, the recipient, a USDC amount and the paying wallet (without it the offer has nothing to sign), it returns an offer: the minimum native amount, the deadline, the order and one USDC authorization for the wallet to sign; signing costs no gas. If your wallet pays for a person, ask them for the recipient; if theirs pays, it can be the recipient. Use your own only for your own gas. An offer needs 0.8 to 50 USDC (at least 5 USDC when Ethereum is the paying or receiving chain; the fee is included in the price), a recipient that accepts the native coin and is not a token contract, and, for a cross-chain order, the paying wallet or a refundTo on the paying chain; otherwise, or while the route is paused, no offer is returned and the answer says why. Called again with the offer, the signature and the same wallet, it passes the signed order to Cleave's relayer, which may submit it to a contract made for that one order, and returns a requestId for cleave_track_swap. An authorization Cleave accepts is set to end before the order deadline. Cleave does not promise to submit it before it expires, and expiry of an unused authorization is not a promise about funds already paid. No outcome or time is guaranteed, and a settled payment is not delivery. On one chain the order is written to swap the USDC toward the native coin for the recipient. From another chain it is written to bridge the USDC and swap on arrival. USDC on arrival is one possible ending if that swap fails, and it may not happen. If a bridge transfer is not filled, the USDC can come back to the order address on the paying chain, which can take hours or longer, or may not come back. Until someone sends it to the refund address, cleave_track_swap can show it as refund_pending. The relayer may not send it. When the wallet already holds some gas, cleave_plan_swap plans a swap to the native coin.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cleave_get_gas"
  }
}

Input Schema

NameRequiredDescriptionDefault
offerNoThe offer value from the answer to a call without offer; when given, the signed order is submitted and only offer, signature and wallet are accepted
amountNoA decimal amount in token units
walletNoThe paying wallet; it does not set the recipient. Required with offer. Without offer, the answer holds an authorization to sign only when it is given, and it is the refund address when refundTo is not given
chainIdNoThe chain the native gas is for; required without offer, not accepted with it
refundToNoThe refund address on the paying chain; a cross-chain order needs refundTo or wallet, and a one-chain order with neither uses recipient; not accepted with offer
recipientNoThe wallet that receives the gas: if your wallet pays for a person, ask them for it; use your own only for your own gas; required without offer, not accepted with it
signatureNoThe wallet's hex signature of the offer's USDC authorization; required with offer, not accepted without it
payChainIdNoThe chain the USDC is paid on; required without offer, not accepted with it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / recipient / description
      Previous value: -"The address that receives the gas; required without offer, not accepted with it"New value: +"The wallet that receives the gas: if your wallet pays for a person, ask them for it; use your own only for your own gas; required without offer, not accepted with it"
    • changedInput schema / properties / wallet / description
      Previous value: -"The paying wallet; required with offer. Without offer, the answer holds an authorization to sign only when it is given, and it is the refund address when refundTo is not given"New value: +"The paying wallet; it does not set the recipient. Required with offer. Without offer, the answer holds an authorization to sign only when it is given, and it is the refund address when refundTo is not given"
  2. Changed1 schema field changed
    • changedInput schema / properties / chainId / description
      Previous value: -"The chain the native gas is delivered on; required without offer, not accepted with it"New value: +"The chain the native gas is for; required without offer, not accepted with it"
  3. Changed7 schema fields changed
    • addedInput schema / properties / chainId / description
      Added value: +"The chain the native gas is delivered on; required without offer, not accepted with it"
    • addedInput schema / properties / offer / description
      Added value: +"The offer value from the answer to a call without offer; when given, the signed order is submitted and only offer, signature and wallet are accepted"
    • addedInput schema / properties / payChainId / description
      Added value: +"The chain the USDC is paid on; required without offer, not accepted with it"
    • addedInput schema / properties / recipient / description
      Added value: +"The address that receives the gas; required without offer, not accepted with it"
    • addedInput schema / properties / refundTo / description
      Added value: +"The refund address on the paying chain; a cross-chain order needs refundTo or wallet, and a one-chain order with neither uses recipient; not accepted with offer"
    • addedInput schema / properties / signature / description
      Added value: +"The wallet's hex signature of the offer's USDC authorization; required with offer, not accepted without it"
    • addedInput schema / properties / wallet / description
      Added value: +"The paying wallet; required with offer. Without offer, the answer holds an authorization to sign only when it is given, and it is the refund address when refundTo is not given"
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag openWorldHint and non-read-only, but the description goes far beyond them: signing costs no gas, the relayer may never submit, no outcome or time is guaranteed, a settled payment is not delivery, authorization expiry isn't a funds promise, and bridged USDC may return only after hours or never, showing as refund_pending. This is unusually candid disclosure of failure modes and irreversibility for a mutation tool.

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

Conciseness3/5

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

Content is front-loaded with the core verb and resource, and nearly every clause carries real information, but it is delivered in long run-on sentences that mix offer-request rules, submission rules, and refund caveats without paragraphs or bullets. The risk and refund material could be trimmed or separated for faster scanning.

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 no output schema, the description still explains what comes back (minimum native amount, deadline, order, USDC authorization, and a requestId for cleave_track_swap on submission). Combined with the amount, recipient, and cross-chain preconditions, nothing essential for calling this 8-parameter tool correctly is missing.

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 description coverage is 100%, so baseline is 3; the description still adds mode semantics the schema only implies — that offer/signature/wallet must be supplied together for submission while chainId/payChainId/recipient/refundTo belong to the offer-request call, and that wallet doubles as refund address when refundTo is absent. It does not fully restate amount bounds per parameter, so it sits just above baseline.

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 concrete resource (native gas offers for ETH/BNB/POL) and an exact mechanism (USDC authorization signed by the paying wallet), and it explicitly distinguishes the two calling modes and the sibling cleave_plan_swap for wallets that already hold gas. An agent can tell this apart from cleave_plan_swap and cleave_track_swap without opening any 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?

It states when to call it (wallet holds USDC but no gas), when not to (wallet already holds gas → cleave_plan_swap), how to pick a recipient for a third party, and the preconditions for getting an offer (amount bounds, 5 USDC minimum when Ethereum is involved, refundTo/wallet for cross-chain). The only weakness is density, but the routing guidance is explicit rather than implied.

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.