Skip to main content
Glama

swap_route

Read-onlyIdempotent

Where to trade it, the impact, and whether it's safe to receive — Give a token and a trade size in USD → the deepest Base pool to route through, estimated price impact, a suggested slippage tolerance + minimum-out, all gated on a honeypot/sell-tax check of the token you'd receive (no point routing into something you can't sell). Moves an agent from analysis to action in one call. Required input: tokenOut. Priced $0.03 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No wallet or API key required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenOutYesToken to receive
amountUsdNoTrade size in USD

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoThe result payload. Shape is service-specific; every field is documented in the tool description.
serviceNoThe service id that answered.
checkedAtNoISO-8601 timestamp of when the underlying reads were taken.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / data / description
      Previous value: -"The result payload. Shape is service-specific; every field is documented in the service description above."New value: +"The result payload. Shape is service-specific; every field is documented in the tool description."
  2. Changed1 schema field changed
    • removedOutput schema / required
      Removed value: -[
      -  "data"
      -]
  3. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive. The description adds genuinely new behavioral context: results are gated on a honeypot/sell-tax check of the received token, it runs over Base using the deepest pool, and returns a minimum-out plus slippage suggestion. It also discloses pricing and free-tier terms, with no contradiction of annotations.

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?

The description is slightly longer than necessary — 'Moves an agent from analysis to action in one call' is promotional — but it is front-loaded with the core output and every sentence provides some useful information such as pricing, no-api-key requirement, and the safety gate. No schema fields are repeated.

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 an output schema present and full parameter coverage, the description covers the remaining essential context: network (Base), pricing/credits, required input, the safety gate, and what the call returns. An agent can decide whether this is the right tool and how to invoke it without opening other definitions.

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 already covers both parameters with 100% coverage. The description adds minimal meaning by mapping 'a token' and 'trade size in USD' to tokenOut and amountUsd, and reaffirms tokenOut is required, but it does not specify format details such as address vs. symbol. Baseline 3 is appropriate.

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 exactly what the tool does: returns the deepest Base pool to route through, estimated price impact, suggested slippage tolerance, minimum-out, and a honeypot/sell-tax check of the receive token. This is a specific verb+resource outcome that distinguishes it from sibling safety-only tools such as pre_trade_gate or sellability.

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 description clearly frames when to use it — give a token and trade size in USD to get routing, impact, slippage, and safety — and notes it requires no wallet/API key. However, it does not name alternatives or exclusion conditions, so guidance on when NOT to use it is absent.

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