update-category
Modify existing category details in the PI Dashboard, including description, label, help text, panel position, and cascading filters, using the MCP Server API.
Instructions
Update an existing category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cascadeFilters | No | Enable cascading filters | |
| categoryObjectsPosition | No | Position of category objects panel | |
| description | No | Unique name of a category | |
| helpText | No | Help text to describe the category | |
| id | Yes | Category ID | |
| label | No | Alternative text for the category |
Implementation Reference
- build/index.js:692-719 (handler)The main handler function for the 'update-category' tool. It constructs a payload from optional parameters, makes an authenticated PUT request to `/categories/${id}`, and returns a success message with the result or an error message.}, async ({ id, description, label, helpText, categoryObjectsPosition, cascadeFilters }) => { try { const payload = {}; if (description !== undefined) payload.description = description; if (label !== undefined) payload.label = label; if (helpText !== undefined) payload.helpText = helpText; if (categoryObjectsPosition !== undefined) payload.categoryObjectsPosition = categoryObjectsPosition; if (cascadeFilters !== undefined) payload.cascadeFilters = cascadeFilters; const result = await authenticatedRequest(`/categories/${id}`, "PUT", payload); return { content: [{ type: "text", text: `Category updated successfully:\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error updating category: ${getErrorMessage(error)}` }] }; } });
- build/index.js:686-691 (schema)Zod schema defining the input parameters for the tool, including required 'id' and optional fields for updating category properties.id: z.number().describe("Category ID"), description: z.string().optional().describe("Unique name of a category"), label: z.string().optional().describe("Alternative text for the category"), helpText: z.string().optional().describe("Help text to describe the category"), categoryObjectsPosition: z.enum(["RIGHT", "TOP"]).optional().describe("Position of category objects panel"), cascadeFilters: z.boolean().optional().describe("Enable cascading filters")
- build/index.js:685-685 (registration)Registration of the 'update-category' tool using server.tool(), specifying name, description, schema, and inline handler.server.tool("update-category", "Update an existing category", {