Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesChart 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)}` }] }; } });
  • 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)}` }] }; } });
  • Zod schema defining the input parameter 'id' as a number for the chart ID.
    id: z.number().describe("Chart ID")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mingzilla/pi-api-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server