Path set prefix strip

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

Strip a common directory prefix or base path from an array of paths lexically.

Use when you need to: strip path prefix · remove base directory · relativize paths.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "paths": [
    "/app/src/a.ts",
    "/app/src/b.ts",
    "/other/c.ts"
  ],
  "prefix": "/app/src"
}

Response:

{
  "result": {
    "stripped": [
      "a.ts",
      "b.ts",
      "/other/c.ts"
    ],
    "not_matched": 1,
    "format": "posix"
  }
}

How to call it

MCP

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

{
  "id": "path-set-prefix-strip",
  "version": "1.0.0",
  "input": {
    "paths": [
      "/app/src/a.ts",
      "/app/src/b.ts",
      "/other/c.ts"
    ],
    "prefix": "/app/src"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/path-set-prefix-strip/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"paths":["/app/src/a.ts","/app/src/b.ts","/other/c.ts"],"prefix":"/app/src"}'

The machine-readable contract is at /v1/tools/path-set-prefix-strip/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.