Skip to main content
Glama

query_grafana

Read-only

Run a unified Grafana data-source query (POST /api/ds/query) on the tenant's Grafana connection — PromQL/Loki/SQL etc. via a data source. Required: queries (array of Grafana query objects, each with a datasource). Optional: from, to.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "queries": "<queries>"
    },
    "name": "query_grafana"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd of the query time range
fromNoStart of the query time range
queriesYesGrafana query objects, each with a datasource

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / from / description
      Added value: +"Start of the query time range"
    • addedInput schema / properties / queries / description
      Added value: +"Grafana query objects, each with a datasource"
    • addedInput schema / properties / to / description
      Added value: +"End of the query time range"
  2. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety and openness profile is covered. The description adds useful context by naming the concrete endpoint, the tenant-scoped connection, and the supported query languages, but says nothing about result shape, error behavior, or what happens on a failing datasource reference.

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?

Two compact sentences with the capability front-loaded before the parameter recap. The parameter recap is near-redundant with the schema, which slightly dilutes an otherwise tight definition.

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?

There is no output schema, so the description is the only place return behavior could be described, and it is silent on what comes back (frames, series, error payloads). For a moderately complex query tool with open-world behavior, that leaves a meaningful hole despite otherwise adequate coverage.

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 all three parameters are already documented in the schema, including that each query object carries a datasource. The description's parameter sentence ('Required: queries ... Optional: from, to') simply restates that, adding no format, accepted dialect, or timestamp-syntax detail 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 gives a specific verb and resource ('Run a unified Grafana data-source query') plus the underlying endpoint (POST /api/ds/query) and the query dialects it covers (PromQL/Loki/SQL), which lets an agent distinguish a structured data-source query from a raw request. It stops short of naming sibling alternatives such as grafana_request, so differentiation is only implicit.

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?

The remainder of the description is a restatement of the input schema's required/optional fields rather than guidance on when to use this tool. With a sibling like grafana_request that could plausibly reach the same endpoint, the absence of any when-to-use or when-not-to-use rule is a real gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.