Skip to main content
Glama

Find Files

find_files
Read-only

Find files by name or glob pattern, returning paths relative to the searched directory. Supports deep traversal, pagination, and filtering.

Instructions

Find files by name or glob pattern; returns file paths relative to the searched directory. A pattern without / matches file names at any depth. search_text searches contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoBase directory to search under (default: first allowed root)
cursorNoOpaque pagination cursor; pass unchanged for the next page. Pages slice one snapshot taken on the first call; it expires after ~60s — re-request without a cursor if rejected.
sortByNoSort order: path = full path (default), name = basename onlypath
patternYesGlob pattern to match file paths (e.g. **/*.ts, src/**/*.js)
maxDepthNoMax directory depth to scan; 0 = base directory only, omit for unlimited
maxResultsNoMaximum number of matching files to return per page
includeHiddenNoInclude hidden items (starting with .)
includeIgnoredNoInclude ignored items (node_modules, .git, etc).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • changedInput schema / properties / pattern / examples
      Previous value: -[
      -  "**/*.ts",
      -  "src/**/*.js",
      -  "*.{ts,tsx}"
      -]New value: +[
      +  "**/*.ts",
      +  "src/**/*.js",
      +  "**/*.{ts,tsx}"
      +]
  2. Changed2 schema fields changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / pattern / examples
      Added value: +[
      +  "**/*.ts",
      +  "src/**/*.js",
      +  "*.{ts,tsx}"
      +]
  3. Addedv2.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the read-only nature is covered. The description adds useful behavioral context: returns relative paths, pattern semantics at any depth, and implies it does not search file contents (by directing to search_text). No contradiction with 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?

Two sentences with zero waste. The purpose is front-loaded, the pattern rule is actionable, and the alternative is stated at the end. Every clause adds value, and the structure is ideal for quick scanning.

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 read-only search tool with 8 params fully documented in the schema, the description is largely complete. It clarifies the output format and pattern behavior, and implicitly indicates content search is out of scope. It does not mention pagination cursor expiry, but that is in the schema, so no critical gap for a well-formed call.

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?

Schema coverage is 100%, so all parameters are documented. The description adds an extra semantic for 'pattern' (the no-slash rule) beyond the schema examples, which provides meaningful value. It does not repeat schema descriptions, so it earns above the baseline 3.

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 specific verb ('Find') and resource ('files by name or glob pattern'), and clarifies the output is relative paths. It explicitly distinguishes from search_text by noting that tool searches contents, so an agent can tell them apart without opening schemas.

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?

It provides a clear rule for pattern matching ('pattern without / matches file names at any depth') and names the alternative for content search ('search_text searches contents'). It does not mention the 'list' sibling, which could be a common alternative for directory listing, but the guidance is sufficient for the primary distinction.

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