Skip to main content
Glama

path-rules

Which gitignore, CODEOWNERS or glob rule matches a path — Evaluates up to 25 file paths against the text of a .gitignore, a CODEOWNERS file or a list of glob patterns and reports, per path, whether it matched, the winning rule's line and pattern, and why (last match wins, directory-only rules, negation, a re-include blocked by an excluded parent directory, CODEOWNERS owner lists). Optional per-path expectations turn it into a pass/fail check, and CODEOWN

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": {
      "kind": "<kind>",
      "rules": "<rules>",
      "paths": "<paths>"
    },
    "name": "path-rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
pathsYes
rulesYesFile text, at most 300 pattern lines.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the return content (matched flag, winning rule's line and pattern, and the reason), the precedence semantics (last match wins), directory-only rules, negation, re-include blocked by an excluded parent, and CODEOWNERS owner lists. The only weakness is that the final clause is cut off mid-word ('and CODEOWN'), leaving one behavior unexplained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is front-loaded and dense with useful detail, but the description is truncated mid-sentence ('and CODEOWN'), which is a real structural defect an agent must interpret around. Apart from the truncation there is little wasted wording.

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?

There is no output schema, so the description must describe return values, and it does so thoroughly (per-path match status, winning rule line/pattern, and reasoning). The truncated tail is the only gap in an otherwise complete picture for a three-parameter evaluation tool.

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 only 33%, so the description must compensate, and it does: it explains that 'rules' is the file text of a gitignore/CODEOWNERS/glob list, that 'paths' is capped at 25, and that 'expect' converts the call into a pass/fail check. It does not explicitly explain 'isDir' or the 'kind' enum values beyond naming the three formats, so a little meaning is still left to 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 specific verb and resource ('Which gitignore, CODEOWNERS or glob rule matches a path') and then names the exact operation: evaluating up to 25 paths against rule text. It is clearly distinguishable from siblings like cross-field-rules or path-portability because it is scoped to ignore/ownership/glob matching.

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?

It states the concrete use case (checking which rule wins for a path) and adds that optional per-path expectations turn it into a pass/fail check, which tells the agent when to supply 'expect'. It does not name an alternative tool or state when not to use it, so it stops short of full routing guidance.

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