Skip to main content
Glama

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

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