Skip to main content
Glama

Find Files

find_files
Read-only

Locate files in a directory tree using glob patterns, with pagination, sorting, and filters for depth and hidden items.

Instructions

Find files matching a glob pattern. Returns matched paths with optional metadata. Pagination cursors reference a query-bound snapshot that expires after 60 seconds. For content search use search_text; for bulk regex replacements use replace_text with the same glob.

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. 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}"
      +]
  2. Addedv2.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already mark the operation as read-only and non-open-world, and the description adds useful behavioral context beyond that: pagination cursors reference a query-bound snapshot that expires after 60 seconds. This is valuable operational detail an agent would not otherwise know, though it does not describe output formatting or error behavior.

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?

Three sentences with no filler: the core function is front-loaded, followed by a key pagination caveat and sibling routing. Every sentence earns its place.

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 the tool's purpose, output shape at a high level, pagination behavior, and when to use alternatives. However, 'optional metadata' is vague and there is no output schema to clarify what the response contains, so a small completeness gap remains.

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 description coverage is 100%, so the schema carries most parameter documentation. The description adds meaningful context by explaining the pagination cursor's snapshot semantics and expiration, which directly affects how the cursor parameter should be used. It also reinforces that pattern is a glob.

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 precise verb and resource: 'Find files matching a glob pattern' and explicitly says it returns matched paths with optional metadata. It also names sibling tools it is not (search_text for content, replace_text for replacements), making it easily distinguishable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit routing guidance: use find_files for path/glob-based file discovery, use search_text for content search, and use replace_text with the same glob for bulk replacements. This clearly tells an agent when to choose this tool over its most relevant siblings.

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