Path set partition directory

path-set-partition-directory · version 1.0.0 · File paths (lexical) · free, no key needed

Partition an array of file paths into buckets grouped by parent directory or directory at a specified depth.

Use when you need to: partition paths by directory · group files by directory · partition path set.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "paths": [
    "/a/b/c.ts",
    "/a/b/d.ts",
    "/a/e/f.ts"
  ],
  "depth": 2
}

Response:

{
  "result": {
    "partitions": {
      "/a/b": [
        "/a/b/c.ts",
        "/a/b/d.ts"
      ],
      "/a/e": [
        "/a/e/f.ts"
      ]
    },
    "format": "posix",
    "total": 3
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "path-set-partition-directory",
  "version": "1.0.0",
  "input": {
    "paths": [
      "/a/b/c.ts",
      "/a/b/d.ts",
      "/a/e/f.ts"
    ],
    "depth": 2
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/path-set-partition-directory/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"paths":["/a/b/c.ts","/a/b/d.ts","/a/e/f.ts"],"depth":2}'

The machine-readable contract is at /v1/tools/path-set-partition-directory/versions/1.0.0.

CLI

node cli.mjs run path-set-partition-directory 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.