Skip to main content
Glama

get-chart

Retrieve a specific chart from the PI Dashboard using its unique ID to access and display data visualizations.

Instructions

Get a chart by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesChart ID

Implementation Reference

  • The handler function that executes the get-chart tool: fetches the chart by ID via authenticatedRequest, returns formatted JSON details or an error response.
    }, async ({ id }) => { try { const chart = await authenticatedRequest(`/charts/${id}`); return { content: [{ type: "text", text: `Chart details:\n${JSON.stringify(chart, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching chart: ${getErrorMessage(error)}` }] }; } });
  • Input schema definition for the get-chart tool using Zod: requires a numeric 'id' parameter for the chart ID.
    id: z.number().describe("Chart ID")
  • build/index.js:795-795 (registration)
    Registration of the 'get-chart' tool on the MCP server, specifying name, description, and linking to schema and handler.
    server.tool("get-chart", "Get a chart by 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