crypto_get_price
Retrieve real-time cryptocurrency price data including 24-hour changes, trading volume, market capitalization, and 52-week price ranges for 53 supported symbols.
Instructions
Get real-time cryptocurrency price data including 24h change, volume, market cap, and 52-week range. Costs $0.01 USDC per request via x402 on Base. Supports 53 symbols: BTC, ETH, SOL, USDC, DOGE, AVAX, LINK, ADA, DOT, MATIC, UNI, AAVE, ATOM, NEAR, XRP, LTC, SHIB, ARB, OP, PEPE, BONK, SUI, SEI, TIA, JUP, WLD, TON, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Crypto symbol (e.g., BTC, ETH, SOL, PEPE) |
Implementation Reference
- src/index.ts:65-68 (handler)The handler function for 'crypto_get_price' which fetches price data from the API based on the provided symbol.
async ({ symbol }) => { const data = await apiFetch(`${CRYPTO_API}/api/v1/price/${symbol.toUpperCase()}`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - src/index.ts:53-69 (registration)Registration of the 'crypto_get_price' tool, including its schema and definition.
server.registerTool( "crypto_get_price", { title: "Get Crypto Price", description: `Get real-time cryptocurrency price data including 24h change, volume, market cap, and 52-week range. Costs $0.01 USDC per request via x402 on Base. Supports 53 symbols: BTC, ETH, SOL, USDC, DOGE, AVAX, LINK, ADA, DOT, MATIC, UNI, AAVE, ATOM, NEAR, XRP, LTC, SHIB, ARB, OP, PEPE, BONK, SUI, SEI, TIA, JUP, WLD, TON, and more.`, inputSchema: { symbol: z.string().min(1).max(10).describe("Crypto symbol (e.g., BTC, ETH, SOL, PEPE)"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, }, async ({ symbol }) => { const data = await apiFetch(`${CRYPTO_API}/api/v1/price/${symbol.toUpperCase()}`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );