Skip to main content
Glama

DeFi Route Decision

defi_route_decision
Read-only

Compare live read-only Base swap quotes from 1inch and KyberSwap using output, fees/gas, price impact, consensus/divergence to return EXECUTE_BEST, WAIT or INSUFFICIENT_DATA. Provider failures: PARTIAL or UPSTREAM_UNAVAILABLE; quotes vary with market state. slippage_bps (basis points) sets local minimum_output; provider minOutAmount takes precedence. USE WHEN: choosing a quoted route or deciding to wait. DO NOT USE WHEN: executing, signing, submitting or authorizing swaps.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "base",
      "token_in": "WETH",
      "amount_in": "0.1",
      "token_out": "USDC",
      "slippage_bps": 50
    },
    "name": "defi_route_decision"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesBase Mainnet only in this quote-only MVP.
token_inYesInput Base asset symbol; must differ from token_out.
amount_inYesPositive decimal input amount as string (not float), converted exactly to raw token units per token_in decimals.
token_outYesOutput Base asset symbol; must differ from token_in.
slippage_bpsYesSlippage tolerance in basis points; sets local minimum_output when provider omits minOutAmount; provider's minOutAmount takes precedence if present; not a cost.
baseline_providerNoOptional comparison reference provider; sets economic advantage baseline, does not change best provider selection.

Output Schema

