fiatMap
Map all supported fiat currencies to unique IDs with this utility. Organize, sort, and include metals for streamlined fiat currency identification and integration.
Instructions
Returns a mapping of all supported fiat currencies to unique CoinMarketCap IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_metals | No | ||
| limit | No | ||
| sort | No | ||
| start | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"include_metals": {
"type": "boolean"
},
"limit": {
"type": "number"
},
"sort": {
"type": "string"
},
"start": {
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- index.js:559-573 (registration)Full registration of the 'fiatMap' MCP tool, including description, input schema with Zod validation, and inline async handler function that proxies to CoinMarketCap /v1/fiat/map API endpoint.server.tool("fiatMap", "Returns a mapping of all supported fiat currencies to unique CoinMarketCap IDs.", { start: z.number().optional(), limit: z.number().optional(), sort: z.string().optional(), include_metals: z.boolean().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/fiat/map', params) return formatResponse(data) }) } )
- index.js:567-572 (handler)Inline handler function executing the core logic of fiatMap: calls handleEndpoint helper to make API request to '/v1/fiat/map' and format response.async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/fiat/map', params) return formatResponse(data) }) }
- index.js:561-566 (schema)Zod schema for input parameters to fiatMap tool: pagination (start, limit), sorting (sort), and option to include metals.{ start: z.number().optional(), limit: z.number().optional(), sort: z.string().optional(), include_metals: z.boolean().optional() },
- index.js:82-88 (helper)Helper function used by fiatMap handler for error handling and calling the API logic.async function handleEndpoint(apiCall) { try { return await apiCall() } catch (error) { return formatErrorResponse(error.message, error.status || 403) } }