Skip to main content
Glama

search_files

Search and locate files by name, extension, or pattern using recursive glob searches. Finds matching files across directories for efficient file discovery.

Instructions

SEARCH AND FIND files matching patterns. Recursively searches through all subdirectories using glob patterns. Use for finding files by extension, locating specific files by name pattern. Keywords: search, find, locate, grep files, filter. / 搜索和查找匹配模式的文件。使用glob模式递归搜索所有子目录。用于按扩展名查找文件、按名称模式定位特定文件。关键词:搜索、查找、定位、过滤。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe directory path to start searching from. The search will recursively include all subdirectories. Use '.' for current directory, or specify any directory path. Examples: '.' (search from current), 'src/' (search in source), '/home/user/projects' (absolute path).
patternYesThe search pattern using glob syntax. Wildcards: * matches any characters, ? matches single character, ** matches any directories. Examples: '*.go' (all Go files), 'test_*.py' (test files starting with test_), '**/*.md' (all Markdown files in any subdirectory), 'config.*' (config files with any extension).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses recursive traversal through all subdirectories and glob wildcard syntax, which covers the key behavioral aspects. The wording 'SEARCH AND FIND' implies a non-mutating read operation, but it could be more explicit about not modifying files.

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 front-loaded with essential information, but includes redundant keywords ('search, find, locate, grep files, filter') and a verbatim Chinese translation that adds length without new content. Still, it remains fairly concise and well-organized.

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 description covers use cases, wildcard syntax, recursion, and examples. Since an output schema exists, return format need not be described. Missing edge cases like symlink handling or case sensitivity, but these are not critical for a search tool.

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% with detailed explanations and examples for both path and pattern. The description adds keywords and reinforces glob mechanics, but does not introduce new semantic information beyond what the schema already provides, so the baseline score of 3 applies.

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 'SEARCH AND FIND files matching patterns' with recursive glob search, which distinguishes it from list_directory and file_exists. The verb+resource+scope is specific and unambiguous.

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?

Provides explicit use cases like 'Use for finding files by extension, locating specific files by name pattern' and lists keywords. However, it does not mention alternative tools or when not to use this tool, so guidance is clear but lacks 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/shibingli/mcp-toolkit'

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