Skip to main content
Glama

buy_token

Purchase any supported token on Solana, Sui, Ethereum, Base, Arbitrum, BSC, and more by swapping native funds through a DEX route.

Instructions

Buy a token on any supported chain (Solana, Sui, Ethereum, Base, Arbitrum, BSC, etc.) using the best DEX route.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dexNoPreferred DEX (raydium, orca, uniswap-v3, cetus, odos, etc.)
chainYesChain: 'solana', 'sui', or ChainId number (1=ETH, 8453=Base, 42161=Arbitrum)
amountYesAmount of native token to spend, e.g. '0.1' for 0.1 SOL
apiKeyNoGDEX API key for managed-custody buys (with sessionPrivateKey).
referrerNoReferral address
slippageNoMax slippage tolerance in percent. Default: 1
inputTokenNoOverride input token address (default: native)
priorityFeeNoSolana priority fee in SOL
tokenAddressYesContract address of the token to buy
walletAddressNoWallet address to trade from
sessionPrivateKeyNoManaged-custody session private key (from sign-in). Required for EVM managed swaps — routes through the session-signed purchase_v2 flow.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.11.3

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It implies market execution via a routing engine, but says nothing about on-chain irreversibility, slippage risk, which credentials are needed (apiKey + sessionPrivateKey imply distinct managed-custody flows), or whether it signs and broadcasts a transaction.

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?

One sentence, front-loaded with the verb and resource, with no filler. The chain enumeration is somewhat redundant with the schema's chain description but does signal multi-chain breadth up front.

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

Completeness2/5

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

For an 11-parameter financial mutation tool with no annotations and no output schema, the description omits the essentials: no return-value or transaction-hash expectations, no custody-mode explanation for the apiKey/sessionPrivateKey parameters, and no failure modes. The safety profile an agent needs before executing a real swap is absent.

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 all 11 parameters are already documented in the schema; the baseline is 3. The description adds only the 'best DEX route' framing, which loosely contextualizes the dex parameter but adds no syntax, format, or interaction detail beyond the schema.

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 specific verb and resource ('Buy a token') plus scope ('any supported chain') and mechanism ('best DEX route'), which is enough to distinguish it from read-side siblings. However, it never distinguishes itself from close siblings like limit_buy, execute_spot, or managed_purchase, so an agent still has to guess which buy path applies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use statement, no prerequisites, and no exclusions. Nothing tells the agent when to pick this over limit_buy (limit order), managed_purchase, or execute_spot, nor what conditions (wallet/session state) must hold before calling it.

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