Skip to main content
Glama

Token prices from onchain DEX pools (Base and Solana), with pool, depth and confidence

onchain_prices
Read-onlyIdempotent

Use when an agent needs a token's USD price without a third-party price feed. Input: tokens (up to 10, base:0x… or sol:). Output: per token priceUsd, confidence, the pool used (Uniswap v3 / Aerodrome on Base, Orca Whirlpool on Solana; fee tier, depth in USD), path (direct USDC or via WETH/SOL), warnings; no price below $1,000 depth. Spot, not TWAP. Use instead: crypto_price for a major coin by ticker; onchain_prices_batch for many tokens plus buy impact; swap_quote for a specific swap. Example: ?tokens=base:0x940181a94A35A4569E4529A3CDfB74e38FD98631 Price: $0.003 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"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokensYesComma-separated chain:address list, max 10 (base:0x… ERC-20, sol:<mint> base58), or tickers BTC, ETH, SOL, USDC, AERO, DEGEN, BONK, JUP. Bad input → 400 before payment (not charged)

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
    • changedInput schema / properties / tokens / description
      Previous value: -"Comma-separated chain:address list, max 10 (base:0x… ERC-20, sol:<mint> base58). Bad input → 400 before payment (not charged)"New value: +"Comma-separated chain:address list, max 10 (base:0x… ERC-20, sol:<mint> base58), or tickers BTC, ETH, SOL, USDC, AERO, DEGEN, BONK, JUP. Bad input → 400 before payment (not charged)"
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent safety, and the description adds substantial context beyond them: spot rather than TWAP pricing, a $1,000 depth floor, which DEX venues are consulted per chain, and a pay-per-call model with x402/USDC settlement. It also discloses that bad input returns 400 before payment, which is exactly the kind of cost-relevant behavior an agent needs.

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 use case, then input, output, alternatives, example, and price, so an agent can stop reading early. It is dense to the point of semicolon-chained clauses, which slightly hurts scanning but no sentence is filler.

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?

There is no output schema, so the description enumerates the return fields itself (priceUsd, confidence, pool, fee tier, depth, path, warnings). Combined with the depth floor, the spot-vs-TWAP caveat, and the payment terms, nothing an agent needs to call or interpret this tool 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% and already documents the chain:address format, the 10-item cap, and the ticker shortcuts, so the description is not required to carry parameter meaning. It still adds a concrete worked example (?tokens=base:0x9401…), which clarifies the expected URL-encoded form beyond the schema's prose.

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 (USD token price from onchain DEX pools) plus the defining constraint 'without a third-party price feed'. It immediately separates itself from crypto_price (ticker-based) and onchain_prices_batch (many tokens + buy impact), so an agent can route without opening a 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?

Gives explicit when-to-use ('agent needs a token's USD price') and an explicit 'Use instead' block naming three alternatives with the condition that selects each. It also states a hard exclusion (no price below $1,000 pool depth) that tells the agent when this tool will not serve the need.

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