Skip to main content
Glama

search_text_in_files

Recursively regex-search text files under a directory using scoped grep, confined to the workspace. Filter by file glob and limit results to find patterns quickly.

Instructions

Recursively regex-search text files under a directory (like a scoped grep), confined to the workspace.

Args: path: Directory to search under, relative to the workspace root. pattern: Python regular expression to search each line for. file_glob: Glob to filter which files are searched, e.g. "*.py". max_results: Maximum number of matching lines to return (1-500).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo.
patternNo
file_globNo*
max_resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/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 behavioral burden. It discloses the recursive/workspace-confined scope and the max_results cap, which is useful. However, it does not state the return format (matching lines with file/line context?), pagination/truncation behavior, error handling, or performance characteristics — gaps for a search tool with no annotation coverage.

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 one-sentence summary followed by a compact Args block. The 'like a scoped grep' analogy earns its place; the line 'Args:' is conventional. No wasted sentences, though the format is list-heavy rather than prose-optimized.

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 4-param search tool with 0% schema coverage and no annotations, the description covers purpose, scope, and all parameters well. It lacks return-value/pagination detail, but since there is no output schema and no annotations, that gap is minor given how much it already explains.

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 0% and all four params are undocumented in the schema, so the description must compensate. It does so well: path (relative to workspace root), pattern (Python regex per line), file_glob (e.g. '*.py'), max_results (1-500) — each param gets a meaningful explanation including the regex dialect and the range constraint.

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 (regex-search) and resource (text files under a directory), with scope qualifiers ('recursively', 'confined to the workspace') and an analogy ('like a scoped grep'). This clearly distinguishes it from siblings like find_files (which lists files) or read_file (which reads one file).

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 'like a scoped grep' framing implies usage context, but the description never explicitly says when to use this vs. find_files or read_file, nor does it mention exclusions or alternatives. Usage is inferable but not spelled out.

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