Path set glob test
path-set-glob-test · version 1.0.0 · File paths (lexical) · free, no key needed
Test a single path string against glob patterns lexically and return match disposition and matching pattern.
Use when you need to: glob test · test path against glob · single path glob match.
Supported
- glob test
- test path against glob
- single path glob match
Not supported
- filesystem glob
- readdir
- stat file
Behavior
- Test single path against ordered patterns. Final disposition after processing all patterns in order (later negation overrides earlier match). matching_pattern is the last pattern that determined disposition. null if no pattern matched. negated is true if final state is excluded by a ! pattern.
Input
path(string, required): min length 1; max length 4096patterns(array of string, required): min items 1; max items 256dot(boolean, optional)case_sensitive(boolean, optional)
Output
matched(boolean, optional)matching_pattern(string or null, optional)negated(boolean, optional)
Limits
- max patterns: 256
- max path bytes: 4096
- max pattern bytes: 512
Example
Request input:
{
"path": "src/index.ts",
"patterns": [
"**/*.ts"
]
}
Response:
{
"result": {
"matched": true,
"matching_pattern": "**/*.ts",
"negated": false
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "path-set-glob-test",
"version": "1.0.0",
"input": {
"path": "src/index.ts",
"patterns": [
"**/*.ts"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/path-set-glob-test/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"path":"src/index.ts","patterns":["**/*.ts"]}'
The machine-readable contract is at /v1/tools/path-set-glob-test/versions/1.0.0.
CLI
node cli.mjs run path-set-glob-test 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Path set glob filter: Filter an array of paths against glob patterns with inclusion and exclusion rules lexically without filesystem access.
- Path set classify: Classify an array of file paths by file extension, depth histogram, and path format.
- Path set dedupe: Deduplicate an array of paths based on lexical equivalence while preserving first or last seen order.
- Path set difference: Compute the set difference (A \ B) of two path collections using lexical path equivalence.
- Path set hierarchy tree: Transform a flat array of file paths into a nested deterministic directory tree structure.
- Path set ignore filter: Filter paths against gitignore-style rule lines (negation, comments, directory trailing slashes) lexically.