Skip to main content
Glama
DrDroidLab

Grafana MCP Server

grafana_get_dashboard_config

Retrieve dashboard configuration details from Grafana's database to access metadata and settings for monitoring and analysis workflows.

Instructions

Retrieves dashboard configuration details from the database. Queries the connectors_connectormetadatamodelstore table for dashboard metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dashboard_uidYesDashboard UID

Implementation Reference

  • The actual implementation of the tool logic that interacts with the Grafana API to fetch dashboard configuration details.
    def grafana_get_dashboard_config_details(self, dashboard_uid: str) -> dict[str, Any]:
        """
        Retrieves dashboard configuration details from the database.
    
        Args:
            dashboard_uid: Dashboard UID
    
        Returns:
            Dict containing dashboard configuration metadata
        """
        try:
            # This would typically query a database, but for now we'll use Grafana API
            url = f"{self.__host}/api/dashboards/uid/{dashboard_uid}"
            logger.info(f"Fetching dashboard config for UID: {dashboard_uid}")
    
            response = requests.get(url, headers=self.headers, verify=self.__ssl_verify, timeout=20)
    
            if response.status_code == 200:
                dashboard_data = response.json()
                return {
                    "status": "success",
                    "dashboard_uid": dashboard_uid,
                    "dashboard": dashboard_data.get("dashboard", {}),
                    "meta": dashboard_data.get("meta", {}),
                }
            else:
                raise Exception(f"Failed to fetch dashboard config. Status: {response.status_code}, Response: {response.text}")
    
        except Exception as e:
            logger.error(f"Error fetching dashboard config: {e!s}")
            raise e
  • The schema and registration definition of the 'grafana_get_dashboard_config' tool.
    {
        "name": "grafana_get_dashboard_config",
        "description": "Retrieves dashboard configuration details from the database. "
        "Queries the connectors_connectormetadatamodelstore table for dashboard metadata.",
        "inputSchema": {
            "type": "object",
            "properties": {"dashboard_uid": {"type": "string", "description": "Dashboard UID"}},
            "required": ["dashboard_uid"],
        },
    },
  • The server-side wrapper function that orchestrates the tool call and delegates execution to the processor.
    def grafana_get_dashboard_config(dashboard_uid):
        """Get dashboard configuration details"""
        try:
            grafana_processor = current_app.config.get("grafana_processor")
            if not grafana_processor:
                return {
                    "status": "error",
                    "message": "Grafana processor not initialized. Check configuration.",
                }
    
            result = grafana_processor.grafana_get_dashboard_config_details(dashboard_uid)
            return result
        except Exception as e:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a retrieval/query operation, implying it's read-only, but doesn't clarify permissions, rate limits, error handling, or what 'configuration details' specifically include. This leaves significant gaps for an agent to understand how to use it effectively.

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

Conciseness4/5

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

The description is concise with two sentences that directly address the tool's function and data source. It's front-loaded with the core purpose, though it could be slightly more structured by explicitly stating the input parameter's role.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'configuration details' include in the return value, error cases, or how this fits into the broader Grafana toolset. For a tool with no structured output, more detail on expected behavior is needed.

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?

Schema description coverage is 100%, so the schema already documents the 'dashboard_uid' parameter. The description adds minimal value beyond this by mentioning it queries a database table, but doesn't provide additional context like format examples or constraints beyond what the schema states.

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 verb ('Retrieves') and resource ('dashboard configuration details'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'grafana_fetch_all_dashboards' or 'grafana_query_dashboard_panels' which might retrieve similar data, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions querying a specific database table, but doesn't explain why one would choose this over other dashboard-related tools in the sibling list, such as for configuration details versus panel data or variables.

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/DrDroidLab/grafana-mcp-server'

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