Skip to main content
Glama

search_files

Search local files for a regex pattern, optionally filtered by file type or directory; uses ripgrep when available and grep as fallback.

Instructions

Search for a pattern in files. Uses ripgrep if available, falls back to grep.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoFile type filter (e.g. *.ts)
pathNoDirectory to search (default: home)
patternYesRegex pattern to search for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, yet it only discloses the implementation fallback (ripgrep vs grep). It says nothing about whether the operation is read-only, whether the search is recursive, how results or errors are returned, or how many matches are returned. The ripgrep/grep note is genuinely useful (regex dialect and performance differ between them) but is the only behavioral detail offered.

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 short sentences with zero filler, and the core purpose is front-loaded before the implementation detail.

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?

For a search tool with no annotations and no output schema, the description is minimally adequate: an agent knows it searches for a regex in files but not what a result looks like, whether the search recurses, or how matches are limited. The 100% schema coverage offsets some of this, but the return contract remains undocumented.

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 all three parameters (glob, path, pattern) are already documented in the schema with examples. The description adds no additional meaning such as default path behavior or regex syntax, so the baseline of 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?

The description gives a specific verb and resource ('Search for a pattern in files'), which clearly separates it from read_file and list_files. It stops short of explicitly naming those siblings as alternatives, so it is clear but not fully differentiated.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus list_files, read_file, or run_command for ad-hoc searching, and no preconditions or exclusions are stated. The usage is only implied by the verb 'search'.

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