Skip to main content
Glama

find_in_files

Search file contents for a regex pattern across a directory tree. Returns matching lines with file and line references to find code elements.

Instructions

Search file contents for a regex pattern across a directory tree (like grep -rn). Returns matching lines with file:line references (max 60 results). Use this to find function definitions, imports, error messages, or any text in a codebase. pattern: a regular expression (e.g. "def train", "import pandas", "TODO") directory: root directory to search from file_glob: filter by filename pattern, e.g. ".py", ".ts", ".json", "" for all files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYes
directoryYes
file_globNo*.py

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are present, so the description carries full burden. It discloses the search method (regex), output format (file:line references), and a 60-result cap. It could mention handling of binary files or hidden directories, but the given details are adequate for understanding core behavior.

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 efficient: three sentences explain the purpose and usage, followed by parameter descriptions. It is front-loaded with the core action and uses bullet-like formatting for clarity. Every sentence adds value without redundancy.

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 tool's moderate complexity and presence of an output schema, the description covers essential aspects: what it does, how to use it (including examples), parameter explanations, and result limits. It is complete enough for an agent to invoke correctly.

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

Parameters5/5

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

Schema description coverage is 0%, yet the description explains each parameter: pattern with regex examples, directory as root search location, and file_glob with filename patterns and default. This adds significant meaning beyond the schema's titles and default values.

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 searches file contents using a regex pattern across a directory, analogous to grep -rn. It specifies the output format (matching lines with file:line references) and a limit of 60 results. This distinguishes it from sibling tools like list_directory or read_file.

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 explicitly suggests use cases: finding function definitions, imports, error messages, or any text in a codebase. This provides clear context for when to use the tool. It does not explicitly state when not to use it, but the guidance is sufficient among siblings.

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/ahmad-zurih/ds-mcp-server'

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