Skip to main content
Glama

Loki MCP Server

by ghrud92
MIT License
26
4
  • Linux
  • Apple

query_loki

Query and analyze Grafana Loki logs using LogQL with specified time ranges, output formats, and result limits. Extract structured log data for troubleshooting and monitoring purposes via the Loki MCP Server.

Input Schema

NameRequiredDescriptionDefault
batchNoBatch size for query results
forwardNoDisplay results in chronological order
fromNoStart timestamp in UTC (e.g. '2023-01-01T12:00:00Z'). Relative time expressions like '1h ago' are not supported. Use ISO 8601 format.
limitNoMaximum number of logs to return. Maximum value is 1000
outputNoOutput format - valid values are 'default' (formatted log lines), 'raw' (unprocessed log lines), or 'jsonl' (JSON Lines format). Note: values like 'text' or 'json' are not supported.
queryYesLoki query string
quietNoSuppress query metadata
toNoEnd timestamp in UTC (e.g. '2023-01-01T13:00:00Z'). Relative time expressions like 'now' are not supported. Use ISO 8601 format.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "batch": { "description": "Batch size for query results", "type": "number" }, "forward": { "description": "Display results in chronological order", "type": "boolean" }, "from": { "description": "Start timestamp in UTC (e.g. '2023-01-01T12:00:00Z'). Relative time expressions like '1h ago' are not supported. Use ISO 8601 format.", "type": "string" }, "limit": { "description": "Maximum number of logs to return. Maximum value is 1000", "type": "number" }, "output": { "description": "Output format - valid values are 'default' (formatted log lines), 'raw' (unprocessed log lines), or 'jsonl' (JSON Lines format). Note: values like 'text' or 'json' are not supported.", "enum": [ "default", "raw", "jsonl" ], "type": "string" }, "query": { "description": "Loki query string", "type": "string" }, "quiet": { "description": "Suppress query metadata", "type": "boolean" }, "to": { "description": "End timestamp in UTC (e.g. '2023-01-01T13:00:00Z'). Relative time expressions like 'now' are not supported. Use ISO 8601 format.", "type": "string" } }, "required": [ "query" ], "type": "object" }

Other Tools from Loki MCP Server

Related Tools

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

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