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.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses useful behavior: batch via comma-separated addresses, optional DEX pinning, and the exact return fields (usdPrice, metadata, source exchange). It omits auth requirements, rate limits, stale-price behavior, and error handling for unknown tokens, leaving real gaps for a no-annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with the core purpose, then the batch mechanic, then return shape and use cases. No filler; every sentence earns its place.

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?

With no output schema, the description correctly fills that gap by naming the return payload (usdPrice plus name/symbol/decimals/logo and source exchange). It is complete for correct invocation, with only minor omissions (provider, includeRaw) in an otherwise self-sufficient definition.

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 coverage is 60%. The description adds real meaning for contractAddress (comma-separated batch) and exchange (enumerates the DEX values), but says nothing about chainId, provider, or includeRaw, so it only partially compensates for the undocumented parameters.

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+resource+scope: 'Get the current USD spot price for one or many tokens.' It is immediately distinguishable from siblings like onchain_get_token_metadata (static metadata) and onchain_search_tokens (discovery) 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 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, or quoting a swap'), which tells the agent when this is the right call. However, it never names an alternative or states when-not to use it (e.g., vs relay_get_quote for actual pricing), so it stays at 4 rather than 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.