Path set hierarchy tree

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

Transform a flat array of file paths into a nested deterministic directory tree structure.

Use when you need to: path hierarchy tree · build directory tree from paths · path list to tree.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "paths": [
    "src/index.ts",
    "src/utils/helper.ts",
    "README.md"
  ]
}

Response:

{
  "result": {
    "tree": [
      {
        "name": "src",
        "type": "directory",
        "children": [
          {
            "name": "utils",
            "type": "directory",
            "children": [
              {
                "name": "helper.ts",
                "type": "file"
              }
            ]
          },
          {
            "name": "index.ts",
            "type": "file"
          }
        ]
      },
      {
        "name": "README.md",
        "type": "file"
      }
    ],
    "format": "posix"
  }
}

How to call it

MCP

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

{
  "id": "path-set-hierarchy-tree",
  "version": "1.0.0",
  "input": {
    "paths": [
      "src/index.ts",
      "src/utils/helper.ts",
      "README.md"
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/path-set-hierarchy-tree/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"paths":["src/index.ts","src/utils/helper.ts","README.md"]}'

The machine-readable contract is at /v1/tools/path-set-hierarchy-tree/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.