delete-category
Remove a category from the PI Dashboard by specifying its ID to manage and organize resources effectively.
Instructions
Delete a category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Category ID |
Implementation Reference
- build/index.js:723-738 (handler)The asynchronous handler function that executes the delete-category tool logic. It performs an authenticated DELETE request to `/categories/${id}` and returns a success or error response.}, async ({ id }) => { try { await authenticatedRequest(`/categories/${id}`, "DELETE"); return { content: [{ type: "text", text: `Category with ID ${id} successfully deleted.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error deleting category: ${getErrorMessage(error)}` }] }; }
- build/index.js:722-722 (schema)Zod input schema defining the required 'id' parameter as a number with description.id: z.number().describe("Category ID")
- build/index.js:721-739 (registration)Registration of the 'delete-category' tool using server.tool(), including name, description, schema, and inline handler function.server.tool("delete-category", "Delete a category", { id: z.number().describe("Category ID") }, async ({ id }) => { try { await authenticatedRequest(`/categories/${id}`, "DELETE"); return { content: [{ type: "text", text: `Category with ID ${id} successfully deleted.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error deleting category: ${getErrorMessage(error)}` }] }; } });