Skip to main content
Glama

search_files

Read-only

Recursively find files matching glob patterns and return their full paths. Supports .gitignore, exclusion patterns, and sorting by name, modification time, or size.

Instructions

Recursively search for files matching a glob pattern (*.ext at any depth, /*.ext, several ** and {a,b} alternatives allowed). Returns full paths. Skips .gitignore'd files (respectGitignore=false to include). Parameters: path (required), pattern (required), excludePatterns, maxResults (default 10000), sortBy, reverse. sortBy: "name" (default, lexical), "mtime" (newest first) or "size" (largest first); reverse flips the order. Unlike the built-in Glob there is no mtime default — pass sortBy "mtime" for newest first. With mtime or size the whole tree is ranked before the cap, so a truncated result really is the newest/largest maxResults files. Example: {"path": "D:\proj", "pattern": "/*.pas", "sortBy": "mtime"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
sortByNo
patternYes
reverseNo
maxResultsNo
excludePatternsNo
respectGitignoreNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
truncatedNo
Behavior4/5

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

Annotations already mark the tool as readOnlyHint, lowering the bar. The description adds meaningful behavioral detail: skips .gitignore'd files unless respectGitignore=false, sorts lexically by name by default, and ranks the whole tree before trimming to maxResults for mtime/size sorts. No contradiction with annotations.

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?

The description is dense but every sentence contributes value, from the core purpose to sorting rules and an example. The parameter list is a bit run-on, yet the overall length is justified by the tool's complexity. Minor structural improvements would earn a 5.

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?

The output schema exists, so return values need no description. The description covers search semantics, sort options, gitignore behavior, and result capping, which is largely sufficient. The lack of excludePatterns explanation is the main gap, making it complete but not flawless.

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?

With 0% schema description coverage, the description must explain parameters. It thoroughly covers sortBy options, reverse, maxResults behavior, and respectGitignore, and shows path/pattern via example. Only excludePatterns is left with no semantic detail, preventing a 5.

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 begins with a clear verb and resource: 'Recursively search for files matching a glob pattern,' and expands with specifics about supported patterns and output (full paths). It also distinguishes itself from the built-in Glob by noting the missing mtime default, which differentiates it from sibling file tools.

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?

Usage context is provided via the contrast with the built-in Glob and the explanation of sortBy behavior (e.g., no mtime default, pass sortBy for newest first). However, it does not explicitly state when to prefer this over siblings like list_directory or tree, so it misses the top score.

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/dimitar-grigorov/mcp-file-tools'

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