Skip to main content
Glama

double_quote

Read-only

Compares ranked routes for TWO swap legs at once — "Double Out" (one source token split into two destinations) or "Double In" (two source tokens converging on one destination). This exists because building a liquidity pool or matching a target ratio needs both legs priced against the market at the same instant, not one after another with the price moving in between. Each leg is independently quoted (two ordinary swap_quote calls under the hood) — this tool is a convenience that keeps them together, not a combined/atomic route. For mode "out": legA.tokenIn must equal legB.tokenIn (the shared source); tokenOut differs. For mode "in": legA.tokenOut must equal legB.tokenOut (the shared destination); tokenIn differs. Pass the exact amount each leg should trade — this tool does not compute percentages or splits for you. If the shared token is the chain's native asset, remember gas is paid twice (once per leg's eventual transaction) — do not quote/build a total that leaves nothing for the second leg's gas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
legAYes
legBYes
modeYes"out": one source, two destinations. "in": two sources, one destination.
walletNoWallet that will sign. Required for builds and EVM execution/history calls. On an anonymous EVM quote, pass it to make the returned quoteId executable; without it the quote is indicative.
chainIdYesEVM: integer from GET /v1/chains (1, 10, 56, 100, 137, 8453, 42161, 43114, 130). Solana: string from GET /v1/svm/chains ("solana-mainnet").

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds substantial behavioral context: it is two independent quotes, not an atomic route; it does not compute splits/percentages; and it warns about double gas for native assets. These go beyond the structured annotations and meaningfully shape how an agent should invoke and interpret the tool.

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 thorough but every sentence earns its place: it covers purpose, rationale, non-atomicity, mode-specific constraints, amount responsibility, and a gas caveat. It is front-loaded with the core functionality before diving into constraints. It could be slightly tightened, but the length is justified by the tool's complexity.

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

Completeness4/5

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

Given the tool's complexity (two nested leg objects, multiple modes) and the absence of an output schema, the description covers the essential invocation logic and key caveats. It does not describe the exact output shape, but it states each leg is independently quoted, giving a reasonable expectation. The description is sufficiently complete for correct invocation, with minor room for output-format details.

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 60%, so the schema already documents many parameters. The description adds critical relational semantics not in the schema: for mode 'out' legA.tokenIn must equal legB.tokenIn, and for mode 'in' legA.tokenOut must equal legB.tokenOut. It also clarifies that amounts are exact and not split, which directly affects parameter usage. This goes beyond the schema's per-field descriptions.

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 states a specific verb ('compares ranked routes') and a distinct resource (two swap legs at once), and explicitly names the two modes (Double Out / Double In). It distinguishes itself from a single swap_quote by stating it is 'two ordinary swap_quote calls under the hood,' so an agent can tell it apart from siblings like swap_quote and double_build.

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 gives clear when-to-use context: it exists for 'building a liquidity pool or matching a target ratio' where both legs must be priced simultaneously. It also clarifies it is not a combined/atomic route, which implicitly warns against expecting atomicity. However, it does not explicitly name alternatives or exclusions (e.g., 'use double_build for the actual build'), so it falls just short of a 5.

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