NameRequiredDescriptionDefault
usageYesPer-provider call success, latency, and configured cost-estimate availability.
quotesYesNormalized provider quote evidence in raw token units.
statusYesQuote comparison outcome: COMPARISON_AVAILABLE (≥2 valid quotes), PARTIAL (≥1 valid + ≥1 failed), UPSTREAM_UNAVAILABLE (0 valid quotes).
partialYesTrue when status is PARTIAL or UPSTREAM_UNAVAILABLE (i.e., any provider failed); false only when status=COMPARISON_AVAILABLE.
decisionYesDeterministic economic decision (EXECUTE_BEST/WAIT/INSUFFICIENT_DATA); not a safety authorization, does not execute swaps.
consensusYesComparable-output median and comparison basis when two provider quotes are valid.
economicsYesKnown or unknown estimated provider COGS; unknown is never represented as zero.
confidenceYesDeterministic comparison confidence; never HIGH with only 2 providers.
observed_atYesUTC timestamp when the latest provider quote was observed during this request.
best_providerYesBest comparable provider when ≥2 valid quotes exist, else null.
decision_reasonYesHuman-readable deterministic reason for the decision.
decision_signalsYesObjective signals used for the decision.
evidence_qualityYesPer-provider reported, calculated, estimated, or unavailable field quality.
provider_failuresYesProviders that failed to return a valid quote, with provider name and failure category.
economic_advantageYesBest quote versus declared baseline or next available quote; never ROI.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / amount_in / description
      Previous value: -"Positive decimal input amount, converted exactly to raw token units."New value: +"Positive decimal input amount as string (not float), converted exactly to raw token units per token_in decimals."
    • changedInput schema / properties / slippage_bps / description
      Previous value: -"Slippage tolerance in basis points; sets minimum_output when provider omits it; not a cost."New value: +"Slippage tolerance in basis points; sets local minimum_output when provider omits minOutAmount; provider's minOutAmount takes precedence if present; not a cost."
    • changedInput schema / properties / token_in / description
      Previous value: -"Input Base asset symbol."New value: +"Input Base asset symbol; must differ from token_out."
    • changedOutput schema / properties / partial / description
      Previous value: -"True when any provider fails to return a valid quote."New value: +"True when status is PARTIAL or UPSTREAM_UNAVAILABLE (i.e., any provider failed); false only when status=COMPARISON_AVAILABLE."
    • changedOutput schema / properties / status / description
      Previous value: -"Quote comparison outcome: COMPARISON_AVAILABLE (≥2 valid quotes), PARTIAL (some failed), UPSTREAM_UNAVAILABLE (none valid)."New value: +"Quote comparison outcome: COMPARISON_AVAILABLE (≥2 valid quotes), PARTIAL (≥1 valid + ≥1 failed), UPSTREAM_UNAVAILABLE (0 valid quotes)."
  2. Changed7 schema fields changed
    • changedInput schema / properties / baseline_provider / description
      Previous value: -"Optional provider used only for a direct economic comparison."New value: +"Optional comparison reference provider; sets economic advantage baseline, does not change best provider selection."
    • changedInput schema / properties / slippage_bps / description
      Previous value: -"Slippage tolerance in basis points; it is not treated as a cost."New value: +"Slippage tolerance in basis points; sets minimum_output when provider omits it; not a cost."
    • changedOutput schema / properties / best_provider / description
      Previous value: -"Best comparable provider only when at least two valid quotes are available."New value: +"Best comparable provider when ≥2 valid quotes exist, else null."
    • changedOutput schema / properties / confidence / description
      Previous value: -"Deterministic quote-comparison confidence; two providers never produce HIGH in this MVP."New value: +"Deterministic comparison confidence; never HIGH with only 2 providers."
    • changedOutput schema / properties / decision / description
      Previous value: -"Deterministic economic decision: which swap quote the agent should choose right now. Not a safety authorization and does not execute a swap."New value: +"Deterministic economic decision (EXECUTE_BEST/WAIT/INSUFFICIENT_DATA); not a safety authorization, does not execute swaps."
    • changedOutput schema / properties / partial / description
      Previous value: -"True when one or more providers did not yield a valid quote."New value: +"True when any provider fails to return a valid quote."
    • changedOutput schema / properties / status / description
      Previous value: -"Outcome of the quote comparison: COMPARISON_AVAILABLE when at least two valid quotes exist, PARTIAL when some but not all providers succeeded, UPSTREAM_UNAVAILABLE when no provider returned a valid quote."New value: +"Quote comparison outcome: COMPARISON_AVAILABLE (≥2 valid quotes), PARTIAL (some failed), UPSTREAM_UNAVAILABLE (none valid)."
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "amount_in": "0.1",
      +    "chain": "base",
      +    "slippage_bps": 50,
      +    "token_in": "WETH",
      +    "token_out": "USDC"
      +  }
      +]
  4. Changed2 schema fields changed
    • addedOutput schema / properties / provider_failures / items / properties / category / description
      Added value: +"Failure category for the provider quote failure."
    • addedOutput schema / properties / provider_failures / items / properties / provider / description
      Added value: +"Name of the quote provider that failed."
  5. Changed3 schema fields changed
    • addedOutput schema / properties / observed_at / description
      Added value: +"UTC timestamp when the latest provider quote was observed during this request."
    • addedOutput schema / properties / provider_failures / description
      Added value: +"Providers that failed to return a valid quote, with provider name and failure category."
    • addedOutput schema / properties / status / description
      Added value: +"Outcome of the quote comparison: COMPARISON_AVAILABLE when at least two valid quotes exist, PARTIAL when some but not all providers succeeded, UPSTREAM_UNAVAILABLE when no provider returned a valid quote."
  6. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/destructive annotations, the description discloses degraded outcomes (PARTIAL, UPSTREAM_UNAVAILABLE) when providers fail and warns that quotes vary with market state, which explains why idempotentHint=false matters. It also documents the slippage/minOutAmount precedence rule that affects computed output.

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-loaded with the verb+resource, then failure modes, then the USE/DO NOT USE block, with no filler. The condensed semicolon fragments ('Provider failures: PARTIAL or UPSTREAM_UNAVAILABLE; quotes vary with market state') are efficient but slightly telegraphic.

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 six-parameter decision tool with an output schema, the definition covers inputs of concern, failure/degradation behavior, and the boundary against execution tools. Return-value enumeration is briefly named and need not be expanded because an output schema exists.

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 description coverage is 100%, so all six parameters are already documented, setting the baseline at 3. The description reinforces slippage_bps semantics (basis points, sets local minimum_output, provider minOutAmount wins), but that largely restates the schema and says nothing about baseline_provider, leaving the added meaning thin.

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 and resource: compare live read-only Base swap quotes from 1inch and KyberSwap, and return one of three named decision outcomes. Scope (Base-only, quote-only) and the decision product are both explicit, which distinguishes it from the sibling lookup/execution tools without needing their schemas.

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?

Provides an explicit USE WHEN ('choosing a quoted route or deciding to wait') and an explicit DO NOT USE WHEN ('executing, signing, submitting or authorizing swaps'), which is exactly the exclusion an agent needs to avoid routing a decision tool in place of an execution tool.

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