Skip to main content
Glama
0xteamhq

Grafana MCP Server

by 0xteamhq

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

TableJSON Schema
NameRequiredDescriptionDefault
uidYesThe UID of the dashboard

Implementation Reference

  • 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);
        }
      },
    };
  • 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'),
    });
  • 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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool retrieves a summary, implying a read-only operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, error handling, or whether it's idempotent. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose and lists included metadata without unnecessary words. Every element (verb, resource, details) earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple single-parameter input, the description provides basic purpose but lacks completeness. It doesn't explain the return format, error cases, or how it differs from sibling tools, which is inadequate for full contextual understanding despite the tool's low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'uid' parameter. The description adds no additional parameter semantics beyond implying the summary is for a specific dashboard identified by UID. This meets the baseline of 3 since the schema adequately covers the single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get a compact summary') and resource ('of a dashboard'), specifying what information is included (title, panel count, panel types, variables, metadata). It distinguishes from siblings like 'get_dashboard_by_uid' by emphasizing the 'compact summary' aspect rather than full details, though the distinction could be more explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_dashboard_by_uid' or 'search_dashboards'. The description implies usage for summary metadata but doesn't specify scenarios, prerequisites, or exclusions, leaving the agent to infer based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/0xteamhq/mcp-grafana'

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