Grafana MCP Server
Provides tools for executing PromQL and Loki queries, retrieving dashboard configurations, fetching panel data, accessing label values, retrieving dashboard variables, listing all dashboards, accessing datasource configurations, and fetching folder metadata from a Grafana instance.
Enables executing PromQL queries against Prometheus datasources configured in Grafana, optimizing time series responses to reduce token size.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grafana MCP Servershow me the CPU usage for the last hour from the production dashboard"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grafana MCP Server
Available Tools
The following tools are available via the MCP server:
test_connection: Verify connectivity to your Grafana instance and configuration.
grafana_promql_query: Execute PromQL queries against Grafana's Prometheus datasource. Fetches metrics data using PromQL expressions, optimizes time series responses to reduce token size.
grafana_loki_query: Query Grafana Loki for log data. Fetches logs for a specified duration (e.g., '5m', '1h', '2d'), converts relative time to absolute timestamps.
grafana_get_dashboard_config: Retrieves dashboard configuration details from the database. Queries the connectors_connectormetadatamodelstore table for dashboard metadata.
grafana_query_dashboard_panels: Execute queries for specific dashboard panels. Can query up to 4 panels at once, supports template variables, optimizes metrics data.
grafana_fetch_label_values: Fetch label values for dashboard variables from Prometheus datasource. Retrieves available values for specific labels (e.g., 'instance', 'job'). Supports optional metric filtering.
grafana_fetch_dashboard_variables: Fetch all variables and their values from a Grafana dashboard. Retrieves dashboard template variables and their current values.
grafana_fetch_all_dashboards: Fetch all dashboards from Grafana with basic information like title, UID, folder, tags, etc.
grafana_fetch_datasources: Fetch all datasources from Grafana with their configuration details.
grafana_fetch_folders: Fetch all folders from Grafana with their metadata and permissions.
Related MCP server: Metabase MCP Plus
š Usage & Requirements
1. Get Your Grafana API Endpoint & Service Account Token
Ensure you have a running Grafana instance (self-hosted or cloud).
Generate a Service Account Token from your Grafana UI:
Create Service Account: In your Grafana dashboard, navigate to Admin >> Users & Access >> Service Accounts >> Create a Service Account with Viewer permissions
Generate Service Account Key: Within Service Account, create a new Service Account token.
Copy the service account token (starts with
glsa_)
2. Installation & Running Options
2A. Install & Run with uv (Recommended for Local Development)
2A.1. Install dependencies with uv
uv venv .venv
source .venv/bin/activate
uv sync2A.2. Run the server with uv
uv run -m src.grafana_mcp_server.mcp_serverYou can also use
uvto run any other entrypoint scripts as needed.Make sure your
config.yamlis in the same directory asmcp_server.pyor set the required environment variables (see Configuration section).
2B. Run with Docker Compose (Recommended for Production/Containerized Environments)
Edit
grafana-mcp-server/src/grafana_mcp_server/config.yamlwith your Grafana details (host, API key).Start the server:
docker compose up -dThe server will run in HTTP (SSE) mode on port 8000 by default.
You can override configuration with environment variables (see below).
3. Configuration
The server loads configuration in the following order of precedence:
Environment Variables (recommended for Docker/CI):
GRAFANA_HOST: Grafana instance URL (e.g.https://your-grafana-instance.com)GRAFANA_API_KEY: Grafana Service Account Token (required)GRAFANA_SSL_VERIFY:trueorfalse(default:true)MCP_SERVER_PORT: Port to run the server on (default:8000)MCP_SERVER_DEBUG:trueorfalse(default:true)
YAML file fallback (
config.yaml):grafana: host: "https://your-grafana-instance.com" api_key: "your-grafana-api-key-here" ssl_verify: "true" server: port: 8000 debug: true
4. Integration with AI Assistants (e.g., Claude Desktop, Cursor)
You can integrate this MCP server with any tool that supports the MCP protocol. Here are the main options:
4A. Using Docker (with environment variables)
{
"mcpServers": {
"grafana": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GRAFANA_HOST",
"-e",
"GRAFANA_API_KEY",
"-e",
"GRAFANA_SSL_VERIFY",
"drdroidlab/grafana-mcp-server",
"-t",
"stdio"
],
"env": {
"GRAFANA_HOST": "https://your-grafana-instance.com",
"GRAFANA_API_KEY": "your-grafana-api-key-here",
"GRAFANA_SSL_VERIFY": "true"
}
}
}
}The
-t stdioargument is supported for compatibility with Docker MCP clients (forces stdio handshake mode).Adjust the volume path or environment variables as needed for your deployment.
4B. Connecting to an Already Running MCP Server (HTTP/SSE)
If you have an MCP server already running (e.g., on a remote host, cloud VM, or Kubernetes), you can connect your AI assistant or tool directly to its HTTP endpoint.
{
"mcpServers": {
"grafana": {
"url": "http://your-server-host:8000/mcp"
}
}
}Replace
your-server-hostwith the actual host where your MCP server is running.For local setup, use
localhostas the server host (i.e.,http://localhost:8000/mcp).Use
httpfor local or unsecured deployments, andhttpsfor production or secured deployments.Make sure the server is accessible from your client machine (check firewall, security group, etc.).
Health Check
curl http://localhost:8000/healthThe server runs on port 8000 by default.
5. Project Structure
grafana-mcp-server/
ā āāā src/
ā āāā grafana_mcp_server/
ā āāā __init__.py
ā āāā config.yaml # Configuration file
ā āāā mcp_server.py # Main MCP server implementation
ā āāā stdio_server.py # STDIO server for MCP
ā āāā processor/
ā āāā __init__.py
ā āāā grafana_processor.py # Grafana API processor
ā āāā processor.py # Base processor interface
āāā tests/
āāā Dockerfile
āāā docker-compose.yml
āāā pyproject.toml
āāā README.md6. Troubleshooting
Common Issues
Connection Failed:
Verify your Grafana instance is running and accessible
Check your API key has proper permissions
Ensure SSL verification settings match your setup
Authentication Errors:
Verify your API key is correct and not expired
Check if your Grafana instance requires additional authentication
Query Failures:
Ensure datasource UIDs are correct
Verify PromQL/Loki query syntax
Check if the datasource is accessible with your API key
Debug Mode
Enable debug mode to get more detailed logs:
export MCP_SERVER_DEBUG=true7. Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
8. License
This project is licensed under the MIT License - see the LICENSE file for details.
9. Support
Need help anywhere? Join our discord channel and message on #mcp channel.
Want a 1-click MCP Server? Join the same community and let us know.
For issues and questions, please open an issue on GitHub or contact the maintainers.
Available Tools
10 toolsgrafana_fetch_all_dashboardsC
Fetches all dashboards from Grafana with basic information like title, UID, folder, tags, etc.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of dashboards to return |
TDQS
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.
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.
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.
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.
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.
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.
grafana_fetch_dashboard_variablesC
Fetches all variables and their values from a Grafana dashboard. Retrieves dashboard template variables and their current values.
| Name | Required | Description | Default |
|---|---|---|---|
| dashboard_uid | Yes | Dashboard UID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe important behavioral aspects: whether this requires authentication, what format the variables are returned in, if there are rate limits, whether it's a read-only operation, or how errors are handled. The description is minimal and lacks operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences that directly state the tool's purpose. Every word serves a clear function - the first sentence establishes the core functionality, and the second clarifies the type of variables retrieved. There's no wasted language or unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the return value looks like (structure of variables/values), authentication requirements, error conditions, or practical use cases. The agent would need to guess about the output format and operational constraints, which is problematic for a tool that presumably returns structured data.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with the single parameter 'dashboard_uid' documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema - it doesn't explain what a dashboard UID is, where to find it, or provide examples. However, with complete schema coverage, the baseline is 3 even without additional param details in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'fetches' and the resource 'variables and their values from a Grafana dashboard', with additional clarification about 'template variables and their current values'. It distinguishes itself from siblings like grafana_fetch_all_dashboards or grafana_query_dashboard_panels by focusing specifically on dashboard variables. However, it doesn't explicitly contrast with grafana_get_dashboard_config, which might also retrieve variable information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 doesn't mention when you'd fetch variables versus fetching the entire dashboard configuration (grafana_get_dashboard_config) or querying panels (grafana_query_dashboard_panels). There's no context about prerequisites, timing, or use cases for accessing variables separately.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_fetch_datasourcesB
Fetches all datasources from Grafana with their configuration details.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While 'fetches' implies a read operation, it doesn't specify authentication requirements, rate limits, pagination behavior, error conditions, or what 'configuration details' specifically includes. The description is too minimal for a tool that presumably interacts with an external API.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a zero-parameter tool and front-loads the essential information immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that fetches data from an external system (Grafana) with no annotations and no output schema, the description is insufficient. It doesn't explain what 'configuration details' includes, how results are structured, whether authentication is required, or any operational constraints. The agent would need to guess about important behavioral aspects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's purpose rather than attempting to describe non-existent inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
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 datasources from Grafana with their configuration details'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential sibling alternatives like 'grafana_fetch_folders' or 'grafana_fetch_all_dashboards' beyond the resource type.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. With sibling tools like 'grafana_fetch_folders' and 'grafana_fetch_all_dashboards' available, there's no indication of when datasource fetching is appropriate versus other Grafana resource types, nor any mention of prerequisites or constraints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_fetch_foldersB
Fetches all folders from Grafana with their metadata and permissions.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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.
grafana_fetch_label_valuesC
Fetches label values for dashboard variables from Prometheus datasource. Retrieves available values for specific labels (e.g., 'instance', 'job').
| Name | Required | Description | Default |
|---|---|---|---|
| datasource_uid | Yes | Prometheus datasource UID | |
| label_name | Yes | Label name to fetch values for (e.g., 'instance', 'job') | |
| metric_match_filter | No | Optional metric name filter (e.g., 'up', 'node_cpu_seconds_total') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions what the tool does but doesn't disclose behavioral traits like whether this requires authentication, rate limits, what happens on errors, or the format/structure of returned values. The description is functional but lacks operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with two sentences. The first sentence states the core purpose, and the second adds useful examples. There's no wasted text, though it could be slightly more structured for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
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 moderately complete but has gaps. It explains what the tool does and gives parameter context, but lacks details on behavioral aspects (e.g., authentication, error handling) and output format. For a tool with 3 parameters and no structured output info, it's adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 all three parameters thoroughly. The description adds minimal value beyond the schemaāit mentions example labels ('instance', 'job') which are already in the schema, and implies the metric_match_filter is optional (which the schema shows via required fields). Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('fetches', 'retrieves') and resource ('label values for dashboard variables from Prometheus datasource'). It specifies the purpose is for dashboard variables and mentions example labels, but doesn't explicitly differentiate from sibling tools like grafana_fetch_dashboard_variables or grafana_promql_query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 doesn't mention when this tool is appropriate versus other sibling tools like grafana_fetch_dashboard_variables (which might get variables directly) or grafana_promql_query (which might query metrics). No exclusions or prerequisites are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_get_dashboard_configC
Retrieves dashboard configuration details from the database. Queries the connectors_connectormetadatamodelstore table for dashboard metadata.
| Name | Required | Description | Default |
|---|---|---|---|
| dashboard_uid | Yes | Dashboard UID |
TDQS
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.
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.
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.
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.
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.
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.
grafana_loki_queryA
Queries Grafana Loki for log data. Fetches logs for a specified duration (e.g., '5m', '1h', '2d'), converts relative time to absolute timestamps. Note: Loki queries require at least one non-empty matcher. Use patterns like '{job=".+"}' instead of '{job=".*"}' or '{}' to avoid syntax errors.
| Name | Required | Description | Default |
|---|---|---|---|
| datasource_uid | Yes | Loki datasource UID | |
| query | Yes | Loki query string (e.g., '{job=~".+"}' or '{app="myapp"}') | |
| duration | No | Time duration (e.g., '5m', '1h', '2d') - overrides start_time/end_time if provided | |
| start_time | No | Start time in RFC3339 or relative string (e.g., 'now-2h', '2023-01-01T00:00:00Z') | |
| end_time | No | End time in RFC3339 or relative string (e.g., 'now-2h', '2023-01-01T00:00:00Z') | |
| limit | No | Maximum number of log entries to return |
TDQS
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 effectively describes key behavioral traits: the tool converts relative time to absolute timestamps, enforces query syntax requirements, and provides examples to avoid errors. However, it doesn't mention rate limits, authentication needs, or pagination behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured in three sentences: purpose statement, behavioral detail, and critical usage note. Every sentence earns its place by providing essential information without redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a query tool with no annotations and no output schema, the description provides strong contextual completeness: it covers purpose, usage constraints, and behavioral details. The main gap is the lack of information about return format or error handling, which would be helpful given the absence of an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 all parameters thoroughly. The description adds minimal parameter semantics beyond the schemaāit mentions duration examples and query patterns, but doesn't provide additional meaning for parameters like datasource_uid or limit. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('queries', 'fetches') and resources ('Grafana Loki', 'log data'), and distinguishes it from sibling tools by focusing on Loki querying rather than dashboard operations or PromQL queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: it specifies when to use this tool (for querying Loki log data), includes a critical constraint ('requires at least one non-empty matcher'), and offers concrete alternatives to avoid syntax errors (e.g., '{job=~".+"}' instead of '{job=~".*"}').
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_promql_queryC
Executes PromQL queries against Grafana's Prometheus datasource. Fetches metrics data using PromQL expressions, optimizes time series responses to reduce token size.
| Name | Required | Description | Default |
|---|---|---|---|
| datasource_uid | Yes | Prometheus datasource UID | |
| query | Yes | PromQL query string | |
| start_time | No | Start time in RFC3339 or relative string (e.g., 'now-2h', '2023-01-01T00:00:00Z') | |
| end_time | No | End time in RFC3339 or relative string (e.g., 'now-2h', '2023-01-01T00:00:00Z') | |
| duration | No | Duration string for the time window (e.g., '2h', '90m') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions 'optimizes time series responses to reduce token size', which adds some behavioral context about output handling. However, it lacks critical details: whether this is a read-only operation, potential rate limits, authentication requirements, error behaviors, or what the response format looks like (especially with no output schema).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the core purpose in the first sentence. The second sentence adds useful behavioral context about optimization. Both sentences earn their place, though it could be slightly more structured (e.g., separating purpose from behavioral notes).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks guidance on usage versus siblings, doesn't fully cover behavioral aspects (e.g., safety, errors, response format), and provides no parameter semantics beyond the schema. The optimization note is helpful but insufficient for overall completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no parameter-specific information beyond what's in the schemaāit doesn't explain relationships between parameters (e.g., how 'duration' interacts with 'start_time'/'end_time') or provide examples. Baseline 3 is appropriate when the schema does all the work.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: executing PromQL queries against Grafana's Prometheus datasource to fetch metrics data. It specifies the verb 'executes' and resource 'PromQL queries' with the target 'Grafana's Prometheus datasource'. However, it doesn't explicitly differentiate from sibling tools like 'grafana_loki_query' or 'grafana_query_dashboard_panels' beyond mentioning Prometheus specifically.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 doesn't mention sibling tools like 'grafana_loki_query' (for Loki queries) or 'grafana_query_dashboard_panels' (for dashboard panel queries), nor does it specify prerequisites or appropriate contexts for PromQL queries versus other data-fetching tools in the set.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_query_dashboard_panelsA
Executes queries for specific dashboard panels. Can query up to 4 panels at once, supports template variables, optimizes metrics data.
| Name | Required | Description | Default |
|---|---|---|---|
| dashboard_uid | Yes | Dashboard UID | |
| panel_ids | Yes | List of panel IDs to query (max 4) | |
| template_variables | No | Template variables for the dashboard |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses behavioral traits such as batch querying ('up to 4 panels at once'), support for template variables, and optimization for metrics data. However, it lacks details on permissions, rate limits, error handling, or what 'optimizes metrics data' entails, leaving gaps in behavioral understanding.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise and front-loaded, consisting of a single sentence that efficiently conveys key information: action, resource, constraints (max 4 panels), and features (template variables, optimization). Every part earns its place without redundancy or waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, nested objects, no output schema) and no annotations, the description is somewhat complete but has gaps. It covers the basic purpose and some behavioral aspects but lacks details on output format, error cases, or integration with sibling tools, making it adequate but not fully comprehensive for an agent to use correctly without trial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, so the schema already documents all parameters well. The description adds minimal value beyond the schema by implying the purpose of parameters (e.g., 'supports template variables' relates to template_variables), but doesn't provide additional syntax, format details, or constraints beyond what's in the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('Executes queries') and resources ('dashboard panels'), and distinguishes it from siblings like grafana_loki_query or grafana_promql_query by specifying it queries dashboard panels. However, it doesn't explicitly differentiate from grafana_get_dashboard_config, which might retrieve configuration rather than query data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by mentioning 'up to 4 panels at once' and 'supports template variables', suggesting it's for querying multiple panels with variables. However, it lacks explicit guidance on when to use this tool versus alternatives like grafana_promql_query for direct queries or grafana_fetch_dashboard_variables for variable retrieval, and no exclusions are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
test_connectionA
Test connection to Grafana API to verify configuration and connectivity. Requires API key or open Grafana instance.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that authentication ('API key or open Grafana instance') is required, which is useful behavioral context. However, it doesn't describe what the tool actually does behaviorally (e.g., makes a test request, returns success/failure, handles errors) or any other traits like rate limits or side effects, leaving gaps in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences that are front-loaded with the core purpose and essential requirement. Every sentence earns its place by providing critical information without redundancy or fluff, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is somewhat complete but lacks details on behavioral aspects. It covers the purpose and authentication need but doesn't explain what the test entails or what to expect in return, which could be helpful for an agent to understand the tool's operation fully.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, which is appropriate here. Baseline is 4 for 0 parameters, as no compensation is needed, and the description doesn't detract from the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Test connection to Grafana API to verify configuration and connectivity.' It specifies the verb ('test connection'), resource ('Grafana API'), and goal ('verify configuration and connectivity'). However, it doesn't explicitly differentiate from sibling tools, which are all data-fetching operations, making this a distinct connectivity check tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by stating 'Requires API key or open Grafana instance,' suggesting it should be used when authentication or connectivity needs verification. However, it doesn't provide explicit guidance on when to use this tool versus alternatives (e.g., before invoking other Grafana tools) or any exclusions, leaving usage somewhat inferred rather than clearly defined.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Every tool has a clearly distinct purpose targeting specific Grafana resources or functions. For example, grafana_fetch_all_dashboards retrieves dashboard lists while grafana_fetch_dashboard_variables gets template variables, and grafana_loki_query versus grafana_promql_query handle different query types. There is no overlap that would cause agent misselection.
All tools follow a consistent snake_case pattern with 'grafana_' prefix and descriptive verb_noun combinations. The naming convention is perfectly predictable: grafana_fetch_*, grafana_get_*, grafana_query_*, and grafana_*_query patterns are used appropriately throughout the set.
With 10 tools, this server is well-scoped for Grafana operations. Each tool earns its place by covering distinct aspects: dashboard management, data source access, query execution, and connectivity testing. This count provides comprehensive coverage without being overwhelming.
The toolset provides excellent coverage for querying, fetching, and testing Grafana resources. Minor gaps exist in dashboard lifecycle management (no create/update/delete operations for dashboards or folders), but agents can work effectively with the read-oriented operations provided for the core Grafana use cases.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The Grafbase MCP server sits in front of a GraphQL API and exposes an MCP protocol-compliant interface that allows AI agents and LLMs to explore and query GraphQL APIs using natural language. It provides tools to search schemas, introspect types and fields, and execute GraphQL queries while minimizing context bloat by returning only relevant schema subsets, with built-in support for authentication, authorization, and configurable access control.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to interact with Signoz observability platform, providing tools to query dashboards, metrics, traces, logs, and APM data with time range support.14MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to query databases, execute SQL, and manage Metabase resources like dashboards, cards, and collections through natural language.22MIT
- AlicenseAqualityDmaintenanceA MCP server for Metabase that gives AI assistants direct access to dashboards, cards, and query execution.331MIT
- FlicenseNot gradedqualityFmaintenanceAn MCP server that enables AI assistants to query and analyze logs from Grafana Loki using LogQL, supporting label discovery and keyword search.4
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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