Skip to main content
Glama

Search files

search_files
Read-onlyIdempotent

Search files in a directory by name glob and content regex, returning matching file paths.

Instructions

Walk an allowed directory. namePattern is a glob (* and **). contentPattern is a JavaScript regex matched per line. Symlinks are not followed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDirectory to search
maxResultsNo
namePatternNoGlob vs relative path or basename
contentFlagsNoRegExp flags; default i
contentPatternNoRegex source matched against each line
Behavior3/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior, so the description adds value by disclosing that symlinks are not followed and that contentPattern matches per line. Yet it omits behavior like recursion depth, how maxResults affects results, or the output format (paths vs. line matches), which are not covered by annotations.

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?

Four concise sentences, each serving a distinct purpose: the scope (walk an allowed directory), the name pattern semantics, the content pattern semantics, and a key behavioral limitation. No fluff, front-loaded with the main action.

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?

The description covers the core search semantics and a safety-related detail, but it leaves critical gaps: no mention of whether the walk is recursive, what the returned results look like (file paths, line numbers, matched content), or how maxResults interacts with results. An agent could call it confidently for intent but may be unsure of the return contract, especially given no output schema exists.

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 80% schema description coverage, the baseline is 3. The description goes beyond the schema for namePattern ('glob (* and **)') and contentPattern ('JavaScript regex matched per line'), clarifying syntax and matching semantics that the schema leaves vague. This meaningfully aids correct invocation.

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 states the resource (an allowed directory) and the action (walk) plus the two patterns that define a search. It's clear this tool filters files by name glob and content regex, distinguishing it from list_directory and read_file, though it doesn't explicitly say 'search' or 'find'.

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

Usage Guidelines3/5

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

The purpose implies usage: use when you need to find files by name or content in a directory. However, there's no explicit guidance on when to prefer this over list_directory for inert listing or read_file for specific file access, nor any mention of alternatives or exclusions. The agent must infer the appropriate context.

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/jameymcelveen/desktop-bridge'

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