Skip to main content
Glama

exchangeMap

Map and retrieve all cryptocurrency exchanges with their unique CoinMarketCap IDs to streamline data access and integration. Filter results by listing status, slug, or other parameters for precise analysis.

Instructions

Returns a mapping of all exchanges to unique CoinMarketCap IDs.

Input Schema

NameRequiredDescriptionDefault
limitNo
listing_statusNo
slugNo
sortNo
startNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "limit": { "type": "number" }, "listing_status": { "type": "string" }, "slug": { "type": "string" }, "sort": { "type": "string" }, "start": { "type": "number" } }, "type": "object" }

Implementation Reference

  • The handler function that executes the tool logic: calls makeApiRequest to the CoinMarketCap '/v1/exchange/map' endpoint with params, formats the response, and uses handleEndpoint for error handling.
    async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/exchange/map', params) return formatResponse(data) }) }
  • Zod schema defining the input parameters for the exchangeMap tool.
    { listing_status: z.string().optional(), slug: z.string().optional(), start: z.number().optional(), limit: z.number().optional(), sort: z.string().optional() },
  • index.js:470-485 (registration)
    The server.tool call that registers the exchangeMap tool with name, description, input schema, and handler function.
    server.tool("exchangeMap", "Returns a mapping of all exchanges to unique CoinMarketCap IDs.", { listing_status: z.string().optional(), slug: z.string().optional(), start: z.number().optional(), limit: z.number().optional(), sort: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/exchange/map', params) 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) } }
  • Helper function to format successful API responses as MCP content.
    function formatResponse(data) { return { content: [{ type: "text", text: JSON.stringify(data) }] } }

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