Skip to main content
Glama
LogLens
by Suteerth03

Search Logs

search_logs

Find matching lines in a loaded log file by keyword or phrase, returning surrounding context and line IDs for deeper error inspection.

Instructions

Search the loaded log file for lines matching a keyword or phrase. Returns matching lines with surrounding context and a line id you can pass to get_error_context for a wider view.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
queryYesKeyword or phrase to search for, e.g. 'OutOfMemoryError' or 'timeout'
contextSizeNoLines of context before/after each match (default 2)
caseSensitiveNoCase-sensitive search (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the return shape (matching lines plus surrounding context and a line id), which is valuable given there is no output schema. However, it says nothing about how a file becomes "loaded," whether matches are capped, or what happens on a failed search — gaps for a zero-annotation tool.

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?

Two tight sentences with no filler, and the core action is front-loaded ahead of the return-value note. Efficient overall, though the second sentence mixes return description with navigation advice.

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?

A simple three-parameter read tool with full schema coverage and a description that covers both action and returns. The only real omission is the prerequisite of having a log file loaded and any limit on result volume — minor for this complexity level.

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

Parameters3/5

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

Schema description coverage is 100%, so query, contextSize, and caseSensitive are already documented with defaults and bounds. The description's mention of "keyword or phrase" and "surrounding context" only echoes the schema without adding format or syntax guidance, so baseline 3 applies.

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 the loaded log file for lines matching a keyword or phrase." The scope qualifier "loaded" is useful, but the description does not differentiate it from summarize_incident; it only routes downstream to get_error_context, which is a follow-up, not an alternative search path.

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

Usage Guidelines4/5

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

Gives a clear workflow: search first, then pass the returned line id to get_error_context for a wider view. That implicitly tells the agent when to move on. It does not state any exclusions or when to prefer summarize_incident instead, so it stops short of full when/when-not guidance.

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

Deploy Server

Other Tools