Skip to main content
Glama

crypto_price

Get current cryptocurrency prices, market capitalization, and 24-hour change data for any coin. Input a coin ID to retrieve real-time financial metrics.

Instructions

Get current price, market cap, and 24h change for any cryptocurrency

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin ID (e.g. bitcoin, ethereum, solana)

Implementation Reference

  • Registration and handler implementation for the "crypto_price" tool.
    server.tool("crypto_price", "Get current price, market cap, and 24h change for any cryptocurrency", {
      coin: z.string().describe("Coin ID (e.g. bitcoin, ethereum, solana)")
    }, async ({ coin }) => {
      const data = await safeFetch(`https://api.coingecko.com/api/v3/simple/price?ids=${coin}&vs_currencies=usd&include_market_cap=true&include_24hr_change=true&include_24hr_vol=true`);
      const c = data[coin];
      if (!c) return { content: [{ type: "text", text: `Coin "${coin}" not found. Try: bitcoin, ethereum, solana, dogecoin` }] };
      return { content: [{ type: "text", text: `**${coin.toUpperCase()}**\nPrice: ${formatCurrency(c.usd)}\nMarket Cap: ${formatNumber(c.usd_market_cap)}\n24h Change: ${formatPercent(c.usd_24h_change)}\n24h Volume: ${formatNumber(c.usd_24h_vol)}` }] };
    });

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/ElromEvedElElyon/claw-mcp-toolkit'

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