Skip to main content
Glama

Crypto & Macro Market Data (Tanod)

pre_trade_check

Read-onlyIdempotent

chainpeek: Check a Uniswap V3 swap at up to five sizes: price impact and candle gap. For one quote use get_swap_quote. Returns results: a Uniswap V3 swap quoted at each of up to five sizes, smallest first: amount out, effective price, price impact against the smallest size, the best fee tier and pool, gas estimate; plus a reference with the latest 5-minute candle close (WETH/USDC, cbBTC/USDC on Base) and its gap to the smallest size's price. A size that cannot be quoted is an error row; none quotable is a 422 or 503 (not charged). Impact is against the smallest size, not the market. Single pool, exact input; not a firm price. Bad input is a 422 (not charged). Typically 1-3 s. Price: USD 0.005. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/uniswap-quote-api.html

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "token_in": "<token_in>",
      "token_out": "<token_out>",
      "sizes": "<sizes>"
    },
    "name": "pre_trade_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesChain to quote on (Uniswap V3): ethereum or base.
sizesYes1 to 5 amounts of token_in as positive decimal strings in token_in units, e.g. ["1", "10", "100"]. Distinct; answered smallest first.
token_inYesToken sold (0x + 40 hex).
fee_tiersNoUniswap V3 fee tiers to consider (100, 500, 3000, 10000). Default: all four.
token_outYesToken bought (0x + 40 hex).

Output Schema

NameRequiredDescriptionDefault
dexNo
noteNo
blockNo
chainNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
resultsNo
token_inNo
referenceNo
token_outNo
disclaimerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • removedInput schema / properties / chain / title
      Removed value: -"Chain"
    • removedInput schema / properties / fee_tiers / default
      Removed value: -null
    • removedInput schema / properties / fee_tiers / title
      Removed value: -"Fee Tiers"
    • removedInput schema / properties / sizes / title
      Removed value: -"Sizes"
    • removedInput schema / properties / token_in / title
      Removed value: -"Token In"
    • removedInput schema / properties / token_out / title
      Removed value: -"Token Out"
    • removedInput schema / title
      Removed value: -"pre_trade_checkArguments"
    • removedOutput schema / properties / reference / properties
      Removed value: -{
      -  "as_of": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "available": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "candle_close": {
      -    "type": [
      -      "number",
      -      "null"
      -    ]
      -  },
      -  "candle_start": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "executable_price": {
      -    "type": [
      -      "number",
      -      "null"
      -    ]
      -  },
      -  "interval": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "last_candle_partial": {
      -    "type": [
      -      "boolean",
      -      "null"
      -    ]
      -  },
      -  "note": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "pair": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "reason": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "reference_gap_pct": {
      -    "type": [
      -      "number",
      -      "null"
      -    ]
      -  },
      -  "source": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / results / items
      Removed value: -{
      -  "properties": {
      -    "amount_in": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "amount_in_raw": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "amount_out": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "amount_out_raw": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "effective_price": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "error": {
      -      "properties": {
      -        "code": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "message": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    },
      -    "fee_tier": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "gas_estimate": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "initialized_ticks_crossed": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "pool": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "price_impact_pct": {
      -      "type": [
      -        "number",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / token_in / properties
      Removed value: -{
      -  "address": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "decimals": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "symbol": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / token_out / properties
      Removed value: -{
      -  "address": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "decimals": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "symbol": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description layers on details they cannot carry: 1-3 s latency, USD 0.005 price, free-tier quota, that failures (422/503) are not charged, and that impact is measured against the smallest size rather than the market and is not a firm price. It also discloses per-size error rows and the all-fail case, which is exactly the behavior an agent needs before calling.

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 purpose and the key disambiguation, then results shape, error semantics, timing and cost. It is dense but slightly repetitive — the '422 (not charged)' idea appears twice and the results enumeration duplicates what the output schema already carries.

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 5-parameter, read-only quoting tool with an existing output schema, the description covers invocation context, result ordering, failure modes, latency, cost and the impact-baseline caveat. Nothing an agent needs to call and interpret it correctly is missing.

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%, so the baseline is 3; the description adds real semantics beyond it by stating sizes are answered smallest first, capped at five, that impact is computed relative to the smallest size, and that a best fee tier/pool is chosen from fee_tiers. It does not add syntax or constraints for token_in/token_out beyond the schema.

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 ('Check a Uniswap V3 swap at up to five sizes') plus the outputs produced (price impact, candle gap), and explicitly contrasts with get_swap_quote for single quotes. An agent can distinguish it from the sibling without opening either schema.

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?

'For one quote use get_swap_quote' routes the agent to the alternative with a clear selecting condition, and the free-tier limit (10 chain reads per IP per UTC day) plus pricing are stated for cost planning. It does not spell out exclusions beyond the single-quote case, so it stops short of a full when/when-not treatment.

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.