Skip to main content
Glama

getCryptoMetadata

Retrieve static cryptocurrency metadata such as logos, descriptions, and website links using the CoinMarketCap MCP API for accurate and detailed crypto asset information.

Instructions

Returns all static metadata for one or more cryptocurrencies including logo, description, and website URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNo
auxNo
idNo
skip_invalidNo
slugNo
symbolNo

Implementation Reference

  • The handler function that executes the getCryptoMetadata tool. It calls the CoinMarketCap /v2/cryptocurrency/info API endpoint with provided parameters and formats the response.
    async ({ symbol, id, slug, address, aux, skip_invalid }) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v2/cryptocurrency/info', { symbol, id, slug, address, aux, skip_invalid }) return formatResponse(data) }) }
  • Zod input schema defining optional parameters: symbol, id, slug, address, aux, skip_invalid.
    { symbol: z.string().optional(), id: z.string().optional(), slug: z.string().optional(), address: z.string().optional(), aux: z.string().optional(), skip_invalid: z.boolean().optional() },
  • index.js:183-206 (registration)
    Registration of the getCryptoMetadata tool using server.tool(), including description, input schema, and handler function.
    server.tool("getCryptoMetadata", "Returns all static metadata for one or more cryptocurrencies including logo, description, and website URLs.", { symbol: z.string().optional(), id: z.string().optional(), slug: z.string().optional(), address: z.string().optional(), aux: z.string().optional(), skip_invalid: z.boolean().optional() }, async ({ symbol, id, slug, address, aux, skip_invalid }) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v2/cryptocurrency/info', { symbol, id, slug, address, aux, skip_invalid }) return formatResponse(data) }) } )
  • Helper function used by the handler to wrap API calls with try-catch error handling.
    async function handleEndpoint(apiCall) { try { return await apiCall() } catch (error) { return formatErrorResponse(error.message, error.status || 403) } }
  • Core helper function that makes the HTTP request to CoinMarketCap API, used by the tool handler.
    async function makeApiRequest(apiKey, endpoint, params = {}) { const queryParams = new URLSearchParams() Object.entries(params).forEach(([key, value]) => { if (value !== undefined) { queryParams.append(key, value.toString()) } }) const url = `https://pro-api.coinmarketcap.com${endpoint}${queryParams.toString() ? `?${queryParams.toString()}` : ''}` const response = await fetch(url, { method: 'GET', headers: { 'Accept': 'application/json', 'X-CMC_PRO_API_KEY': apiKey, } }) if (!response.ok) { throw new Error(`Error fetching data from CoinMarketCap: ${response.statusText}`) } return await response.json() }

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/shinzo-labs/coinmarketcap-mcp'

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