cryptoCategory
Retrieve detailed data on a specific cryptocurrency category from CoinMarketCap, including market insights and metrics, using the required category ID.
Instructions
Returns information about a single coin category on CoinMarketCap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| convert | No | ||
| convert_id | No | ||
| id | Yes | ||
| limit | No | ||
| start | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"convert": {
"type": "string"
},
"convert_id": {
"type": "string"
},
"id": {
"type": "string"
},
"limit": {
"type": "number"
},
"start": {
"type": "number"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- index.js:140-155 (registration)Registration of the 'cryptoCategory' tool using server.tool, including inline handler, schema, and description.server.tool("cryptoCategory", "Returns information about a single coin category on CoinMarketCap.", { id: z.string(), start: z.number().optional(), limit: z.number().optional(), convert: z.string().optional(), convert_id: z.string().optional() }, async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/cryptocurrency/category', params) return formatResponse(data) }) } )
- index.js:149-154 (handler)The handler function that makes an API request to CoinMarketCap's /v1/cryptocurrency/category endpoint with the provided parameters and formats the response using shared utilities.async (params) => { return handleEndpoint(async () => { const data = await makeApiRequest(apiKey, '/v1/cryptocurrency/category', params) return formatResponse(data) }) }
- index.js:142-148 (schema)Zod schema for input validation: requires 'id', optional 'start', 'limit', 'convert', 'convert_id'.{ id: z.string(), start: z.number().optional(), limit: z.number().optional(), convert: z.string().optional(), convert_id: z.string().optional() },