Skip to main content
Glama

util_glob

Read-only

Glob / gitignore matcher — Test which file paths match a set of glob or .gitignore patterns, and which pattern decided each one. patterns= newline- or comma-separated (supports *, ?, **, [abc], [!abc], {a,b}, {1..9}, ! negation; # comments ignored), paths= newline- or comma-separated list (up to 5000). Optional: mode=glob|gitignore (gitignore = real Git rules: last match wins, slash-less patterns match at any depth, leading / anchors, trailing / = directories only, files under an ignored directory cannot be re-included), dot=true (let * match dotfiles in glob mode), nocase=true. Returns per-path matched + deciding pattern + parent directory that caused it, matched_paths, per-pattern hit counts and compiled regexes. Offline, instant. Price: $0.001 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "patterns": "<patterns>",
      "paths": "<paths>"
    },
    "name": "util_glob"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsYessrc/app.ts,src/lib/util.ts,src/lib/util.test.ts,README.md
patternsYessrc/**/*.ts,!**/*.test.ts

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description still adds substantial context the annotations cannot: supported pattern syntax, the 5000-path cap, precise gitignore semantics (last-match-wins, leading-slash anchoring, directory-only trailing slash, non-reinclusion under ignored dirs), return shape, and latency/cost. It does not flag any contradictions to the annotations, though 'Offline' sits slightly awkwardly against openWorldHint=true.

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?

Purpose is front-loaded and every clause carries information — syntax, limits, gitignore rules, returns, cost — with no filler. The downside is that nearly all of this is packed into one very long sentence, which hurts scannability for an agent parsing optional flags.

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?

A read-only matcher with two required parameters and no output schema; the description compensates by spelling out both input encodings, all pattern features, and the exact return content (per-path matched flag, deciding pattern, causing parent directory, matched_paths, per-pattern hit counts, compiled regexes). Nothing an agent needs to call it correctly or interpret results is missing.

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 already 100%, but the description goes further by defining the encoded format of both string parameters (newline- or comma-separated), the full pattern grammar, the 5000-path ceiling, and the optional mode/dot/nocase switches — the last three not even appearing in the schema's properties. This is meaning added well beyond the schema rather than restatement.

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?

States a specific verb and resource: 'Test which file paths match a set of glob or .gitignore patterns, and which pattern decided each one.' The deciding-pattern output is called out up front, which no sibling tool offers, so the matcher is distinguishable 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 Guidelines4/5

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

Gives clear framing for when to use it (testing path matches against glob/gitignore sets) and explicitly guides the glob-vs-gitignore choice with a detailed rule summary for gitignore mode. It stops short of naming when NOT to use it or pointing at any alternative, but among the util_* siblings there is no obvious competing matcher.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources