Skip to main content
Glama

Decode a quote result

decode_quote
Read-onlyIdempotent

Decode the eth_call result YOUR node returned for a prepare_quote call: net output after the 0.28% fee, the minimum the Router enforces on-chain, price impact, the Phoenix Check verdict (ok / caution / danger / blocked — fails closed) and, with a recipient, verified unsigned calldata. Pure computation.

Input Schema

NameRequiredDescriptionDefault
resultYesthe 0x hex result of the eth_call on your node
requestYesthe `request` object prepare_quote returned, verbatim

Output Schema

NameRequiredDescriptionDefault
okYesfalse: see code, error
txNo
codeNo
metaNo
modeNo
entryNo
errorNo
exactNo
quoteNo
routeNo
checksNo
minOutNo
chainIdNo
tokenInNo
txErrorNo
amountInNo
approvalNo
deadlineNo
tokenOutNo
amountOutNo
encodedByNo
executeWithNo
unwrapAfterNo
wrapRequiredNo
grossAmountOutNo
protocolVersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "amountIn": {
      +      "type": "string"
      +    },
      +    "amountOut": {
      +      "type": "string"
      +    },
      +    "approval": {
      +      "type": "object"
      +    },
      +    "chainId": {
      +      "type": "integer"
      +    },
      +    "checks": {
      +      "type": "object"
      +    },
      +    "code": {
      +      "type": "string"
      +    },
      +    "deadline": {
      +      "type": "string"
      +    },
      +    "encodedBy": {
      +      "type": "string"
      +    },
      +    "entry": {
      +      "type": "string"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "exact": {
      +      "type": "object"
      +    },
      +    "executeWith": {
      +      "type": "object"
      +    },
      +    "grossAmountOut": {
      +      "type": "string"
      +    },
      +    "meta": {
      +      "type": "object"
      +    },
      +    "minOut": {
      +      "type": "string"
      +    },
      +    "mode": {
      +      "enum": [
      +        "preview",
      +        "exact"
      +      ]
      +    },
      +    "ok": {
      +      "description": "false: see code, error",
      +      "type": "boolean"
      +    },
      +    "protocolVersion": {
      +      "type": "string"
      +    },
      +    "quote": {
      +      "type": "object"
      +    },
      +    "route": {
      +      "type": "object"
      +    },
      +    "tokenIn": {
      +      "type": "string"
      +    },
      +    "tokenOut": {
      +      "type": "string"
      +    },
      +    "tx": {
      +      "type": "object"
      +    },
      +    "txError": {
      +      "type": "object"
      +    },
      +    "unwrapAfter": {
      +      "type": "boolean"
      +    },
      +    "wrapRequired": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  2. Added
  3. Removed
  4. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false; the description corroborates with 'Pure computation' and adds genuinely new behavior: the Phoenix Check verdict is a four-value enum that 'fails closed', and calldata is only verified/unsigned when a recipient is present. That is useful context beyond the annotation set, though it says nothing about failure modes for malformed input.

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?

A single front-loaded sentence that opens with the core action and only then enumerates the returned fields. It is dense and somewhat run-on, but every clause (fee, minimum, price impact, verdict, calldata) carries information an agent would otherwise have to infer.

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?

An output schema exists, so the description need not explain return values, yet it still telegraphs them and, more importantly, pins down the upstream dependency chain (prepare_quote request plus an eth_call result from the caller's own node). Given annotations and full schema coverage, nothing essential is missing, only edge-case guidance for invalid inputs.

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 both parameters (result, request) are already documented in the schema, including that `request` must be the object prepare_quote returned verbatim. The description reinforces the provenance of both inputs but adds no format, encoding, or size detail beyond the schema, so the baseline 3 applies.

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 (decode) and resource (the eth_call result for a prepare_quote call), and enumerates exactly what it produces: net output after fee, Router-enforced minimum, price impact, Phoenix Check verdict, verified calldata. This clearly distinguishes it from get_abi, get_deployments and prepare_quote, which it explicitly references as the upstream step.

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 makes the workflow explicit: it operates on the eth_call result YOUR node returned for a prepare_quote call, so the agent knows it must first have a prepare_quote `request` and a raw node result. It does not state exclusions or what to do instead when those inputs are missing, so it stops 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