Skip to main content
Glama

Batch token prices + trade price impact (Base and Solana DEX pools)

onchain_prices_batch
Read-onlyIdempotent

Use when a trading agent needs many token prices at once plus the price impact of a buy. Input: tokens (≤25, base:0x… or sol:, ≤10 Solana), amount_usd (default 1000) or amounts (up to 5 USD sizes). Output: per token priceUsd, confidence, pool, depth and buy estimates: tokensOut, effectivePriceUsd, priceImpactPct (Uniswap v3 QuoterV2 / Aerodrome, Orca CLMM). Use instead: onchain_prices for up to 10 tokens without impact; swap_quote for a specific swap. Example: ?tokens=base:0x4200000000000000000000000000000000000006&amounts=1000,100000 Price: $0.008 per call, paid in USDC (Base, Monad, Polygon, Arbitrum or Solana) via x402.

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": {
      "tokens": "<tokens>"
    },
    "name": "onchain_prices_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokensYesComma-separated chain:address list, max 25 (≤10 Solana). Bad input → 400 before payment (not charged)
amountsNoUp to 5 USD buy sizes for a price-impact curve (instead of amount_usd); each price row gets trades[]
amount_usdNoSize of the buy to estimate, in USD (default 1000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  3. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  4. Changed1 schema field changed
    • addedInput schema / properties / amounts
      Added value: +{
      +  "description": "Up to 5 USD buy sizes for a price-impact curve (instead of amount_usd); each price row gets trades[]",
      +  "type": "string"
      +}
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish readOnly/idempotent/non-destructive, and the description layers on behavior they cannot express: cost ($0.008 per call paid in USDC via x402 across four chains), billing safeguard (bad input returns 400 before payment, not charged), hard caps (25 tokens, 10 Solana, 5 USD sizes), and the upstream quote engines (QuoterV2/Aerodrome, Orca CLMM). This is materially useful context beyond the structured fields and contradicts nothing.

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 'Use when', then Input/Output/Use instead/Example/Price blocks in a scannable order. Dense but nearly every clause carries information; the trailing pricing sentence and the raw example query string could be tightened slightly.

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 three-parameter read-only tool with no output schema, the description names the per-token output fields (priceUsd, confidence, pool, depth, tokensOut, effectivePriceUsd, priceImpactPct), the input limits, error/billing behavior, and the alternatives. An agent has everything needed to call it correctly and interpret the result.

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, but the description adds value beyond it: concrete prefix syntax (base:0x… / sol:<mint>), the default for amount_usd (1000), and the meaning of amounts as a price-impact curve where each price row gets trades[]. It stops short of detail like comma-separator edge cases or what happens if amount_usd and amounts are both sent.

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 combination: batch token prices plus buy price impact on Base and Solana DEX pools. It immediately differentiates from siblings by naming onchain_prices (no impact) and swap_quote (single swap), so an agent can select it without opening any schema.

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?

Opens with an explicit 'Use when a trading agent needs many token prices at once plus the price impact of a buy', and supplies an explicit 'Use instead' section routing to onchain_prices for up to 10 tokens without impact and swap_quote for a specific swap. Both the selection condition and the alternatives are spelled out.

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