Skip to main content
Glama

Search logs

search_logs
Read-onlyIdempotent

Search Graylog log messages with a Lucene query and return compact, redacted lines with message refs for follow-up lookup. Defaults to the last 15 minutes.

Instructions

Search log messages with a Lucene query. Returns compact, redacted lines with a 'ref' (index/id) usable by get_message. Default range: last 15 minutes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNo'timestamp:desc' (default), 'asc', or '<field>:asc|desc'timestamp:desc
limitNoMessages to fetch (capped by config)
queryNoLucene query, '*' for everything*
rangeNoRelative range ending now or at to_time: '15m', '2h', '1d'
fieldsNoFields to return; default timestamp/source/level/message, ['*'] for all
offsetNoSkip this many messages (use next_offset)
streamsNoStream titles or ids; default the repository's focus, else all. ['*'] for everything
to_timeNoAbsolute end; default now
instanceNoInstance from describe, e.g. 'payment/prod'; the default when omitted
from_timeNoAbsolute start, overrides range: ISO 8601 or 'YYYY-MM-DD HH:MM'
dedup_linesNoGroup lines that only differ in numbers/ids/timestamps (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.1
    • changedInput schema / properties / instance / description
      Previous value: -"Instance from list_instances, e.g. 'payment/prod'; the default when omitted"New value: +"Instance from describe, e.g. 'payment/prod'; the default when omitted"
  2. Changed5 schema fields changedv0.2.0
    • changedInput schema / properties / from_time / description
      Previous value: -"Absolute start: ISO 8601 or 'YYYY-MM-DD HH:MM' in the instance timezone; overrides range"New value: +"Absolute start, overrides range: ISO 8601 or 'YYYY-MM-DD HH:MM'"
    • changedInput schema / properties / instance / description
      Previous value: -"Graylog instance (environment) from list_instances, e.g. 'staging' or 'prod'; the default instance when omitted"New value: +"Instance from list_instances, e.g. 'payment/prod'; the default when omitted"
    • changedInput schema / properties / range / description
      Previous value: -"Relative range ending now (or at to_time): '15m', '2h', '1d', '1h30m'"New value: +"Relative range ending now or at to_time: '15m', '2h', '1d'"
    • changedInput schema / properties / streams / description
      Previous value: -"Stream titles or ids to search in; all streams when omitted"New value: +"Stream titles or ids; default the repository's focus, else all. ['*'] for everything"
    • changedInput schema / properties / to_time / description
      Previous value: -"Absolute end, same formats as from_time; default now"New value: +"Absolute end; default now"
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and openWorld, so the safety profile is covered. The description contributes beyond that by disclosing output redaction and compactness, the default 15-minute window, and the ref-based retrieval path, all of which affect how results should be interpreted.

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

Conciseness5/5

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

Three short sentences, front-loaded with the action and query language, then the return shape, then the default scope. No filler or restatement of the title.

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?

With 11 optional parameters and no output schema, the description covers the essentials: query syntax, return shape, and default time window. It stops short of describing pagination (offset/limit, next_offset) or dedup_lines behavior, but those are documented in the schema itself.

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 100%, so 3 is the baseline, but the description adds a real fact the schema lacks: the effective default window is the last 15 minutes (the schema's range/from_time/to_time defaults are null). It also flags that returned lines are redacted and compact, which shapes how much of a message the caller should expect.

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

Purpose4/5

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

States a specific verb and resource ('Search log messages with a Lucene query') and adds what comes back ('compact, redacted lines with a ref'). It names the follow-up sibling get_message but does not differentiate itself from aggregate, scan, or compare_periods, which likely also read logs.

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

Usage Guidelines3/5

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

Usage is implied by the 'ref usable by get_message' handoff and the stated default range, which tells an agent this is a discovery step before fetching a full message. There is no explicit when-to-use/when-not guidance against the log-adjacent siblings.

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