Skip to main content
Glama

get_swap_route

Route a swap intent across ICPSwap: prices the direct pool and every two-hop path through ICP, ckUSDC, ckUSDT, ckBTC, and ckETH live on-chain, chains each leg's quoted output into the next leg's input, and returns the best route leg-by-leg. Read-only — no tokens move. Use this instead of get_swap_quote when a direct pool may be thin or missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feeNoOptional pool fee tier in hundredths of a bps (3000 = 0.3%), applied to every leg. Defaults to trying 3000, then 10000, then 500 per leg.
max_hopsNo1 = direct path only, 2 = also try two-hop routes via intermediate tokens (default 2).
pay_tokenYesToken to sell: symbol or ledger principal.
pay_amountYesAmount to sell, in base units as a decimal string (e.g. "100000000" = 1 ICP).
receive_tokenYesToken to buy: symbol or ledger principal.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it declares read-only ('no tokens move'), states that pricing is live on-chain, and explains the leg-chaining execution model. It stops short of quantifying cost/latency (relevant given the sibling check_cycles) or noting failure behavior when no route exists.

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 followed by the read-only assurance and the sibling-routing rule, all front-loaded. Every clause carries information an agent needs; nothing is restated from the schema or name.

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?

No output schema exists, so the description must characterize the return, and it does: 'returns the best route leg-by-leg' with chained quoted outputs. The intermediate token universe and the read-only guarantee round out what an agent needs 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 the schema already documents fee, max_hops, pay_token, pay_amount, and receive_token in detail. The description adds the intermediate token set (ICP, ckUSDC, ckUSDT, ckBTC, ckETH) but no per-parameter semantics beyond the schema, so the baseline 3 applies.

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 and resource ('route a swap intent across ICPSwap') and immediately scopes it: direct pool plus every two-hop path through named intermediates. It explicitly distinguishes itself from the sibling get_swap_quote, so an agent can separate the two without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit alternative and the condition that selects it: 'Use this instead of get_swap_quote when a direct pool may be thin or missing.' This is a complete routing rule rather than an implied one.

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.