Skip to main content
Glama

Choose a venue for a swap, with the fee disclosed

onchain_agent_route_swap
Read-onlyIdempotent

USE WHEN an agent needs to execute a swap and wants the venue chosen by liveness, verification and price, with the fee disclosed. Asks every aggregator adapter that quotes on the chain, in parallel, and returns the chosen venue's quote and calldata.

RULE ENFORCED: a route is a RECOMMENDATION, not a verdict and not an assurance. chosen_by names every field it was chosen on — liveness, the observed record of Sato Hub's OWN daily checks (never "uptime"), verification state, then quoted price — with the field each was read from and checked_at. Nothing here is called best, safe or guaranteed. A quote is a quote, not a fill.

NON-CUSTODIAL: this tool NEVER signs, holds, moves or broadcasts funds. It returns calldata the caller may sign. The Sato fee (3 bps stable-to-stable, 15 bps on any volatile leg) is a parameter on the aggregator's own quote, taken inside the swap transaction by the router, and is stated in disclosure before anything is signed. A failed, reverted or unsigned trade pays nothing.

Returns (json): { route: { slug, name, listed, sato_url, liveness, observed_success_pct, install_verified }, quote: { venue, amount_in, amount_out, token_in, token_out, chain, calldata, tx, source_url }, sato_fee_bps, sato_fee_recipient, disclosure, chosen_by: [{ signal, value, source_field }], checked_at, alternatives, caveat, preflight, unavailable_venues, rules }. When no adapter answered: { unavailable, tried: [{ venue, reason }], checked_at, caveat }.

Example: { chain: "Solana", token_in: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", token_out: "So11111111111111111111111111111111111111112", amount: "1000000" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYesChain display name as the directory writes it, e.g. 'Base', 'Ethereum', 'Solana'.
takerNoThe address that would sign. Some venues only return calldata when it is given; nothing is ever signed here.
amountYesSell amount in the INPUT token's base units (e.g. 1000000 = 1 USDC at 6 decimals).
token_inYesInput token: a contract address (or Solana mint), or a symbol for the well-known stablecoins.
token_outYesOutput token: a contract address (or Solana mint), or a symbol.
slippage_bpsNoSlippage tolerance in basis points. Passed through to the venue.
response_formatNoOutput format: 'markdown' (default) or 'json'.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses it is non-custodial, never signs/holds/moves/broadcasts funds, returns calldata for the caller to sign, states the fee schedule (3 bps stable-to-stable, 15 bps volatile), where the fee is taken, and that failed/unsigned trades pay nothing. It also frames the output as a recommendation, not an assurance.

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-loads the trigger with a 'USE WHEN' header and organizes the rest under RULE ENFORCED / NON-CUSTODIAL headers, which is good structure. It is on the heavy side, with some redundancy (the 'recommendation, not verdict/assurance' point is restated as 'not best, safe or guaranteed'), so it is not maximally tight.

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?

For a complex routing tool with no output schema, the description fully enumerates the success return shape, the fallback shape when no adapter answers, the chosen_by provenance fields, and an example. An agent has everything needed to call it and interpret both outcomes.

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 worked example adds usable invocation semantics (chain display name, Solana mint as token_in, amount in input-token base units) that the schema alone does not tie together. It stops short of explaining slippage_bps or taker behavior beyond what the schema already says.

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 (routes/chooses a venue) and resource (swap), and names the mechanism: queries every aggregator adapter in parallel and returns the chosen venue's quote and calldata. This is clearly distinguishable from siblings like onchain_agent_route_agent (agent routing) and onchain_agent_compare_listings.

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?

The 'USE WHEN an agent needs to execute a swap and wants the venue chosen by liveness, verification and price' clause gives a concrete trigger condition. However, it never names an alternative tool or states when-not to use it (e.g. when a specific venue must be forced), leaving sibling selection 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.