# 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 4096
- `patterns` (array of string, required): min items 1; max items 256
- `dot` (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:

```json
{
  "path": "src/index.ts",
  "patterns": [
    "**/*.ts"
  ]
}
```

Response:

```json
{
  "result": {
    "matched": true,
    "matching_pattern": "**/*.ts",
    "negated": false
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "path-set-glob-test",
  "version": "1.0.0",
  "input": {
    "path": "src/index.ts",
    "patterns": [
      "**/*.ts"
    ]
  }
}
```

### HTTP (no key)

```sh
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](/v1/tools/path-set-glob-test/versions/1.0.0).

### CLI

```sh
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/](/clients/cli/).

## Related tools

- [Path set glob filter](/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](/tools/path-set-classify): Classify an array of file paths by file extension, depth histogram, and path format.
- [Path set dedupe](/tools/path-set-dedupe): Deduplicate an array of paths based on lexical equivalence while preserving first or last seen order.
- [Path set difference](/tools/path-set-difference): Compute the set difference (A \ B) of two path collections using lexical path equivalence.
- [Path set hierarchy tree](/tools/path-set-hierarchy-tree): Transform a flat array of file paths into a nested deterministic directory tree structure.
- [Path set ignore filter](/tools/path-set-ignore-filter): Filter paths against gitignore-style rule lines (negation, comments, directory trailing slashes) lexically.
