Skip to main content
Glama

glob

Search files by pattern with recursive matching, newest-first order, and paginated results. Hidden and ignored files are excluded by default.

Instructions

Finds files matching a glob pattern. Supports ** recursive matching and sorts results by modification time (newest first). Defaults to 200 workspace-relative paths and 32768 characters per page. Skips hidden paths and paths excluded by root .gitignore/.ignore or the common generated/vendor policy unless explicitly included. Returns total/has_more/truncated metadata and an opaque next_cursor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to search. Defaults to configured workspace, MCP client root, or current directory
limitNoMaximum paths returned per page. Default: 200, Max: 5000
cursorNoOpaque continuation cursor returned by a previous glob call
patternYesGlob pattern to match files (e.g. **/*.go or src/**/*.ts)
include_hiddenNoTraverse hidden directories. Explicit hidden roots are always searched. Default: false
relative_pathsNoReturn paths relative to the search directory. Default: true
include_ignoredNoInclude paths excluded by .gitignore/.ignore or the common generated/vendor policy. Default: false
max_output_charsNoMaximum returned text characters. Default: 32768, Max: 131072

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.7
    • changedInput schema / properties / include_ignored / description
      Previous value: -"Traverse generated/vendor directories such as node_modules, vendor, target, build, and dist. Default: false"New value: +"Include paths excluded by .gitignore/.ignore or the common generated/vendor policy. Default: false"
  2. Changed8 schema fields changedv0.9.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque continuation cursor returned by a previous glob call",
      +  "type": "string"
      +}
    • addedInput schema / properties / include_hidden
      Added value: +{
      +  "description": "Traverse hidden directories. Explicit hidden roots are always searched. Default: false",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / include_ignored
      Added value: +{
      +  "description": "Traverse generated/vendor directories such as node_modules, vendor, target, build, and dist. Default: false",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Maximum paths returned per page. Default: 200, Max: 5000",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_output_chars
      Added value: +{
      +  "description": "Maximum returned text characters. Default: 32768, Max: 131072",
      +  "type": "integer"
      +}
    • changedInput schema / properties / path / description
      Previous value: -"Directory to search in (absolute path). Defaults to current directory if empty"New value: +"Directory to search. Defaults to configured workspace, MCP client root, or current directory"
    • changedInput schema / properties / relative_paths / description
      Previous value: -"Return paths relative to the search directory instead of absolute paths. Saves tokens in output: true or false. Default: false"New value: +"Return paths relative to the search directory. Default: true"
    • addedInput schema / properties / relative_paths / type
      Added value: +[
      +  "null",
      +  "boolean"
      +]
  3. Addedv0.8.7
  4. Removed
  5. Changed1 schema field changedv0.7.12
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "count": {
      -      "type": "integer"
      -    },
      -    "files": {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": [
      -        "null",
      -        "array"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "files",
      -    "count"
      -  ],
      -  "type": "object"
      -}New value: +null
  6. First observedv0.4.2

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries full behavioral burden, and it excels: it discloses sorting by modification time, default limits (200 paths, 32768 chars), skip rules for hidden and ignored paths, and pagination via next_cursor and metadata (total/has_more/truncated). This is thorough and actionable, covering the major behavioral traits an agent needs to anticipate.

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 with the core purpose, followed by key behaviors and return metadata. Every sentence adds distinct information (recursion, sorting, defaults, exclusions, pagination) with no filler. It is well-structured and easy to scan.

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?

Given 8 parameters, no annotations, and no output schema, the description covers the essential usage context: purpose, defaults, skip rules, sorting, and pagination metadata. It clearly states the return includes metadata and a cursor, which is sufficient for an agent to invoke and handle results. Minor gaps exist (e.g., exact shape of the path list) but these are not critical for correct invocation.

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 baseline is 3. The description adds value beyond the schema by explaining how parameters interact: e.g., include_hidden affects traversal, include_ignored overrides skip rules, and limit/cursor govern pagination. It also clarifies default behavior (workspace-relative, 200 limit). This enriches parameter understanding without contradicting the schema.

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 opens with a clear verb and resource: 'Finds files matching a glob pattern.' It immediately distinguishes from siblings like listdir (directory listing) and grep (content search) by specifying pattern matching and recursive support. This is a specific, unambiguous purpose.

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?

The description implies usage when pattern-based file discovery is needed but does not explicitly state when to prefer this over listdir or grep, nor does it list exclusions (e.g., 'for directory contents, use listdir'). Context is provided via behavior (e.g., default limits, skip rules) but not as routing guidance. It is adequate but not explicit.

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