Skip to main content
Glama
ks6573
by ks6573

grep_files

Read-onlyIdempotent

Search file contents using regex patterns to locate matching lines, file paths, and line numbers. Optionally filter by file glob and include surrounding context for precise results.

Instructions

Search file contents for a regex pattern, like grep/ripgrep. Returns matching lines with file paths and line numbers. Optionally filter by file glob (e.g. '*.py') and include context lines. Skips binary files and .git, node_modules, .venv, pycache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoFile or directory to search in (default: current directory)..
includeNoGlob filter for file names (e.g. '*.py', '*.ts'). Empty = all files.
patternYesRegex pattern to search for (Python re syntax).
max_resultsNoMaximum matching lines to return (1–500, default 50).
context_linesNoLines of context before and after each match (0–10, default 0).
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses important behavioral traits: skips binary files and common exclude directories (.git, node_modules, .venv, __pycache__). It also explains the output format (matching lines with paths and line numbers) and the context-lines option. This adds substantial behavioral context beyond the annotations.

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?

The description is three purposeful sentences: what it does, what it returns, and how it filters/excludes. Every sentence adds value and the most core information comes first. No fluff or repetition.

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

Completeness5/5

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

Given the annotations, a fully descriptive schema, and the absence of an output schema, the description is complete. It explains the search scope, return format, filtering, and skip behavior. Enough for an agent to select and invoke correctly without ambiguity.

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?

The input schema already covers all five parameters with 100% description coverage, including defaults, ranges, and regex syntax. The description adds no extra parameter-specific meaning; it merely restates the glob and context-lines concepts already present in the schema. Per the baseline for high schema coverage, this scores a 3.

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?

The description clearly states the tool 'Search file contents for a regex pattern, like grep/ripgrep', naming the resource (file contents) and the verb (search). It also distinguishes itself from sibling file tools by specifying output (matching lines with file paths and line numbers) and filtering options. This is a specific, non-tautological purpose statement.

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?

The description gives clear context for when to use the tool: searching file contents with regex, optionally filtering by glob and adding context lines. It does not explicitly name alternatives or state when not to use it, but the 'like grep/ripgrep' reference and included options provide strong usage guidance. No explicit exclusions, but the context is sufficient.

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/ks6573/SysControl'

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