Skip to main content
Glama

grafana_query

Run raw datasource queries on a Grafana instance to fetch metrics or logs over a time range; results are datasource-specific, not normalized.

Instructions

Run a raw query against one datasource on a Grafana instance. The response shape is datasource-specific (Prometheus, Loki, SQL, ...); this is a passthrough, not a normalized result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoend of the time range: a Grafana relative unit like now, or epoch milliseconds (default: now)
fromNostart of the time range: a Grafana relative unit like now-1h, or epoch milliseconds (default: now-1h)
queryYesraw query in the datasource's own language, e.g. a PromQL or LogQL expression
instanceYesthe inventory grafana instance name
datasource_uidYesUID of the datasource to query (see its dashboard/settings URL)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
instanceYes
timestampYes
datasource_uidYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose a genuinely non-obvious trait: the response shape is datasource-specific and un-normalized, so callers cannot assume a uniform result. It omits other behavioral context such as read-only semantics, error behavior, or query timeouts/limits, so it falls short of fully covering a raw-query tool.

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?

Two sentences, zero filler. The core action is front-loaded and the caveat about response shape follows immediately, which is the right ordering for an agent skimming for intent.

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

Completeness4/5

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

An output schema exists and the description still usefully warns that the payload is datasource-specific, and 100% parameter coverage means the schema handles inputs. For a tool spanning Prometheus/Loki/SQL it could say more about the datasource types it supports or whether the query is read-only, but what is present is adequate to call it correctly.

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 all five parameters including the from/to time defaults and the datasource UID. The description adds no parameter-level meaning beyond telling the agent the result varies by datasource type, so the baseline 3 applies.

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?

States a specific verb+resource ('Run a raw query against one datasource') and clarifies the scope is a single datasource on a Grafana instance. It does not explicitly contrast itself with sibling tools like grafana_alerts or grafana_dashboards, so an agent must infer the boundary from the word 'raw'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the agent can infer this is for datasource-native queries rather than the specialized Grafana siblings, but there is no explicit when-to-use/when-not statement or named alternative. The 'passthrough' framing hints at intent without spelling out the selection rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.