Skip to main content
Glama

find_files

Locate and list project files and directories within the active workspace, respecting .gitignore exclusions, with glob/regex patterns, type, extension, and depth filters.

Instructions

Workspace-scoped file/directory finder and directory lister. Unlike shell find/fd/ls, results are confined to the active project (no .git/, node_modules/, build output, or anything else .gitignore excludes), every call is recorded in the project's stats, and the pattern semantics are consistent across hosts. pattern is optional — omit it to list everything. Supports glob and regex patterns, extension and type (file/dir/any) filters, depth limits (max_depth=1 lists one level, like ls), sort_by name/size/modified, and include_details for a per-entry [FILE]/[DIR]/[LINK] marker, size, and modified time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to search in (absolute path, file:// URI, or workspace-relative path). Defaults to the workspace root.
typeNoRestrict to files, directories, or both. Default: 'file'.
excludeNoGlob patterns to exclude from the walk. Matching directories are pruned without descending; matching files are skipped. Matched against relative paths and base names (supports **).
patternNoGlob (or regex if use_regex=true) matched against the file/directory name. When the pattern contains '/' it matches the full relative path. OPTIONAL — omit it to list every entry. A literal "." only matches a file named ".".
sort_byNoOrder of the result list: 'name' (directories first, then path), 'size' (largest first), 'modified' (newest first). Default: name.
extensionNoFilter by file extension, e.g. 'go' or '.go'.
max_depthNoMaximum directory depth to descend. 1 lists one level only, like ls. Default: unlimited.
use_regexNoTreat pattern as a regular expression instead of a glob. Default false.
max_resultsNoMaximum number of results to return. Default 500.
include_hiddenNoInclude hidden files and directories (starting with '.'). Default false.
include_detailsNoRender each entry with a [FILE]/[DIR]/[LINK] marker, its size and last-modified time (symlinks as 'name -> target') instead of a bare path list. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.19.4
    • addedInput schema / properties / exclude
      Added value: +{
      +  "description": "Glob patterns to exclude from the walk. Matching directories are pruned without descending; matching files are skipped. Matched against relative paths and base names (supports **).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observedv0.16.6

TDQS

A4.7/5.0
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 and covers safety and side effects: it notes that every call is recorded in project stats (a non-obvious behavioral consequence), which is beyond just a plain read. It clearly states the workspace confinement, which is a key behavioral trait. However, it does not mention performance implications or error cases, but the description is strong for a read-only tool.

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 a single dense paragraph, front-loaded with the key distinguishing point (workspace-scoped) and alternatives. It is concise and information-dense, but it is long and runs many features into one sentence, which could be slightly more structured with bullets. Still, every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (11 parameters, 0 required), no output schema, and no annotations, the description is remarkably complete: it covers scope, filters, options, and even edge cases like symlink display. It leaves little ambiguity for an agent; any missing details like sort ordering are already in the schema. This is comprehensive for such a complex tool.

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

Parameters5/5

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

Schema coverage is 100%, so parameters are already well-documented. The description adds meaningful context beyond the schema, such as clarifying pattern semantics ('pattern is optional — omit it to list everything', 'literal "."'), behavior of exclude (pruning directories), and the effect of max_depth=1 like ls. These enrich the semantics beyond the raw schema, justifying a high score.

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 the tool as a workspace-scoped file/directory finder and lister, with specific verbs and resource. It explicitly contrasts with shell find/fd/ls, and lists supported filters and options, distinguishing it from siblings like search_in_files and file_outline. This is a specific and non-tautological definition.

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?

It explicitly states when to use this tool versus shell commands, and outlines behavior like ignoring .gitignore, recording stats, and consistent pattern semantics. It gives concrete conditions for using options like max_depth and include_details, and implies when to use alternatives like search_in_files for content search. This is clear and actionable.

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