Skip to main content
Glama
yunusemregul

Kibana Bridge MCP

by yunusemregul

get_log_context

Retrieve log entries around a specific timestamp to inspect events before and after a suspicious error or state change. Scope by trace ID, pod, or service.

Instructions

Returns the log entries within a time window around a specific timestamp. Use this when you've found a suspicious entry (an error, a state change, etc.) and need to see what happened immediately before and after (the human equivalent of clicking 'view surrounding documents' in Kibana/Discover).

Default window is ±60 seconds (so 120s total). Narrow it with window_seconds for noisy services, widen for sparse logs.

Use trace_id (filters on logs.contextMap.traceId, TRACE_ID_FIELD env) or include_filters to scope to the same trace, pod, or service. Otherwise you'll see ALL traffic in the window, which is often too much.

Pass query only if you also want to constrain by a search term in the window; usually leave it empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoMax hits in window (must be ≥ 1). Default 200.
levelNoFilter on the level field (LEVEL_FIELD env, default logs.level; currently `logs.level`), e.g. 'ERROR' or ['ERROR','WARN']. Prefer this over putting ERROR in query, which also matches INFO messages containing the word error.
queryNoOptional text search applied within the window. Leave empty to see ALL logs around the timestamp (most common usage). An empty string or '*' matches all documents. The text is matched against these fields: message, logs.message, msg, log, logs.loggerName, logs.thread, logs.thrown.name, logs.thrown.message, logs.request, logs.requestFirstLine (override with the QUERY_FIELDS env var).
trace_idNoScope the window to one trace: adds an include filter on `logs.contextMap.traceId` (override the field with the TRACE_ID_FIELD env var).
query_dslNoRaw OpenSearch/Elasticsearch query DSL clause, AND-ed into the bool filter alongside `query` and the time range. Use for anything the plain text query can't express: numeric ranges ({range: {status: {gte: 500}}}), wildcards ({wildcard: {'url.keyword': '/api/*'}}), OR logic ({bool: {should: [...], minimum_should_match: 1}}), exists checks, etc.
timestampYesThe pivot ISO 8601 timestamp (e.g. '2026-05-06T06:49:57.647Z'). Take this from a previous search hit's @timestamp.
environmentNoWhich dashboard environment to search, as configured in the extension popup. The extension has not reported any environments yet, so omit this unless the user names one.
full_messageNo
display_fieldsNoSame fallback chain as search_logs.
window_secondsNoHalf-window size in seconds. Default 60 (so total span = ±60s = 120s).
exclude_filtersNo
include_filtersNoHighly recommended: scope by traceId, pod_name, or service to avoid drowning in unrelated traffic.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations, so the description carries the full burden. It discloses the default window (±60s total 120s), the scoping default (all traffic unless filtered), and a real pitfall (putting ERROR in query also matches INFO messages containing the word). It does not state read-only status or the query cost of a wide window, leaving a small gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then progressively refines tuning and scoping advice. Four short paragraphs, each earning its place, though the default-window value is stated twice (once in prose, once implicitly via window_seconds) and the parenthetical about the 120s total is slightly redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, nested-object tool with no output schema, the description covers the operationally critical parameters (timestamp, window_seconds, trace_id, include_filters, query, level) well. It leaves full_message and display_fields (answered only by a cross-reference to search_logs) largely unexplained, which is a modest gap given the high schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 83%, so the baseline is 3. The description adds genuine semantics beyond the schema: window_seconds is a half-window (±60s), trace_id overrides a configurable field, query should usually be empty, and include_filters is 'highly recommended' to avoid drowning in unrelated traffic.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (returns) and resource (log entries in a time window around a timestamp), and the Kibana 'view surrounding documents' analogy pins down the exact behavior. The framing 'when you've found a suspicious entry... see what happened immediately before and after' distinguishes it from sibling search_logs (broad search) and inspect_log (single-entry detail).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit about when to use it, how to tune the window (narrow for noisy services, widen for sparse logs), how to scope via trace_id or include_filters, and the consequence of not scoping ('you'll see ALL traffic in the window, which is often too much'). It even advises when to leave query empty.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.