Skip to main content
Glama
thhart

Log MCP Server

by thhart

search_log_file

Search a log file using regex patterns, returning matching lines with surrounding context. Supports token-based pagination to fit AI constraints.

Instructions

Searches a log file using regex pattern and returns matching lines with surrounding context. Supports token-based pagination to respect AI context limits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRegex pattern to search for
filenameYesName of the log file to search
max_tokensNoMaximum tokens to return (default: 4000, max: 100000). Uses ~4 chars per token estimation. When specified, overrides max_matches.
max_matchesNoDEPRECATED: Use max_tokens instead. Maximum number of matches to return (max: 500). If specified, overrides max_tokens.
skip_matchesNoNumber of matches to skip (for pagination, default: 0)
context_afterNoNumber of lines to show after each match (max: 10). Overrides context_lines for after-context.
context_linesNoNumber of lines to show before and after each match (default: 2, max: 10). Overridden by context_before/context_after if specified.
case_sensitiveNoWhether the search should be case-sensitive (default: false)
context_beforeNoNumber of lines to show before each match (max: 10). Overrides context_lines for before-context.
Behavior3/5

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

With no annotations, the description carries full burden but only states basic behavior (search, return matches with context, pagination). It does not disclose side effects (e.g., file access permissions), performance, or error handling for missing files or invalid patterns.

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?

Two sentences, both front-loaded with core purpose and a key feature. No wasted words.

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

Completeness3/5

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

Despite 9 parameters and no output schema, the description provides a decent high-level view but omits parameter interdependencies (e.g., max_tokens vs max_matches deprecation). It is adequate but incomplete for a complex tool.

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 coverage is 100% with detailed parameter descriptions. The description adds minimal extra meaning beyond the schema, just mentioning token-based pagination. Baseline 3 is appropriate.

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?

The description clearly states the tool searches a log file with regex and returns matching lines with context, which is specific. However, it does not explicitly differentiate from siblings like 'find_errors' or 'read_log_paginated', though regex search is implied as distinct.

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?

The description mentions token-based pagination for AI context limits, giving a usage hint, but lacks explicit when-to-use or when-not-to-use guidance compared to siblings. No alternatives are named.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thhart/log-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server