OpenSearch Dashboards logs

v0.2.0
io.github.mbaracz/mcp-opensearch-dashboards Checked 18 hours ago Published 16 hours ago

Search logs in OpenSearch Dashboards and follow one trace across Kubernetes namespaces and apps.

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

list_sources List log sources

List the configured log sources (OpenSearch Dashboards instances).

list_index_patterns List index patterns

List the index patterns of a source. Use one as index_pattern in search_logs and get_trace.

ParameterTypeDescription
source *stringSource name from list_sources.

list_fields List fields

Field names and types of an index pattern, for writing a search_logs query. line_fields says which field holds the level, namespace, app, pod, message and trace id that the other tools return.

ParameterTypeDescription
index_pattern *stringIndex pattern from list_index_patterns, e.g. "logs-*".
source *stringSource name from list_sources.
containsstringOnly fields whose name contains this text, e.g. "kubernetes".

search_logs Search logs

Search log lines, newest first. Needs a query, a time range (from / to), or both. Returns the lines (time, level, namespace, app, pod, message, trace and span ids), the number of matches and next_cursor for the next, older page.

ParameterTypeDescription
index_pattern *stringIndex pattern from list_index_patterns, e.g. "logs-*".
source *stringSource name from list_sources.
cursorstringnext_cursor of the previous result. Keep the other arguments as they were.
fromstringStart of the time range, as ISO 8601 (2026-11-25T10:00:00Z) or date math (now-1h).
include_sourcebooleanInclude the full raw document of each line (much larger output).
limitintegerLines to return (default 100, max 1000).
querystringLucene query_string, e.g. `timeout` or `log.level:ERROR AND kubernetes.namespace_name:payments`. Write AND, OR and NOT in upper case, in lower case they are search words. Field names differ between cl…
tostringEnd of the time range, same formats. Open-ended when omitted.

get_trace Get a trace

Log lines of one trace, oldest first, grouped by Kubernetes namespace and app, with line and error counts per app and the call flow (the order in which apps appear). A long trace comes in pages: the counts and the flow of each result cover only the lines in that result.

ParameterTypeDescription
index_pattern *stringIndex pattern from list_index_patterns, e.g. "logs-*".
source *stringSource name from list_sources.
trace_id *stringTrace id, as in the trace_id of a log line.
cursorstringnext_cursor of the previous result. Keep the other arguments as they were.
fromstringOptional start of a time range to narrow the lookup (ISO 8601 or date math).
limitintegerLines to return (default 200, max 1000).
tostringEnd of the time range, same formats. Open-ended when omitted.