Skip to main content
Glama

DEX swap quote

swap_quote

Indicative UniswapV2 swap quote from live on-chain reserves: amount out, execution price, and price impact — what the trade will actually cost before you sign it. Paid: call without x_payment to receive this call's exact terms (amount, asset, network), sign them, then call again with x_payment. The free pricing tool lists every price at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoWhich chain to quote on.base
amountNoAmount of token_in to sell.
token_inYesAddress of the token being sold.
token_outYesAddress of the token being bought.
x_paymentNoOptional signed x402 payment payload (base64, what the X-PAYMENT header carries). Omit to receive the exact payment terms; sign them (e.g. @x402/fetch) and call again with this argument to settle and get the data.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries full weight. It discloses the paid nature, indicative/live-reserve sourcing, the x402/x_payment authentication flow, and that the quote reflects actual pre-sign cost. These behavioral traits go well beyond the structured schema.

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?

The description is two sentences, front-loaded with the tool's purpose and outputs, and efficiently weaves in the payment flow and alternative tool without redundancy. Every sentence earns its place.

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?

Even without an output schema, the description lists expected return values and explains both the free and paid invocation paths. Given the tool's complexity (5 params, multi-step payment), this is complete enough for an agent to select and invoke correctly.

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% with each parameter described, so the baseline is 3. The description adds value by explaining the x_payment lifecycle (omit for terms, include to settle) and the meaning of the quote outputs, which enhances understanding beyond field names.

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?

The description clearly specifies the tool as an indicative UniswapV2 swap quote from live on-chain reserves, listing concrete outputs (amount out, execution price, price impact). It distinguishes itself from the sibling 'pricing' tool by being paid and providing exact per-trade terms rather than a list of all prices.

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?

Explicit when-to-use guidance is provided: 'call without x_payment to receive this call's exact terms, sign them, then call again with x_payment' and 'The free `pricing` tool lists every price at once.' This clearly differentiates from the free alternative and explains the two-step paid flow.

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