Skip to main content
Glama

menese_prices

Retrieve current USD prices for crypto tokens including BTC, ETH, SOL, and other major cryptocurrencies to support trading and portfolio tracking decisions.

Instructions

Get current USD prices for crypto tokens. Supports: BTC, ETH, SOL, ICP, MATIC, BNB, ADA, XRP, SUI, TON, APT, NEAR, TRX, LTC, RUNE, CLOAK, USDC, USDT, and more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokensYesToken symbols (e.g. ['BTC', 'ETH', 'SOL'])

Implementation Reference

  • The handler implementation for the menese_prices tool, which fetches prices from CoinGecko.
    async ({ tokens }) => {
      const ids = tokens
        .map((t) => COINGECKO_IDS[t.toLowerCase()])
        .filter(Boolean);
    
      if (ids.length === 0) {
        return {
          content: [{ type: "text" as const, text: "No recognized tokens. Try: BTC, ETH, SOL, ICP, etc." }],
          isError: true,
        };
      }
    
      const idStr = [...new Set(ids)].sort().join(",");
      const prices = await cacheFetch(
        CacheKeys.prices(idStr),
        TTL.PRICES,
        async () => {
          const url = `https://api.coingecko.com/api/v3/simple/price?ids=${idStr}&vs_currencies=usd&include_24hr_change=true`;
          const res = await fetch(url);
          if (!res.ok) throw new Error(`CoinGecko API error: ${res.status}`);
          return res.json() as Promise<Record<string, { usd: number; usd_24h_change?: number }>>;
        },
      );
    
      // Map back to user's token symbols
      const result: Record<string, { usd: number; change24h?: number }> = {};
      for (const token of tokens) {
        const id = COINGECKO_IDS[token.toLowerCase()];
        if (id && prices[id]) {
          result[token.toUpperCase()] = {
            usd: prices[id].usd,
            change24h: prices[id].usd_24h_change,
          };
        }
      }
    
      return {
        content: [{
          type: "text" as const,
          text: JSON.stringify(result, null, 2),
        }],
      };
    },
  • The input schema and tool description for menese_prices.
    {
      description:
        "Get current USD prices for crypto tokens. Supports: BTC, ETH, SOL, ICP, MATIC, BNB, " +
        "ADA, XRP, SUI, TON, APT, NEAR, TRX, LTC, RUNE, CLOAK, USDC, USDT, and more.",
      inputSchema: {
        tokens: z.array(z.string()).min(1).max(20).describe("Token symbols (e.g. ['BTC', 'ETH', 'SOL'])"),
      },
  • Registration function for the menese_prices tool.
    export function registerPricesTool(server: McpServer): void {
      server.registerTool(
        "menese_prices",
        {
          description:
            "Get current USD prices for crypto tokens. Supports: BTC, ETH, SOL, ICP, MATIC, BNB, " +
            "ADA, XRP, SUI, TON, APT, NEAR, TRX, LTC, RUNE, CLOAK, USDC, USDT, and more.",
          inputSchema: {
            tokens: z.array(z.string()).min(1).max(20).describe("Token symbols (e.g. ['BTC', 'ETH', 'SOL'])"),
          },
        },
        async ({ tokens }) => {
          const ids = tokens
            .map((t) => COINGECKO_IDS[t.toLowerCase()])
            .filter(Boolean);
    
          if (ids.length === 0) {
            return {
              content: [{ type: "text" as const, text: "No recognized tokens. Try: BTC, ETH, SOL, ICP, etc." }],
              isError: true,
            };
          }
    
          const idStr = [...new Set(ids)].sort().join(",");
          const prices = await cacheFetch(
            CacheKeys.prices(idStr),
            TTL.PRICES,
            async () => {
              const url = `https://api.coingecko.com/api/v3/simple/price?ids=${idStr}&vs_currencies=usd&include_24hr_change=true`;
              const res = await fetch(url);
              if (!res.ok) throw new Error(`CoinGecko API error: ${res.status}`);
              return res.json() as Promise<Record<string, { usd: number; usd_24h_change?: number }>>;
            },
          );
    
          // Map back to user's token symbols
          const result: Record<string, { usd: number; change24h?: number }> = {};
          for (const token of tokens) {
            const id = COINGECKO_IDS[token.toLowerCase()];
            if (id && prices[id]) {
              result[token.toUpperCase()] = {
                usd: prices[id].usd,
                change24h: prices[id].usd_24h_change,
              };
            }
          }
    
          return {
            content: [{
              type: "text" as const,
              text: JSON.stringify(result, null, 2),
            }],
          };
        },
      );
    }

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/Aboodtt404/mcp-menesesdk'

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