Skip to main content
Glama
mk965

Asset Price MCP Server

list-assets.ts1.08 kB
import { PriceService, AssetSymbol } from "../types.js"; export const registerListAssetsTool = (server: any, services: PriceService[]) => { server.tool( "list_assets", "List all supported assets available for price queries", {}, async () => { const allAssets: AssetSymbol[] = []; for (const service of services) { try { const assets = await service.getSupportedAssets(); // Add source info or handle duplicates? // For now, just concat and maybe dedupe by symbol allAssets.push(...assets); } catch (error) { console.error(`Failed to fetch assets from ${service.getName()}:`, error); } } // Deduplicate by symbol const seen = new Set(); const uniqueAssets = allAssets.filter(asset => { if (seen.has(asset.symbol)) return false; seen.add(asset.symbol); return true; }); return { content: [{ type: "text", text: JSON.stringify(uniqueAssets, 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/mk965/asset-price-mcp'

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