Skip to main content
Glama

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

Get native gas with USDC

cleave_get_gas
Idempotent

Gets 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 and a USDC amount, it returns an offer: the fee, the minimum native amount, the deadline, the order and one USDC authorization for the wallet to sign; signing costs no gas. Called again with the offer and the signature, it passes the signed order to Cleave's relayer, which executes it through a contract made for that one order, and returns a requestId for cleave_track_swap. On one chain the recipient gets at least the minimum or nothing moves; from another chain it gets the native coin at the minimum, else USDC on arrival if the arrival swap fails. An order not executed by its deadline is refunded to the refund address, or, if paid from another chain and not filled, refunded hours later. When the wallet already holds some gas, cleave_plan_swap plans a swap to the native coin.

Input Schema

NameRequiredDescriptionDefault
offerNo
amountNoA decimal amount in token units
walletNo
chainIdNo
refundToNo
recipientNo
signatureNo
payChainIdNo

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?

Goes well beyond the annotations: signing costs no gas, execution goes through Cleave's relayer via a per-order contract, refund semantics for expired or unfilled cross-chain orders, and the minimum-amount guarantee with USDC fallback on arrival. This is exactly the context an agent needs for a non-read-only, open-world operation.

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?

Purpose is front-loaded and nearly every clause carries real information, but the long run-on sentences ('On one chain the recipient gets at least the minimum or nothing moves; from another chain...') make the settlement semantics harder to parse than necessary.

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 two-mode, eight-parameter, annotation-light mutation tool with no output schema, the description covers both call shapes, the returned offer fields and requestId, gas/signing costs, and failure/refund paths. Only the exact required-parameter split per mode remains implicit.

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?

With only 13% schema coverage, the description carries most of the burden; it valuably disambiguates payChainId (paying chain) from chainId (receiving chain) and sketches which arguments belong to the quote call versus the signature call. But it never explains wallet vs recipient vs refundTo distinctly, and with zero required parameters it leaves the per-mode required subset ambiguous.

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: obtaining native gas for a wallet that holds USDC but lacks gas, naming the exact supported chains. It also explicitly contrasts itself with cleave_plan_swap for the case where gas already exists, so an agent can pick it apart from siblings without reading schemas.

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?

Clear context for when to use it (USDC held, no gas) and an explicit alternative routing rule: 'When the wallet already holds some gas, cleave_plan_swap plans a swap to the native coin.' It also names cleave_track_swap as the follow-up. It doesn't address when-not cases such as unsupported chain combinations or no USDC at all.

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