Skip to main content
Glama
truss44

Crypto Price & Market Analysis MCP Server

get-market-analysis

Analyze cryptocurrency market data by retrieving detailed insights on top exchanges and volume distribution. Input a cryptocurrency symbol (e.g., BTC, ETH) to access comprehensive market trends and exchange information.

Instructions

Get detailed market analysis including top exchanges and volume distribution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesCryptocurrency symbol (e.g., BTC, ETH)

Implementation Reference

  • src/index.ts:51-63 (registration)
    Registers the 'get-market-analysis' tool with the MCP server, specifying title, description, input schema, and handler function that calls handleGetMarketAnalysis.
    server.registerTool( "get-market-analysis", { title: "Get Market Analysis", description: "Get detailed market analysis including top exchanges and volume distribution", inputSchema: GetMarketAnalysisSchema.shape, }, async (args, _extra) => { const result = await handleGetMarketAnalysis(args); return result as any; } );
  • Zod schema for input validation of the get-market-analysis tool, requiring a 'symbol' string.
    export const GetMarketAnalysisSchema = z.object({ symbol: z.string().min(1), });
  • Main handler function for get-market-analysis tool. Parses input symbol, fetches asset data from CoinCap, finds the asset, gets its markets, formats analysis, and returns markdown content or error.
    export async function handleGetMarketAnalysis(args: unknown) { const { symbol } = GetMarketAnalysisSchema.parse(args); const upperSymbol = symbol.toUpperCase(); try { const assetsData = await getAssets(); if (!assetsData) { return { content: [{ type: "text", text: "Failed to retrieve cryptocurrency data" }], }; } const asset = assetsData.data.find( (a: { symbol: string; }) => a.symbol.toUpperCase() === upperSymbol ); if (!asset) { return { content: [{ type: "text", text: `Could not find cryptocurrency with symbol ${upperSymbol}` }], }; } const marketsData = await getMarkets(asset.id); if (!marketsData) { return { content: [{ type: "text", text: "Failed to retrieve market data" }], }; } return { content: [{ type: "text", text: formatMarketAnalysis(asset, marketsData.data) }], }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : `Failed to retrieve data: ${String(error)}` }], }; } }

Other Tools

Related Tools

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/truss44/mcp-crypto-price'

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