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
| Name | Required | Description | Default |
|---|---|---|---|
| coin_id | Yes | ||
| vs_currency | Yes |
Implementation Reference
- src/apis/crypto/coingecko.ts:51-56 (handler)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); },
- src/apis/crypto/coingecko.ts:29-33 (schema)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"], },
- src/tools/register.ts:32-32 (registration)Registers the CoinGecko tools (including get_coin_price) in the main tool registration by calling registerCoinGecko().registerCoinGecko(),
- src/apis/crypto/coingecko.ts:9-11 (helper)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 } }); }
- src/apis/crypto/coingecko.ts:26-34 (registration)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"], }, },