Skip to main content
Glama

Search Files

file_search
Read-only

Search a directory tree for files and folders by glob name pattern or content regex; optionally use Spotlight (mdfind) for faster results.

Instructions

Recursively search a directory for files/directories matching a glob name pattern (*/? wildcards) and/or a content regex (text files only, size-capped). Set useMdfind:true to accelerate via Spotlight (mdfind -onlyin, requires an mdfindQuery) instead of walking the tree. Path is checked against MACCTL_ALLOWED_PATHS/MACCTL_DENIED_PATHS. Results are capped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRoot directory to search.
maxDepthNoDefaults to 10.
useMdfindNoUse `mdfind -onlyin <path> <mdfindQuery>` instead of a manual walk.
maxResultsNoDefaults to 200.
mdfindQueryNoRequired when useMdfind is true, e.g. "kMDItemFSName == '*.pdf'".
namePatternNoGlob pattern against entry names, e.g. "*.ts".
contentPatternNoA regular expression tested against file contents (utf8, size-capped).
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds useful behavioral context: path is checked against MACCTL_ALLOWED_PATHS/MACCTL_DENIED_PATHS, content search is size-capped, and results are capped. This goes beyond the 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?

The description is three sentences, each carrying distinct information: core search functionality, mdfind acceleration path, and path validation/caps. It is front-loaded and concise with no wasted words.

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?

For a tool with 7 parameters and no output schema, the description provides substantial context: explains both search modes, the mdfindQuery requirement, path restrictions, and result caps. However, it does not describe the return format (e.g., list of paths), which would be useful given no output schema.

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 coverage is 100%, so the baseline is 3. The description reinforces parameter meaning (e.g., mdfindQuery required when useMdfind is true) but does not add significant new detail beyond the schema. The schema already documents defaults and examples.

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 recursively searches a directory for files/directories matching a glob pattern and/or content regex. It specifies the unique features (useMdfind, content regex) that distinguish it from sibling tools like file_list or file_read.

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 gives clear context for when to use the tool (searching by name/content) and provides guidance on using useMdfind to accelerate search via Spotlight. It does not explicitly name alternative tools or exclusion criteria, but the purpose is self-evident.

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/sitharaj88/macctl'

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