list-category-objects
Retrieve all objects within a specific category from the PI Dashboard to organize and access related resources efficiently.
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:741-759 (registration)Registration of the 'list-category-objects' tool, including inline schema and 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)}` }] }; } });
- build/index.js:743-759 (handler)The main handler function that performs an authenticated API request to fetch category objects and returns the result as formatted text or an error message.}, 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)Input schema using Zod validation for the required 'categoryId' parameter.categoryId: z.number().describe("Category ID")