delete-chart
Remove a chart from the PI Dashboard using its unique ID to manage resources effectively with the PI API MCP Server.
Instructions
Delete a chart
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Chart ID |
Implementation Reference
- build/index.js:815-833 (registration)Registration of the 'delete-chart' tool including Zod input schema for 'id' parameter and the complete inline handler function that performs the DELETE request to the charts API endpoint and handles success/error responses.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:817-833 (handler)The handler function executes the core logic: authenticates and sends DELETE request to `/charts/${id}`, returns success message 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)}` }] }; } });
- build/index.js:816-816 (schema)Zod schema defining the input parameter 'id' as a number for the chart ID.id: z.number().describe("Chart ID")