Skip to main content
Glama

search_files

Recursively locate files and directories by glob pattern, returning full paths within allowed directories when you don't know exact locations.

Instructions

Recursively search for files and directories matching a pattern. The patterns should be glob-style patterns that match paths relative to the working directory. Use pattern like '.ext' to match files in current directory, and '**/.ext' to match files in all subdirectories. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "pattern": "<pattern>"
    },
    "name": "search_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
patternYes
excludePatternsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-preview.1

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full load: it discloses the return shape ('full paths to all matching items') and the directory sandbox restriction, which is real behavioral context. It does not cover error behavior, hidden-file or symlink handling, or result ordering/limits.

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?

Front-loaded with the core action, then syntax guidance, then return value and scope. Every sentence adds something; the two glob examples are slightly redundant with each other but justify themselves as concrete usage.

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?

Adequate for a simple read-only search with no output schema, covering purpose, pattern syntax, return format, and sandboxing. It falls short on two of three parameters and on failure/edge-case behavior, which matters more given zero annotation coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for all three parameters. It explains 'pattern' thoroughly with glob syntax and examples, but never explains what 'path' means (root vs. working directory) or that 'excludePatterns' exists at all.

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?

States a specific verb and resource ('Recursively search for files and directories') plus the matching mechanism (glob patterns). It conveys scope ('recursively') that separates it from a shallow listing tool, though it never names a sibling alternative outright.

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?

Gives a usage cue ('Great for finding files when you don't know their exact location') and a hard constraint ('Only searches within allowed directories'), but offers no explicit when-not guidance or pointers to alternatives like list_directory or directory_tree for known locations.

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