Skip to main content
Glama

OpenFinance — Easy Trading: Crypto, Stocks, Perps & Prediction Markets

onchain_get_token_usd_price

Get the current USD spot price for one or many tokens. Pass contractAddress as comma-separated for batch. Optionally pin to a specific DEX with exchange (uniswap-v2/v3, sushiswap-v2, pancakeswap-v1/v2, quickswap). Returns usdPrice plus token metadata (name, symbol, decimals, logo) and the source exchange. Use before suggesting trades, computing portfolio USD totals, or quoting a swap to a user. Pass "native" (or 0x000…0) for a chain's native coin on any chain, Solana included; it is priced as its wrapped token. Robinhood Chain (4663) is priced from Codex (with liquidityUsd). If a price is missing, say so; never leave that asset out of a total silently.

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": {
      "chainId": "<chainId>",
      "contractAddress": "<contractAddress>"
    },
    "name": "onchain_get_token_usd_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainIdYesChain identifier; comma-separated for cross-chain batch
exchangeNoPin price to a specific DEX
providerNo
includeRawNo
contractAddressYesToken contract address(es), comma-separated for batch, or "native"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / contractAddress / description
      Previous value: -"Token contract address(es), comma-separated for batch"New value: +"Token contract address(es), comma-separated for batch, or \"native\""
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and does well: it discloses the return payload (usdPrice plus name, symbol, decimals, logo, source exchange), native-coin handling across chains including Solana, wrapped-token pricing semantics, and the Robinhood Chain special case priced from Codex with liquidityUsd. Remaining gaps are staleness/caching behavior for a "current" spot price and the role of the undocumented provider parameter.

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 core operation, then batch mechanics, then edge cases, so an agent gets the essential contract in the first sentence. It is dense but nearly every sentence carries operational detail; the chain-specific Codex note borders on niche but is a genuine pricing caveat.

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?

For a 5-parameter, no-output-schema tool, the description supplies return fields, batch behavior, native-token rules, and chain-specific pricing provenance, which is close to sufficient. The notable omissions are the purpose of provider and includeRaw and any statement about price freshness, which matter for an agent computing portfolio totals.

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?

With 60% schema coverage the description meaningfully compensates: it explains batch semantics for contractAddress, the "native"/0x000…0 convention that only partially appears in the schema, and describes exchange pinning behavior rather than just repeating the enum. The provider and includeRaw parameters are never mentioned in either schema description or prose, so the coverage gap is not fully closed.

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?

Opens with a specific verb and resource ("Get the current USD spot price for one or many tokens") and immediately establishes batch scope via comma-separated contractAddress. An agent can distinguish this read-only pricing tool from siblings like onchain_get_token_metadata or onchain_get_address_holdings without inspecting 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete usage contexts (before suggesting trades, computing portfolio USD totals, quoting a swap) plus a data-quality instruction (report missing prices rather than silently dropping an asset from a total). It stops short of naming an explicit alternative tool for related needs, but the when-to-use conditions are unambiguous.

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.