delete-chart
Remove a chart from PI Dashboard by providing its chart ID.
Instructions
Delete a chart
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Chart ID |
Implementation Reference
- build/index.js:815-833 (registration)Registration of the 'delete-chart' tool using server.tool() with schema and handler inline.
server.tool("delete-chart", "Delete a chart", { id: z.number().describe("Chart ID") }, async ({ id }) => { try { await authenticatedRequest(`/charts/${id}`, "DELETE"); return { content: [{ type: "text", text: `Chart with ID ${id} successfully deleted.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error deleting chart: ${getErrorMessage(error)}` }] }; } }); - build/index.js:816-816 (schema)Input schema: requires an 'id' parameter of type number (z.number()), described as 'Chart ID'.
id: z.number().describe("Chart ID") - build/index.js:817-833 (handler)Handler function that sends a DELETE request to /charts/{id} via authenticatedRequest, then returns success or error.
}, async ({ id }) => { try { await authenticatedRequest(`/charts/${id}`, "DELETE"); return { content: [{ type: "text", text: `Chart with ID ${id} successfully deleted.` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error deleting chart: ${getErrorMessage(error)}` }] }; } });