Skip to main content
Glama
Grafana MCP Server

Grafana MCP Server

by alludium

search_logs

Search Grafana Loki logs with LogQL queries and a chosen time range to find matching entries; limit results and return Markdown or JSON.

Instructions

Search Grafana Loki logs using LogQL query language. Returns log entries matching the query within the specified time range.

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": {
      "query": "<query>"
    },
    "name": "search_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
hoursNoHours to search back from now (default: 1)
limitNoMaximum number of log lines to return (default: 100)
queryYesLogQL query string (e.g., '{app="web"} |= "error"')
response_formatNoResponse format (default: markdown)markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and largely drops it. It notes the result set is bounded by the time range, but says nothing about authentication needs, rate limits or backend throttling, behavior on malformed LogQL, truncation when results exceed the limit, or ordering of returned lines.

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 short sentences with no filler, and the core action is front-loaded. The second sentence ('within the specified time range') only marginally restates what the 'hours' parameter already conveys, so it is not perfectly waste-free.

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?

The schema is fully documented and there is no output schema, so parameter-level completeness is fine. However, with zero annotations the description should do more for an unannotated search tool — auth assumptions, error behavior, and what happens when the limit is hit are all unaddressed.

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 four parameters (query, hours, limit, response_format) are already documented with defaults in the schema. The description adds no parameter-level meaning beyond it, 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 and resource ('Search Grafana Loki logs') and names the query language (LogQL), which pins down exactly what the tool does. No sibling tools exist, so there is nothing to differentiate against, keeping it just short of a 5.

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 description says what the tool does but never when to use it, when not to, or what prerequisites exist (Loki connection/auth, valid LogQL syntax). An agent gets no routing or eligibility guidance beyond the tool's own name.

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

Deploy Server

Other Tools