Skip to main content
Glama
DrDroidLab

Grafana MCP Server

grafana_fetch_all_dashboards

Retrieve all dashboards from Grafana with key details including title, UID, folder, and tags to manage and analyze monitoring setups.

Instructions

Fetches all dashboards from Grafana with basic information like title, UID, folder, tags, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of dashboards to return

Implementation Reference

  • The core implementation of the dashboard fetching logic.
    def grafana_fetch_all_dashboards(self, limit: int = 100) -> dict[str, Any]:
        """
        Fetches all dashboards from Grafana.
    
        Args:
            limit: Maximum number of dashboards to return
    
        Returns:
            Dict containing list of dashboards with basic information
        """
        try:
            url = f"{self.__host}/api/search"
            params = {"limit": limit}
            logger.info(f"Fetching all dashboards (limit: {limit})")
    
            response = requests.get(
                url,
                headers=self.headers,
                params=params,
                verify=self.__ssl_verify,
                timeout=20,
            )
    
            if response.status_code == 200:
                dashboards = response.json()
                # Extract relevant information
                dashboard_list = []
                for dashboard in dashboards:
                    dashboard_list.append(
                        {
                            "uid": dashboard.get("uid"),
                            "title": dashboard.get("title"),
                            "type": dashboard.get("type"),
                            "url": dashboard.get("url"),
                            "folder_title": dashboard.get("folderTitle"),
                            "folder_uid": dashboard.get("folderUid"),
                            "tags": dashboard.get("tags", []),
                            "is_starred": dashboard.get("isStarred", False),
                        }
                    )
    
                return {
                    "status": "success",
                    "total_count": len(dashboard_list),
                    "limit": limit,
                    "dashboards": dashboard_list,
                }
            else:
                raise Exception(f"Failed to fetch dashboards. Status: {response.status_code}, Response: {response.text}")
    
        except Exception as e:
            logger.error(f"Error fetching dashboards: {e!s}")
            raise e
  • Tool registration mapping the tool name to its handler function.
    "grafana_fetch_all_dashboards": grafana_fetch_all_dashboards,
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation (implied by 'fetches'), potential rate limits, authentication requirements, pagination behavior beyond the 'limit' parameter, or what happens if limit is exceeded. The description adds minimal context beyond the basic action.

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 a single, efficient sentence that front-loads the core purpose and includes useful output details. There's no wasted verbiage, though it could be slightly more structured by separating usage context from output description.

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 the tool's moderate complexity (fetching multiple dashboards with a limit parameter), no annotations, and no output schema, the description is minimally adequate. It specifies what is fetched and the type of information returned, but lacks details on behavioral traits, error handling, or output format, leaving gaps for an AI agent to infer.

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 single 'limit' parameter with its type, description, and default. The description doesn't add any parameter-specific semantics beyond what the schema provides, such as typical usage or constraints, but with high coverage, baseline 3 is appropriate.

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 ('fetches') and resource ('all dashboards from Grafana') with specific output details ('basic information like title, UID, folder, tags, etc.'). It distinguishes from siblings like grafana_fetch_datasources or grafana_fetch_folders by focusing on dashboards, though it doesn't explicitly contrast with grafana_get_dashboard_config which might retrieve more detailed configuration.

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. It doesn't mention when to prefer this over grafana_get_dashboard_config (which might fetch detailed config) or grafana_query_dashboard_panels (which might focus on panel data), nor does it specify prerequisites or exclusions for usage.

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