list-category-objects
Retrieve all objects within a specified category by providing its ID. This tool helps manage and access resources efficiently using the MCP Server for PI Dashboard integration.
Instructions
List all objects for a specific category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryId | Yes | Category ID |
Implementation Reference
- build/index.js:743-758 (handler)Handler function for the 'list-category-objects' tool. Fetches category objects via authenticated API request and formats the response as text or handles errors.}, async ({ categoryId }) => { try { const categoryObjects = await authenticatedRequest(`/categories/${categoryId}/categoryObjects`); return { content: [{ type: "text", text: `Category objects retrieved successfully:\n${JSON.stringify(categoryObjects, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching category objects: ${getErrorMessage(error)}` }] }; }
- build/index.js:742-742 (schema)Zod input schema defining the required 'categoryId' parameter as a number.categoryId: z.number().describe("Category ID")
- build/index.js:741-759 (registration)Tool registration call using server.tool(), specifying name, description, input schema, and inline handler function.server.tool("list-category-objects", "List all objects for a specific category", { categoryId: z.number().describe("Category ID") }, async ({ categoryId }) => { try { const categoryObjects = await authenticatedRequest(`/categories/${categoryId}/categoryObjects`); return { content: [{ type: "text", text: `Category objects retrieved successfully:\n${JSON.stringify(categoryObjects, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching category objects: ${getErrorMessage(error)}` }] }; } });