Skip to main content
Glama
isina-nej
by isina-nej

Search file contents

file_grep
Read-only

Search file contents recursively for a regex pattern, returning matching lines. Use with a root path and pattern to locate specific text across files.

Instructions

Recursively search file contents for a regex pattern. Prefers ripgrep, falls back to grep or pure Python.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
patternYes
max_matchesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description adds value by specifying recursive search behavior and the fallback chain (ripgrep to grep to Python). However, it omits details like output format, error handling, or match limits beyond the default, leaving the agent with incomplete behavioral expectations.

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 concise sentences: the first front-loads the core purpose, the second adds relevant implementation context. No filler words, and each sentence earns its place.

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

Completeness2/5

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

For a tool with three parameters, no schema descriptions, and a large sibling set, the description is too sparse. It lacks parameter semantics for root and max_matches, no usage guidance, and doesn't clarify return value behavior despite having an output schema. An agent would need to infer too much.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It clarifies that pattern is a regex, but leaves root (presumably a directory path) and max_matches (maximum number of matches) unexplained. This is insufficient given zero schema descriptions.

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 recursively searches file contents for a regex pattern, which is a specific verb+resource. However, it does not differentiate from siblings like search_text_tool or fuzzy_find_tool, which also search text, so it lacks explicit sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It only mentions implementation details (ripgrep fallback), not selection criteria or exclusions. An agent would have no basis to choose this over similar search tools.

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