get_dashboard_summary
Retrieve a compact summary of a Grafana dashboard including title, panel count, panel types, variables, and metadata by providing the dashboard UID.
Instructions
Get a compact summary of a dashboard including title, panel count, panel types, variables, and other metadata
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | The UID of the dashboard |
Input Schema (JSON Schema)
{
"properties": {
"uid": {
"description": "The UID of the dashboard",
"type": "string"
}
},
"required": [
"uid"
],
"type": "object"
}
Implementation Reference
- src/tools/dashboard.ts:53-82 (handler)Complete ToolDefinition export for 'get_dashboard_summary' including description, schema reference, and the handler function that fetches dashboard data via GrafanaClient and constructs a metadata summary.export const getDashboardSummary: ToolDefinition = { name: 'get_dashboard_summary', description: 'Get a compact summary of a dashboard including title, panel count, panel types, variables, and other metadata', inputSchema: GetDashboardSummarySchema, handler: async (params, context: ToolContext) => { try { const client = new GrafanaClient(context.config.grafanaConfig); const dashboard = await client.getDashboardByUid(params.uid); const summary = { uid: dashboard.uid, title: dashboard.title, tags: dashboard.tags || [], panelCount: dashboard.panels?.length || 0, panelTypes: [...new Set(dashboard.panels?.map((p: any) => p.type) || [])], variables: dashboard.templating?.list?.map((v: any) => ({ name: v.name, type: v.type, label: v.label, })) || [], version: dashboard.version, schemaVersion: dashboard.schemaVersion, }; return createToolResult(summary); } catch (error: any) { return createErrorResult(error.message); } }, };
- src/tools/dashboard.ts:11-13 (schema)Zod input schema for get_dashboard_summary tool requiring a dashboard UID.const GetDashboardSummarySchema = z.object({ uid: z.string().describe('The UID of the dashboard'), });
- src/tools/dashboard.ts:192-192 (registration)Server registration of the getDashboardSummary tool within the registerDashboardTools function.server.registerTool(getDashboardSummary);
- src/cli.ts:102-102 (registration)Invocation of registerDashboardTools during MCP server initialization in CLI entrypoint, enabling the dashboard tools including get_dashboard_summary.registerDashboardTools(server);