Skip to main content
Glama

price

Retrieve current cryptocurrency prices, 24-hour changes, trading volume, and market capitalization data for assets like BTC, ETH, SOL, and DOGE.

Instructions

Get current price, 24h change, volume, market cap for any cryptocurrency. Examples: BTC, ETH, SOL, DOGE.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesCrypto symbol (BTC, ETH, SOL, DOGE, etc.)

Implementation Reference

  • index.js:50-78 (handler)
    The getCryptoPrice function fetches live cryptocurrency price data from CoinGecko.
    async function getCryptoPrice(symbol) {
      const id = symbol.toLowerCase().replace('usdt', '').replace('usd', '');
      const idMap = {
        btc: 'bitcoin', eth: 'ethereum', sol: 'solana', doge: 'dogecoin',
        xrp: 'ripple', ada: 'cardano', avax: 'avalanche-2', dot: 'polkadot',
        matic: 'matic-network', link: 'chainlink', uni: 'uniswap', atom: 'cosmos',
        near: 'near', apt: 'aptos', sui: 'sui', arb: 'arbitrum',
        op: 'optimism', bnb: 'binancecoin', ltc: 'litecoin', bch: 'bitcoin-cash',
      };
      const coinId = idMap[id] || id;
    
      const data = await fetch(
        `https://api.coingecko.com/api/v3/coins/${coinId}?localization=false&tickers=false&community_data=false&developer_data=false`
      );
    
      return {
        symbol: symbol.toUpperCase(),
        name: data.name,
        price: data.market_data.current_price.usd,
        change_24h: data.market_data.price_change_percentage_24h,
        change_7d: data.market_data.price_change_percentage_7d,
        market_cap: data.market_data.market_cap.usd,
        volume_24h: data.market_data.total_volume.usd,
        high_24h: data.market_data.high_24h.usd,
        low_24h: data.market_data.low_24h.usd,
        ath: data.market_data.ath.usd,
        ath_change: data.market_data.ath_change_percentage.usd,
      };
    }
  • index.js:238-248 (registration)
    Definition of the 'price' tool within the MCP server's tool registry.
    {
      name: 'price',
      description: 'Get current price, 24h change, volume, market cap for any cryptocurrency. Examples: BTC, ETH, SOL, DOGE.',
      inputSchema: {
        type: 'object',
        properties: {
          symbol: { type: 'string', description: 'Crypto symbol (BTC, ETH, SOL, DOGE, etc.)' }
        },
        required: ['symbol']
      }
    },
  • Tool handler implementation that calls getCryptoPrice when the 'price' tool is invoked.
    case 'price':
      return await getCryptoPrice(args.symbol);
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It compensates by enumerating the four data fields returned (price, 24h change, volume, market cap), effectively substituting for a missing output schema. However, lacks operational context: data freshness, source/aggregation method, or error behavior for invalid symbols.

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?

Extremely efficient two-sentence structure. Front-loaded with functional purpose, followed by concrete examples. No redundant phrases or unnecessary elaboration—every word serves tool selection or invocation.

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?

Appropriate for a simple single-parameter lookup tool. The description compensates for the missing output schema by explicitly listing the four returned data fields. Would benefit from note on case sensitivity or symbol format, but adequate for the complexity level.

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 100% with the 'symbol' parameter fully documented as 'Crypto symbol (BTC, ETH, SOL, DOGE, etc.)'. The description adds 'Examples: BTC, ETH, SOL, DOGE' which merely duplicates information already in the schema. Adds no semantic value regarding case sensitivity, ticker formats, or validation rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'Get' and clear resource 'cryptocurrency'. Explicitly lists four return metrics (price, 24h change, volume, market cap). However, lacks differentiation from sibling 'market_cap' which creates ambiguity about tool selection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

No guidance on when to use this versus siblings like 'market_cap', 'compare', or 'analyze'. Given the overlapping functionality (this returns market cap, yet 'market_cap' exists as a separate tool), explicit selection criteria are needed but missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ShipItAndPray/mcp-market-data'

If you have feedback or need assistance with the MCP directory API, please join our Discord server