Skip to main content
Glama

Glob

glob

List files matching a pattern and identify which are already cached, so you can avoid unnecessary reads. Use cached_only to view cached files, then batch-read the rest.

Instructions

List files matching a glob and show which are already cached.

Use it to discover files and see what search/grep can already access before you spend reads. Each match carries a cached flag; set cached_only=true to list only files already in the cache. Pair it with batch_read to pull in whatever isn't cached yet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesGlob pattern to match (e.g. `src/**/*.py`).
directoryNoBase directory the pattern is evaluated from..
cached_onlyNoReturn only files that are already cached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "cached_count": {
      -      "anyOf": [
      -        {
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Cached Count"
      -    },
      -    "directory": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Directory"
      -    },
      -    "matches": {
      -      "anyOf": [
      -        {
      -          "items": {
      -            "properties": {
      -              "cached": {
      -                "anyOf": [
      -                  {
      -                    "type": "boolean"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ],
      -                "default": null,
      -                "title": "Cached"
      -              },
      -              "mtime": {
      -                "anyOf": [
      -                  {
      -                    "type": "number"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ],
      -                "default": null,
      -                "title": "Mtime"
      -              },
      -              "path": {
      -                "anyOf": [
      -                  {
      -                    "type": "string"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ],
      -                "default": null,
      -                "title": "Path"
      -              },
      -              "tokens": {
      -                "anyOf": [
      -                  {
      -                    "type": "integer"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ],
      -                "default": null,
      -                "title": "Tokens"
      -              },
      -              "truncated": {
      -                "anyOf": [
      -                  {
      -                    "type": "boolean"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ],
      -                "default": null,
      -                "title": "Truncated"
      -              }
      -            },
      -            "title": "GlobMatch",
      -            "type": "object"
      -          },
      -          "type": "array"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Matches"
      -    },
      -    "pattern": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Pattern"
      -    },
      -    "total_cached_tokens": {
      -      "anyOf": [
      -        {
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Total Cached Tokens"
      -    },
      -    "total_matches": {
      -      "anyOf": [
      -        {
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Total Matches"
      -    },
      -    "truncated": {
      -      "anyOf": [
      -        {
      -          "type": "boolean"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "title": "Truncated"
      -    }
      -  },
      -  "title": "GlobResponse",
      -  "type": "object"
      -}New value: +null
  2. Changed3 schema fields changedv0.5.1
    • addedInput schema / properties / cached_only / description
      Added value: +"Return only files that are already cached."
    • addedInput schema / properties / directory / description
      Added value: +"Base directory the pattern is evaluated from."
    • addedInput schema / properties / pattern / description
      Added value: +"Glob pattern to match (e.g. `src/**/*.py`)."
  3. Addedv0.4.5

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden of explaining behavior. It reveals that results include a cached flag, that cached_only restricts results, and that no content reads are performed before a batch_read step. It does not explicitly state it is read-only/safe, but the listing language makes that clear.

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?

Four short sentences, with the core action front-loaded and each subsequent sentence adding a distinct piece of useful context (cache flag, filter, batch_read pairing). No filler or repetition.

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?

For a simple 3-parameter listing tool with no output schema, the description fully covers what the tool returns (matches with cached flags), when to use it, and how to pair it with batch_read. Nothing critical for a correct first call is missing.

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

Parameters3/5

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

Schema description coverage is 100% and all three parameters are already described with examples and defaults. The description adds modest value by highlighting cached_only usage, but does not add new meaning beyond the schema; baseline 3 is appropriate.

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 begins with a specific verb and resource: 'List files matching a glob and show which are already cached.' It clearly distinguishes itself from sibling tools like search/grep by focusing on filesystem discovery and cache status, so an agent can tell what this tool does without opening the schema.

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?

Explicitly tells when to use it: before spending reads, to see what search/grep can already access. It names batch_read as the partner for uncached files, and identifies cached_only as a filter. This is clear guidance with alternatives.

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