delete-chart
Remove charts from PI Dashboard by specifying the chart ID to manage dashboard resources and maintain organized data visualizations.
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 using server.tool, specifying name, description, input schema, and inline handler function.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)Zod schema for the tool input: requires a numeric 'id' parameter for the chart ID.id: z.number().describe("Chart ID")
- build/index.js:817-833 (handler)The handler function that sends a DELETE request to the charts endpoint using the provided chart ID, returns a success message or error response.}, 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)}` }] }; } });