globalMetricsLatest
Retrieve current global cryptocurrency market metrics including total market cap, 24h volume, and Bitcoin dominance.
Instructions
Returns the latest global cryptocurrency market metrics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| convert | No | ||
| convert_id | No |
Implementation Reference
- index.js:488-500 (handler)Handler for the globalMetricsLatest tool. Accepts optional 'convert' and 'convert_id' params, makes a GET request to CoinMarketCap's /v1/global-metrics/quotes/latest endpoint, and returns the formatted response.
server.tool("globalMetricsLatest", "Returns the latest global cryptocurrency market metrics.", { convert: z.string().optional(), convert_id: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/global-metrics/quotes/latest', params) return formatResponse(data) }) } ) - index.js:490-493 (schema)Input schema defining optional parameters 'convert' (string) and 'convert_id' (string) for the globalMetricsLatest tool.
{ convert: z.string().optional(), convert_id: z.string().optional() }, - index.js:488-500 (registration)Registration of the globalMetricsLatest tool using server.tool() on the McpServer instance. It is registered within a Basic subscription level block.
server.tool("globalMetricsLatest", "Returns the latest global cryptocurrency market metrics.", { convert: z.string().optional(), convert_id: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/global-metrics/quotes/latest', params) return formatResponse(data) }) } )