Skip to main content
Glama

nn_quote

Read-only

N:N — quotes a basket where N input tokens fund M output tokens in ONE atomic on-chain transaction. The backend runs a waterfall allocation deciding which input finances which output, then quotes the real tokenIn->tokenOut route for each resulting slice through the same provider fan-out swap_quote uses. NOT decomposable into independent swap_quote/double_quote calls — the allocation itself is the thing being computed, not just N+M separate prices for legs you already know. inputLegs[]: what you sell (tokenIn + amount or amountRaw, each). outputLegs[]: what you want back, as outputPercent — an integer percent of the TOTAL basket value, not a fixed amount, because the actual split depends on the allocation; every outputLegs[].outputPercent in the request must sum to exactly 100. Up to 10 combined input+output legs; the waterfall never produces more than inputLegs.length + outputLegs.length - 1 real on-chain legs. Returns { legs[], failures[] }. Each entry in legs[] is a real quoted tokenIn->tokenOut leg (a NormalizedQuote under .quote, plus amountIn/tokenIn/tokenOut/receiver for that slice) — this is what nn_build will execute, not a rough preview. failures[] lists any slice that found no route; a partial basket is possible and reported, never silently dropped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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"). On EVM the multi-swap router must be deployed on the chain or the quote fails with multi_swap_not_supported_on_chain; on Solana there is no router contract, several top-level instructions in one transaction are already all-or-nothing by runtime rule.
inputLegsYes
outputLegsYes
slippageBpsNoOptional, 5-500, applied to every leg. Default 50.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: the waterfall allocation, the atomicity, the fact that failures[] can result in a partial basket that is 'never silently dropped,' and the relationship to nn_build (legs are what will be executed). It also discloses chain-specific failure modes (multi_swap_not_supported_on_chain) and Solana's runtime all-or-nothing rule. This goes well beyond the 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 dense but every sentence earns its place: it defines the tool, explains the allocation, gives the outputPercent constraint, states limits, and describes the return shape. It is longer than average, but the complexity of the tool justifies the length. The most critical differentiator (NOT decomposable) is front-loaded early. Slight redundancy exists between the schema's outputPercent description and the tool description, but that is minor.

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?

For a complex N:N quoting tool with no output schema, the description does a strong job: it explains the return shape (legs[] with NormalizedQuote, failures[]), the partial-basket behavior, the leg count bound, and the chain-specific constraints. It does not detail pagination or exact failure error formats, but those are less critical for a quote tool. The annotations cover safety, and the schema covers parameters. The description is complete enough for an agent to select and invoke the tool 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 60%, so the description carries some burden. It adds meaning to inputLegs[] and outputLegs[] by explaining the allocation semantics: outputPercent is 'an integer percent of the TOTAL basket value, not a fixed amount, because the actual split depends on the allocation.' It also clarifies the leg count limit and the resulting on-chain leg count formula. The wallet parameter is not discussed in the description, but the schema already covers it well. The description compensates for the schema's gaps on the core basket semantics.

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 opens with a precise definition: 'N:N — quotes a basket where N input tokens fund M output tokens in ONE atomic on-chain transaction.' It names the specific verb (quotes), the resource (a basket), and the key differentiator (atomic, waterfall allocation). It also explicitly contrasts with swap_quote/double_quote, making sibling differentiation clear.

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?

The description explicitly states when NOT to use this tool: 'NOT decomposable into independent swap_quote/double_quote calls — the allocation itself is the thing being computed.' It also explains the outputPercent constraint and the partial-basket behavior, giving an agent clear conditions for invocation. The sibling list includes swap_quote and double_quote, and the description directly addresses why those alternatives are not equivalent.

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