Skip to main content
Glama

quote_swap

Read-only

Quote an exact-in swap. side=buy spends USDC for the coin, side=sell spends the coin for USDC. Amounts are human units (USDC for buys, coins for sells). USDC-paired coins are quoted on their v4 pool; v3 coins (paired with a registry-approved token, gold first) through both hops of their route (USDC to the pair, the pair to the coin). Quotes are at the rate of the moment, net of the coin's fees, anti-snipe and large-trade fees included. Pass your referrer address: 5% of the swap fee accrues to it on-chain. Use the SAME referrer here and in prepare_swap; nothing binds them for you.

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": {
      "coin": "<coin>",
      "side": "<side>",
      "amount": "<amount>"
    },
    "name": "quote_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesThe ubi.fun coin's contract address (0x...)
sideYesbuy spends USDC for the coin; sell spends the coin for USDC
amountYesThe exact input in human units: USDC for a buy, coins for a sell (for example "25" or "1000.5")
referrerNoAddress that gets 5% of the swap fee on-chain; pass the same one to prepare_swap

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / amount / description
      Added value: +"The exact input in human units: USDC for a buy, coins for a sell (for example \"25\" or \"1000.5\")"
    • addedInput schema / properties / coin / description
      Added value: +"The ubi.fun coin's contract address (0x...)"
    • addedInput schema / properties / referrer / description
      Added value: +"Address that gets 5% of the swap fee on-chain; pass the same one to prepare_swap"
    • addedInput schema / properties / side / description
      Added value: +"buy spends USDC for the coin; sell spends the coin for USDC"
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint/openWorldHint, but the description adds real behavior: quotes are point-in-time ('rate of the moment'), net of coin fees including anti-snipe and large-trade fees, and routed differently for v4-paired vs v3-paired coins. It stops short of saying the quote is non-binding or that liquidity/route failures are possible.

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?

Front-loaded with the core purpose and the side semantics, and every sentence carries information. The v3/v4 routing sentence is dense and the pool-routing detail is more than most callers need to invoke the tool, but nothing is filler.

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

Completeness3/5

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

Parameters and annotations are fully covered, but there is no output schema and the description never says what a quote returns (output amount, fee breakdown, price impact, route). For a read-only quote tool, the return shape is the main thing an agent still cannot infer.

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 coverage is 100% so the baseline is 3, but the description adds meaning beyond the schema for referrer: 5% of the swap fee accrues on-chain, and nothing binds it to prepare_swap, so the caller must pass the same address in both calls. That coordination consequence is not captured in the field description.

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 ('Quote an exact-in swap') and immediately disambiguates the enum by explaining buy spends USDC and sell spends the coin. It also names prepare_swap, making the quote-vs-prepare split legible without opening any schema.

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

Usage Guidelines3/5

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

Implies usage as the pre-trade preview through 'Use the SAME referrer here and in prepare_swap', but never states explicitly 'call this before prepare_swap' or when not to use it (e.g., for balances, use get_swap_tokens). The ordering guidance is inferable rather than stated.

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