Skip to main content
Glama

Buy ETH for gas with 0.50 USDC

buy_gas
Destructive

Buys ETH for Base gas by selling exactly 0.50 USDC from the kit’s own balance, enabling swaps or withdrawals when the kit holds only USDC. Requires user approval because it spends their funds.

Instructions

Buy a little ETH for Base gas with exactly 0.50 USDC from this kit's own balance, so a kit funded with USDC alone can swap and withdraw. This moves the user's funds: call it only after the user says yes, and tell them the 0.50 USDC comes out of their balance. Each yes covers one purchase. It signs one CoW Protocol order that sells 0.50 USDC for ETH paid to this kit's own Base address; a CoW Protocol solver settles it and pays the network fee, so it works with no ETH in the kit. Refused when the kit already has gas (0.00002 ETH or more), holds less than 0.50 USDC, or spending is stopped. While a Base withdrawal or swap lock is still being confirmed, it is refused for 30 s; call it again then. Each call returns within about a minute; while state is 'pending', call it again after call_again_after_seconds, and call again whenever a result asks you to. Once state is 'filled' or 'expired', or 'rejected' with sold 'nothing', that purchase is over: report it, and ask the user again before another. Calling again never places a new order while an earlier one could still fill. Returns state ('pending', 'filled', 'expired', 'rejected' or 'refused'), with uid, order_url, sold, min_eth and, once filled, eth_received when it is known; or reason.

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": "buy_gas"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.23

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, it discloses that the tool moves user funds, requires explicit consent, signs one CoW Protocol order, relies on a solver to pay the network fee, and therefore works with no ETH in the kit. It also explains refusal conditions, the 30-second lock retry, expected call duration, pending-state polling, deduplication of orders, and terminal states.

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?

The description is front-loaded with the action, amount, funding source, and consent requirement, then proceeds through mechanics, refusals, polling, and return values. Despite its length, the detail is operational and earns its place for a destructive, non-idempotent purchase flow.

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?

Given the absence of an output schema, the description fully documents the return shape: state values, uid, order_url, sold, min_eth, eth_received, and reason. It also covers consent, refusal behavior, lock timing, polling, and terminal-state handling, so an agent has enough context to invoke and interpret it 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?

The tool has zero parameters, so there is no parameter semantics gap to compensate for; the baseline for a parameterless tool is 4. The description appropriately emphasizes the fixed 0.50 USDC amount rather than undocumented inputs.

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 states a specific verb and resource ('Buy a little ETH for Base gas') with an exact fixed amount ('exactly 0.50 USDC') and the source of funds ('this kit's own balance'). It also distinguishes the purpose from broader swap/withdraw actions by explaining that it enables a USDC-only kit to swap and withdraw.

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 gives explicit when-to-use context (a kit funded with USDC alone needs Base gas), a consent gate ('call it only after the user says yes'), and clear when-not conditions: already has gas, insufficient USDC, spending stopped, or an active withdrawal/swap lock. It also specifies re-call behavior for pending results and that each user yes covers only one purchase.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.