Skip to main content
Glama

Market Intelligence API (core)

Swap quote

token.swap_quote
Read-onlyIdempotent

Right before an on-chain swap ($0.10): 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sell": "<sell>",
      "buy": "<buy>",
      "amount": "<amount>"
    },
    "name": "token.swap_quote"
  }
}

Input 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). Not the payment networkbase
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. Changed1 schema field changed
    • changedInput schema / properties / chain / description
      Previous value: -"Chain of the token or pool: base (default), ethereum, arbitrum, optimism or polygon (solana where listed)"New value: +"Chain of the token or pool: base (default), ethereum, arbitrum, optimism or polygon (solana where listed). Not the payment network"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, but the description adds information they cannot: the quote is a snapshot ('how much you get now'), it is simulated with nothing executed, and each call costs $0.10. That cost disclosure is the most valuable non-structured fact here. It does not discuss quote expiry or freshness, which would matter for a pre-trade check.

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?

One dense sentence with the timing cue and price front-loaded, followed by the payoff summary. No filler or redundant restatement of the title.

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?

With no output schema, the description usefully previews the return contents (price impact, minimum received at your slippage, alternatives). It omits route split/gas-inclusive amounts and quote validity window, which a pre-trade agent might want, but covers enough to call it correctly.

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 coverage is 100%, so token identifiers, amount units and slippageBps are already documented. The description only restates the chain list and clarifies that slippage drives the 'minimum received' figure, which is marginal added meaning over the schema.

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 action (get a swap quote) with concrete scope: best route across named venues (Uniswap v2/v3/v4, Aerodrome, direct or via WETH) on named chains. It clearly differs from analysis siblings like token.verdict or decision.pre_trade because it returns live amounts, price impact and minimum received.

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 an explicit usage trigger — 'Right before an on-chain swap' — plus the cost ($0.10), which tells the agent this is a final pre-execution check rather than an exploratory call. It does not name an alternative or state when not to use it, so it stops short of full routing guidance.

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