Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/guides/run-a-dashboard-panel-query.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/guides/run-a-dashboard-panel-query/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Run a dashboard panel query
Use the Grafana MCP server to run a dashboard panel’s query (the same query the panel uses) with a custom time range and variable overrides. This is useful when you want the assistant to “run what this panel runs” without writing PromQL or LogQL yourself.
What you’ll achieve
You point the assistant at a dashboard and panel; the assistant uses the server’s run-panel-query tool to execute that panel’s query and return the result (or an error if the query or datasource is invalid).
Before you begin
- The server set up and configured with access to Grafana.
- The run-panel-query tool must be enabled (it’s disabled by default). Add runpanelquery to Enable and disable tools.
- The service account must have
dashboards:readanddatasources:querywith scope for the dashboard and the datasource the panel uses.
Run the panel query
Ask the assistant to run the query for a specific panel on a dashboard. Provide (or let the assistant look up) the dashboard UID and panel ID. You can specify a time range (for example, last 1 hour) and variable overrides so the query runs with the same logic as the panel but with your chosen parameters. The assistant calls the server’s run-panel-query tool and returns the result.
Next steps
- Query metrics with Prometheus or Query logs with Loki to run custom PromQL or LogQL.
- Search and inspect dashboards to find panel IDs and datasources.
Was this page helpful?
Related resources from Grafana Labs


