Skip to main content
Glama
tamalkarm

Grafana Context MCP

by tamalkarm

Query a Grafana data source

query_datasource
Read-onlyIdempotent

Run read-only queries against Grafana data sources via the native plugin API. Define query objects with datasource UID and time range to fetch metrics and logs.

Instructions

Run bounded, read-only native plugin queries through Grafana's data source query API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesGrafana /api/ds/query query objects; include refId and datasource.uid
to_timeNoEnd time, e.g. now or epoch millisecondsnow
from_timeNoStart time, e.g. now-1h or epoch millisecondsnow-1h

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description's 'read-only' matches that. It adds 'bounded' and 'native plugin queries' as useful context, but does not disclose details like result limits, pagination, or error behavior. No contradiction with annotations.

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?

A single, tightly-worded sentence that front-loads the core behavior and key constraints. There is no fluff or repetition of schema details.

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?

With a read-only annotation, a rich output schema, and a 100%-described input schema, the description does not need to repeat parameter details. It gives enough context to distinguish the tool from siblings and to signal safety, though a brief note on datasource UID resolution would improve completeness.

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 baseline is 3. The description adds no parameter-specific meaning beyond the schema, which already explains the query objects and time range fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Run') and resource ('native plugin queries through Grafana's data source query API'), clearly distinguishing this from sibling metadata tools like list_datasources or check_datasource_health. It names the exact API pathway and adds 'bounded, read-only' to characterize the operation.

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?

The description implies when to use the tool through 'query' against the data source API, and the sibling names make the distinction obvious. However, it does not explicitly name alternatives, state when not to use it, or mention prerequisites such as resolving a datasource UID first.

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

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/tamalkarm/grafana-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server