Skip to main content
Glama

search_in_files

Search for text or regular expressions in files within a directory. Use file patterns to filter files, with options for case sensitivity and hidden files.

Instructions

Searches for text content within files in a directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
isRegexNoIf true, treat searchText as a regular expression
patternYesFile pattern to match (e.g., '*.swift', '*.{js,ts}')
directoryYesDirectory to search in. Can be absolute, relative to active directory, or use ~ for home directory.
maxResultsNoMaximum number of results to return
searchTextYesText or regular expression to search for within the files
caseSensitiveNoIf true, perform a case-sensitive search
includeHiddenNoIf true, include hidden files in the search
Behavior3/5

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

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It accurately states the core action ('Searches for text content within files'), but it does not disclose important behavior such as whether the search is recursive, how results are formatted, or whether it respects hidden files by default. This is a basic level of transparency, hence a 3.

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 a single, front-loaded sentence that conveys the essential purpose without any unnecessary words. It is appropriately sized for a tool of this simplicity, achieving maximum conciseness.

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?

Given the tool's complexity (7 parameters, no output schema, and siblings like find_files), the description is insufficiently complete. It does not explain the return format, default search behavior (e.g., recursive or not), or how it differs from similar tools. For an agent to use this effectively, more context is needed.

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 the baseline is 3. The description does not add any parameter-specific meaning beyond what the schema already provides. It neither clarifies parameter usage nor offers examples, so it does not exceed the baseline.

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's function: 'Searches for text content within files in a directory.' It uses a specific verb (searches) and resource (text content in files), which distinguishes it from filename-based search tools like find_files. However, it does not explicitly mention this distinction, so it falls short of a perfect 5.

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?

No usage guidance is provided. The description does not mention when to use this tool instead of alternatives like find_files (for filename search) or read_file (for reading individual files). It lacks any contextual clues about appropriate use cases or exclusions.

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/r-huijts/xcode-mcp-server'

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