Skip to main content
Glama

search_files

Search files in a directory by text or regex pattern to locate matching lines with file paths and line numbers, with optional filters for file types, case sensitivity, and hidden files.

Instructions

Search text pattern across files in a directory. Returns matching lines with paths and line numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesText or regex pattern.
directoryYesDirectory to search.
max_resultsNoMax matches. Default: 100.
file_patternNoGlob filter, e.g. '*.ts'.
case_sensitiveNoDefault: false.
include_hiddenNoInclude hidden files. Default: false.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It reveals the non-mutating search behavior and the output format, but it does not mention result limits, hidden-file handling, or error conditions; some of this is covered by schema defaults.

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 compact and front-loaded: the first sentence states the action, the second the return format. There is no wasted wording or redundancy.

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 simple read-only search tool with a fully documented schema and no output schema, the description provides the essential return contract. It omits finer caveats such as ordering or binary-file behavior, but an agent has enough to invoke it correctly.

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 even without parameter details in the description. The description adds little beyond restating 'text pattern' and 'directory', relying on the schema for defaults like case_sensitive and max_results.

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 states a clear verb-object relationship: search a text pattern across files in a directory. It also specifies the return shape—matching lines with paths and line numbers—which distinguishes it from filename-oriented tools like find_files.

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 establishes the intended context clearly: full-text content search within a directory. It does not explicitly name alternatives or exclusions, but the wording is sufficiently unambiguous given the file-management siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/YOUSEFISLAM-dev/qwen-mcp'

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