exchangeMap
Retrieve mapping of cryptocurrency exchanges to CoinMarketCap IDs for data integration and querying.
Instructions
Returns a mapping of all exchanges to unique CoinMarketCap IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listing_status | No | ||
| slug | No | ||
| start | No | ||
| limit | No | ||
| sort | No |
Implementation Reference
- index.js:469-485 (registration)Registration of the 'exchangeMap' tool on the MCP server, including its description and input schema.
// /exchange/map 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) }) } ) - index.js:479-485 (handler)The handler function that executes when 'exchangeMap' is called. It makes an API request to '/v1/exchange/map' and formats the response.
async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/exchange/map', params) return formatResponse(data) }) } ) - index.js:472-478 (schema)Input schema for the 'exchangeMap' tool using Zod, defining optional parameters: listing_status, slug, start, limit, sort.
{ listing_status: z.string().optional(), slug: z.string().optional(), start: z.number().optional(), limit: z.number().optional(), sort: z.string().optional() }, - index.js:82-88 (helper)The handleEndpoint helper function that wraps the API call with error handling, used by the exchangeMap handler.
async function handleEndpoint(apiCall) { try { return await apiCall() } catch (error) { return formatErrorResponse(error.message, error.status || 403) } }