Skip to main content
Glama

usdc_buy

Destructive

Buy tokens with USDC on supported chains, with automatic USDC bridging and gas top-up when funds are short. Follow pending request IDs to track trades.

Instructions

Buy a token paying with USDC. Automatic funding is on by default: GDEX bridges USDC and tops up gas from the user's other chains when this chain is short, capped by the signed maxSourceSpendRaw. A pending result returns a requestId: follow it with usdc_wait_for_trade.

Input Schema

NameRequiredDescriptionDefault
apiKeyNoGDEX API key for AES encryption
chainIdYesChain ID: 1, 10, 56, 146, 8453, 42161 or 622112261 (Solana). No USDC on Robinhood 4663 or Fraxtal 252
accountRefNoConnected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat
autoBridgeNoAutomatic funding (default true, as on gdex.pro): bridge USDC and top up native gas from the user's other chains, within maxSourceSpendRaw
tokenAddressYesToken to buy
usdcAmountRawYesUSDC to spend (6 decimals; 18 on BSC), raw integer units
walletAddressNoControl wallet address
minTokenOutRawYesMinimum token out (from usdc_get_trade_quote minus slippage), raw integer units
maxSourceSpendRawNoSigned cap on total source spend for auto-funding (default ceil(amount x 1.2)), raw integer units
sessionPrivateKeyNoSession private key from sign-in

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.12.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, and the description adds genuinely new behavior: default cross-chain bridging/top-up from the user's other chains, a spend cap via maxSourceSpendRaw, and the pending/requestId asynchronous outcome. It does not say what gets destroyed or what the success (non-pending) response contains, which for a destructive swap tool is the remaining gap.

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 short sentences with zero filler: action first, then the default funding behavior and its cap, then the pending-result follow-up. Each sentence carries distinct information an agent needs.

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 10-parameter destructive tool with no output schema, the description covers the two things an agent could not learn elsewhere: cross-chain funding side effects and the pending/requestId flow. It leaves the immediate-success return shape unstated, but the async path — the one that requires agent action — is covered.

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 the schema already documents all 10 parameters including decimals, defaults, and the minTokenOutRaw derivation. The description only re-emphasizes autoBridge's default and the maxSourceSpendRaw cap, adding little beyond what the schema states; baseline 3 applies.

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?

States a concrete verb+resource ("Buy a token") plus the payment asset (USDC), which implicitly separates it from usdc_buy_with_native and generic buy_token. It never names a sibling explicitly, so an agent must infer the distinction from the payment-currency phrasing.

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?

Gives clear operational context: automatic funding is on by default, and a pending result must be followed with usdc_wait_for_trade — an explicit next-step routing to a sibling. It lacks any 'when not to use this' guidance (e.g. versus usdc_buy_with_native or gdex_execute_trade) and states no prerequisite such as obtaining a quote first.

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

Deploy Server

Other Tools