You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ListLokiLabelNamesParams defines the parameters for listing Loki label names
177
177
typeListLokiLabelNamesParamsstruct {
178
178
DatasourceUIDstring`json:"datasourceUid" jsonschema:"required,description=The UID of the datasource to query"`
179
-
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the time range to filter the results by"`
180
-
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the time range to filter the results by"`
179
+
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)"`
180
+
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the query in RFC3339 format (defaults to now)"`
181
181
}
182
182
183
183
// listLokiLabelNames lists all label names in a Loki datasource
// ListLokiLabelNames is a tool for listing Loki label names
203
203
varListLokiLabelNames=mcpgrafana.MustTool(
204
204
"list_loki_label_names",
205
-
"List the label names in a Loki datasource",
205
+
"List all available label names in a Loki datasource for the given time range. Returns the set of unique label keys found in the logs.",
206
206
listLokiLabelNames,
207
207
)
208
208
209
209
// ListLokiLabelValuesParams defines the parameters for listing Loki label values
210
210
typeListLokiLabelValuesParamsstruct {
211
211
DatasourceUIDstring`json:"datasourceUid" jsonschema:"required,description=The UID of the datasource to query"`
212
-
LabelNamestring`json:"labelName" jsonschema:"required,description=The name of the label to query"`
213
-
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the query"`
214
-
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the query"`
212
+
LabelNamestring`json:"labelName" jsonschema:"required,description=The name of the label to retrieve values for (e.g. 'app', 'env', 'pod')"`
213
+
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)"`
214
+
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the query in RFC3339 format (defaults to now)"`
215
215
}
216
216
217
217
// listLokiLabelValues lists all values for a specific label in a Loki datasource
// QueryLokiLogsParams defines the parameters for querying Loki logs
335
335
typeQueryLokiLogsParamsstruct {
336
336
DatasourceUIDstring`json:"datasourceUid" jsonschema:"required,description=The UID of the datasource to query"`
337
-
LogQLstring`json:"logql" jsonschema:"required,description=The LogQL query to execute"`
337
+
LogQLstring`json:"logql" jsonschema:"required,description=The LogQL query to execute against Loki. This can be a simple label matcher or a complex query with filters, parsers, and expressions. Supports full LogQL syntax including label matchers, filter operators, pattern expressions, and pipeline operations."`
338
338
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the query in RFC3339 format"`
339
339
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the query in RFC3339 format"`
340
340
Limitint`json:"limit,omitempty" jsonschema:"description=Optionally, the maximum number of log lines to return (default: 10, max: 100)"`
341
-
Directionstring`json:"direction,omitempty" jsonschema:"description=Optionally, the direction of the query: 'forward' or 'backward'"`
341
+
Directionstring`json:"direction,omitempty" jsonschema:"description=Optionally, the direction of the query: 'forward' (oldest first) or 'backward' (newest first, default)"`
342
342
}
343
343
344
344
// LogEntry represents a single log entry with metadata
// QueryLokiLogs is a tool for querying logs from Loki
415
415
varQueryLokiLogs=mcpgrafana.MustTool(
416
416
"query_loki_logs",
417
-
"Query logs from a Loki datasource using LogQL",
417
+
"Query and retrieve log entries from a Loki datasource using LogQL. Returns log lines with timestamps and labels. Use query_loki_stats first to check stream size, then list_loki_label_names/values to verify labels exist. Supports full LogQL syntax including filters and expressions.",
// QueryLokiStatsParams defines the parameters for querying Loki stats
446
446
typeQueryLokiStatsParamsstruct {
447
447
DatasourceUIDstring`json:"datasourceUid" jsonschema:"required,description=The UID of the datasource to query"`
448
-
LogQLstring`json:"logql" jsonschema:"required,description=The LogQL query to execute"`
448
+
LogQLstring`json:"logql" jsonschema:"required,description=The LogQL matcher expression to execute. This parameter only accepts label matcher expressions and does not support full LogQL queries. Line filters, pattern operations, and metric aggregations are not supported by the stats API endpoint. Only simple label selectors can be used here."`
449
449
StartRFC3339string`json:"startRfc3339,omitempty" jsonschema:"description=Optionally, the start time of the query in RFC3339 format"`
450
450
EndRFC3339string`json:"endRfc3339,omitempty" jsonschema:"description=Optionally, the end time of the query in RFC3339 format"`
0 commit comments