Skip to main content
Glama

get_coin_price

Retrieve the current price of a cryptocurrency in a specified currency using the Multi-MCPs server. Input the coin ID and target currency to fetch real-time pricing data.

Instructions

Get current price for a coin in a given currency

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coin_idYes
vs_currencyYes

Implementation Reference

  • The handler function that implements the get_coin_price tool logic by validating inputs and calling the CoinGecko client's getPrice method.
    async get_coin_price(args: Record<string, unknown>) { const coinId = String(args.coin_id || ""); const vsCurrency = String(args.vs_currency || ""); if (!coinId || !vsCurrency) throw new Error("coin_id and vs_currency are required"); return client.getPrice(coinId, vsCurrency); },
  • Input schema defining the required parameters coin_id and vs_currency as strings for the get_coin_price tool.
    inputSchema: { type: "object", properties: { coin_id: { type: "string" }, vs_currency: { type: "string" } }, required: ["coin_id", "vs_currency"], },
  • Registers the CoinGecko tools (including get_coin_price) in the main tool registration by calling registerCoinGecko().
    registerCoinGecko(),
  • Helper method in CoinGeckoClient class that makes the API request to fetch the coin price.
    getPrice(coinId: string, vsCurrency: string) { return this.request(`/simple/price`, { query: { ids: coinId, vs_currencies: vsCurrency } }); }
  • Local registration of the get_coin_price tool within the registerCoinGecko function, including name, description, and schema.
    { name: "get_coin_price", description: "Get current price for a coin in a given currency", inputSchema: { type: "object", properties: { coin_id: { type: "string" }, vs_currency: { type: "string" } }, required: ["coin_id", "vs_currency"], }, },

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/TaylorChen/muti-mcps'

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