Skip to main content
Glama

Grafana MCP Server

by levalhq

query_loki_logs

Execute LogQL queries against Loki datasources to retrieve log entries and metric values within specified time ranges for monitoring and analysis.

Instructions

Executes a LogQL query against a Loki datasource to retrieve log entries or metric values

Input Schema

NameRequiredDescriptionDefault
datasourceUidYesThe UID of the datasource to query
directionNoDirection of the query
endRfc3339NoThe end time of the query in RFC3339 format
limitNoMaximum number of log lines to return (default: 10, max: 100)
logqlYesThe LogQL query to execute against Loki
startRfc3339NoThe start time of the query in RFC3339 format

Input Schema (JSON Schema)

{ "properties": { "datasourceUid": { "description": "The UID of the datasource to query", "type": "string" }, "direction": { "description": "Direction of the query", "enum": [ "forward", "backward" ], "type": "string" }, "endRfc3339": { "description": "The end time of the query in RFC3339 format", "type": "string" }, "limit": { "description": "Maximum number of log lines to return (default: 10, max: 100)", "type": "number" }, "logql": { "description": "The LogQL query to execute against Loki", "type": "string" }, "startRfc3339": { "description": "The start time of the query in RFC3339 format", "type": "string" } }, "required": [ "datasourceUid", "logql" ], "type": "object" }

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

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