JSON flatten

json-flatten · version 1.0.0 · JSON & JSONL · free, no key needed

Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.

Use when you need to: json flatten · flatten json to json pointers · expand nested json into pointer keys.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "value": {
    "a/b": 1,
    "empty": {},
    "list": [],
    "tags": [
      "a",
      "b"
    ],
    "tilde~key": false,
    "user": {
      "name": "רוני",
      "note": "line one\nline,two"
    }
  }
}

Response:

{
  "result": {
    "pointers": {
      "/a~1b": 1,
      "/empty": {},
      "/list": [],
      "/tags/0": "a",
      "/tags/1": "b",
      "/tilde~0key": false,
      "/user/name": "רוני",
      "/user/note": "line one\nline,two"
    }
  }
}

How to call it

MCP

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

{
  "id": "json-flatten",
  "version": "1.0.0",
  "input": {
    "value": {
      "a/b": 1,
      "empty": {},
      "list": [],
      "tags": [
        "a",
        "b"
      ],
      "tilde~key": false,
      "user": {
        "name": "רוני",
        "note": "line one\nline,two"
      }
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/json-flatten/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":{"a/b":1,"empty":{},"list":[],"tags":["a","b"],"tilde~key":false,"user":{"name":"רוני","note":"line one\nline,two"}}}'

The machine-readable contract is at /v1/tools/json-flatten/versions/1.0.0.

CLI

node cli.mjs run json-flatten 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.