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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Chart ID |
Implementation Reference
- build/index.js:797-813 (handler)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)}` }] }; } });
- build/index.js:796-796 (schema)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", {