Skip to main content
Glama

Market Intelligence API (core)

token.swap_quote

Read-onlyIdempotent

Right before an on-chain swap ($0.002): how much you get now on the best route (Uniswap v2/v3/v4, Aerodrome, direct or through WETH) on Base, Ethereum, Arbitrum, Optimism or Polygon, with price impact, minimum received at your slippage and alternatives. Simulated, nothing executed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyYesETH, WETH, USDC or a 0x token address
sellYesETH, WETH, USDC or a 0x token address
chainNoChain of the token or pool: base (default), ethereum, arbitrum, optimism or polygon (solana where listed)base
amountYesSell amount in whole units, e.g. 1000
slippageBpsNoSlippage tolerance for the minimum received, in basis points

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint. Beyond those, the description adds genuinely new behavioral context: a fixed cost ($0.002) and explicit simulation semantics ("Simulated, nothing executed"). It stops short of disclosing quote validity/expiry or rate limits.

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 dense, front-loaded sentence that leads with the trigger ("Right before an on-chain swap") then the deliverables. Slightly packed, with the cost parenthetical interrupting the main clause, but every element carries information and there is no filler.

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 takes on the burden of describing returns — and does: price impact, minimum received at your slippage, and alternatives — plus the supported chains and best-route behavior. An agent has everything it needs to call this quote tool 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?

Schema description coverage is 100%, so the baseline is 3. The description goes slightly beyond the schema by tying slippage to a concrete outcome ("minimum received at your slippage") and spelling out the routing/chain context that frames sell/buy/chain, adding cross-parameter meaning.

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+resource (get a swap quote for a token) and sharpens it with the scope: routes (Uniswap v2/v3/v4, Aerodrome, direct or via WETH), chains (Base, Ethereum, Arbitrum, Optimism, Polygon), and outputs (price impact, minimum received, alternatives). An agent can distinguish it from token.risk or market.snapshot without opening the schema.

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?

"Right before an on-chain swap" gives a clear, specific usage trigger — the pre-trade check step. It does not, however, name when *not* to use it or point at sibling tools (e.g. token.risk for safety checks, decision.pre_trade for the trade decision), so routing against alternatives is left to inference.

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