get-category
Retrieve a specific category by providing its unique ID.
Instructions
Get a category by ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Category ID |
Implementation Reference
- build/index.js:628-630 (registration)Registration of the 'get-category' tool with the MCP server. It accepts an 'id' parameter (number) and has a description 'Get a category by ID'.
server.tool("get-category", "Get a category by ID", { id: z.number().describe("Category ID") }, async ({ id }) => { - build/index.js:630-646 (handler)Handler function for the 'get-category' tool. It calls authenticatedRequest(`/categories/${id}`) with a GET request, then returns the category details as formatted JSON. On error, it returns an isError response.
}, async ({ id }) => { try { const category = await authenticatedRequest(`/categories/${id}`); return { content: [{ type: "text", text: `Category details:\n${JSON.stringify(category, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching category: ${getErrorMessage(error)}` }] }; } }); - build/index.js:629-629 (schema)Input schema for 'get-category': requires an 'id' field of type z.number() described as 'Category ID'.
id: z.number().describe("Category ID")