Skip to main content
Glama
DrDroidLab

Grafana MCP Server

grafana_fetch_folders

Retrieve all Grafana folders with metadata and permissions to organize and manage dashboard access.

Instructions

Fetches all folders from Grafana with their metadata and permissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic that makes the API request to Grafana to fetch folders and processes the response.
    def grafana_fetch_folders(self) -> dict[str, Any]:
        """
        Fetches all folders from Grafana.
    
        Returns:
            Dict containing list of folders
        """
        try:
            url = f"{self.__host}/api/folders"
            logger.info("Fetching all folders")
    
            response = requests.get(url, headers=self.headers, verify=self.__ssl_verify, timeout=20)
    
            if response.status_code == 200:
                folders = response.json()
                # Extract relevant information
                folder_list = []
                for folder in folders:
                    folder_list.append(
                        {
                            "id": folder.get("id"),
                            "uid": folder.get("uid"),
                            "title": folder.get("title"),
                            "url": folder.get("url"),
                            "has_acl": folder.get("hasAcl", False),
                            "can_save": folder.get("canSave", False),
                            "can_edit": folder.get("canEdit", False),
                            "can_admin": folder.get("canAdmin", False),
                            "created": folder.get("created"),
                            "updated": folder.get("updated"),
                            "created_by": folder.get("createdBy"),
                            "updated_by": folder.get("updatedBy"),
                            "version": folder.get("version"),
                        }
                    )
    
                return {
                    "status": "success",
                    "total_count": len(folder_list),
                    "folders": folder_list,
                }
            else:
                raise Exception(f"Failed to fetch folders. Status: {response.status_code}, Response: {response.text}")
    
        except Exception as e:
            logger.error(f"Error fetching folders: {e!s}")
            raise 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 the tool fetches data, implying a read-only operation, but lacks details on authentication needs, rate limits, error handling, or what specific metadata and permissions are returned. This is insufficient for a tool with no annotation coverage.

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 directly states the tool's purpose without redundancy. It is front-loaded and wastes no words, making it easy for an agent to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain the return format, structure of metadata and permissions, or any behavioral traits like pagination or errors. For a data-fetching tool, this leaves significant gaps in understanding how to use it effectively.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information beyond the schema.

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 folders from Grafana'), specifying what metadata is included ('metadata and permissions'). It distinguishes from some siblings like query tools but doesn't explicitly differentiate from other fetch operations like 'grafana_fetch_datasources'.

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 prerequisites, timing, or comparisons to sibling tools like 'grafana_fetch_all_dashboards' or 'grafana_get_dashboard_config', leaving the agent to infer usage context.

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