mcp-victorialogs

v1.8.0
io.github.VictoriaMetrics-Community/mcp-victorialogs Checked 5 hours ago Published 11 months ago

MCP Server for VictoriaLogs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

documentation

Search documentation resources for the given search query, returning the URIs of the resources that match the search criteria sorted by relevance. This tool can help to get context for any VictoriaLogs related question.

ParameterTypeDescription
query *stringQuery for search (for example, list of keywords)
limitnumberMaximum number of results to return

facets

The most frequent values per each log field seen in the logs returned by the given <query> on the given [<start> ... <end>] time range. This tool uses `/select/logsql/facets` endpoint of VictoriaLogs API.

ParameterTypeDescription
end *stringEnd timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
query *stringLogsQL expression for the query of the logs data
start *stringStart timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
keep_const_fieldsbooleanBy default the facets tool doesn’t return log fields, which contain the same constant value across all the logs matching the given query. Add keep_const_fields=true arg if you need such log fields
limitnumberThe number of values per each log field can be controlled via limit arg.
max_value_lennumberThe facets tool ignores log fields, which contain too long values. The limit on the per-field value length can be controlled via max_value_len arg.
max_values_per_fieldnumberThe facets tool ignores log fields, which contain too big number of unique values, since they can consume a lot of RAM to track. The limit on the number of unique values per each log field can be cont…
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

field_names

Get field names from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every field name. This tool uses `/select/logsql/field_names` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

field_values

Get unique values for the given <fieldName> field from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every field value. This tool uses `/select/logsql/field_values` endpoint of VictoriaLogs API.

ParameterTypeDescription
field *stringField name of for getting field values.
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
limitnumberThe maximum number of returned values.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

flags

List of non-default flags (parameters) of the VictoriaLogs instance. This tools uses `/flags` endpoint of VictoriaLogs API.

hits

The number of matching log entries for the given <query> on the given [<start> ... <end>] time range grouped by <step> buckets. The returned results are sorted by time. This tool uses `/select/logsql/hits` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs data
start *stringStart timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
endstringEnd timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
fieldarrayAdditionally, any number of field=<field_name> args can be passed to /select/logsql/hits for grouping hits buckets by the mentioned <field_name> fields. The grouped fields are put inside 'fields' obje…
fields_limitnumberOptional fields_limit=N query arg can be passed for limiting the number of unique 'fields' groups to return to N. If more than N unique 'fields' groups is found, then top N 'fields' groups with the ma…
stepstringThe step is used to group the log entries by time. For example, 60s means that the log entries counts will be grouped by 1 minute bucket. Default is 1d.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

query

Executes LogsQL query expression to search log entries. This tool uses `/select/logsql/query` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs data
start *stringStart timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
endstringEnd timestamp in RFC3339 format. For example, 2023-10-01T00:00:00Z
limitnumberThe maximum number of log entries, which can be returned in the response
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)
timeoutstringOptional query timeout. For example, timeout=5s. Query is canceled when the timeout is reached.

stats_query

Log stats for the given query at the given timestamp (time) in the format compatible with Prometheus querying API. This tool uses `/select/logsql/stats_query` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression that must contain stats pipe. The calculated stats is converted into metrics with labels from by(...) clause of the | stats by(...) pipe.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)
timestringTime in RFC3339. If it's missing, then it equals to the current time.

stats_query_range

Log stats for the given query on the given [start ... end] time range with the given step interval. The stats is returned in the format compatible with Prometheus querying API. This tool uses `/select/logsql/stats_query_range` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression that must contain stats pipe. The calculated stats is converted into metrics with labels from by(...) clause of the | stats by(...) pipe.
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
stepstringStep interval for returning the stats.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

stream_field_names

Get log stream field names from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every field name.. This tool uses `/select/logsql/stream_field_names` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

stream_field_values

Get unique values for the given <fieldName> field from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every field value. This tool uses `/select/logsql/stream_field_values` endpoint of VictoriaLogs API.

ParameterTypeDescription
field *stringField name of log stream for getting field values.
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

stream_ids

Get _stream_id values for the log streams from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every _stream_id. This tool uses `/select/logsql/stream_ids` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)

streams

Get log streams from results of the given <query> on the given [<start> ... <end>] time range. The response also contains the number of log results per every _stream. This tool uses `/select/logsql/streams` endpoint of VictoriaLogs API.

ParameterTypeDescription
query *stringLogsQL expression for the query of the logs streams
start *stringStart timestamp in RFC3339
endstringEnd timestamp in RFC3339. If <end> is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.
tenantstringName of the tenant for which the data will be displayed (format AccountID:ProjectID)