Skip to main content
Glama
snickery

loki-tail-mcp

by snickery

loki_detected_fields

Discover log fields Loki auto-extracts from a container, including name, type, cardinality, and parser. Use it to plan LogQL parse stages for accurate queries.

Instructions

Discover the fields Loki can auto-extract from a container's logs (name, type, cardinality, parser — e.g. logfmt/json). Use this before writing a LogQL parse stage in loki_query_range, e.g. finding that a service logs logfmt with a status field enables {container="x"} | logfmt | status>=500.

container: exact container name. minutes: window to sample. Default 60. limit: max fields. Default 20.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
minutesNo
containerYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description must carry the behavioral transparency burden. It does disclose useful behavioral aspects: the tool samples a time window (minutes), returns fields with metadata (name, type, cardinality, parser), and is meant for pre-parse discovery. However, it does not explicitly state that it is a read-only operation or mention potential limitations (e.g., empty results, performance effects). This is adequate but not rich.

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?

The description is compact and well-structured. It opens with a one-sentence purpose, followed by a valuable usage example, then a succinct parameter list. Every sentence adds information without redundancy. The parameter formatting uses clear key: description pairs, making it easy to scan.

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?

Given the tool's simplicity (3 params, output schema present, no annotations), the description is nearly complete. It covers what the tool does, when to use it, how the output feeds into LogQL queries, and explains each parameter. Minor gaps include not stating behavior when no fields are found or prerequisites like the container must have recent logs, but these are not critical for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description compensates well. Each parameter gets a meaningful explanation: 'container: exact container name', 'minutes: window to sample', 'limit: max fields'. It also clarifies defaults (60, 20). The example further demonstrates the container parameter's use in a query. This goes beyond the schema's bare titles and defaults.

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 clearly states the tool's function: 'Discover the fields Loki can auto-extract from a container's logs.' The verb 'Discover' and the specific resource (auto-extracted fields) distinguish it from sibling tools like loki_query_range or loki_list_labels. It also explains the output (name, type, cardinality, parser) and how it relates to creating parse stages.

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

Usage Guidelines4/5

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

The description provides explicit usage context: 'Use this before writing a LogQL parse stage in loki_query_range.' It includes a concrete example showing how to use the discovered fields in a query. However, it does not explicitly mention when not to use it or name alternative tools, though the sibling context and the 'fields' vs 'labels' distinction implicitly guide selection.

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

Install Server

Other Tools

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/snickery/loki-tail-mcp'

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