Form answer diff

form-answer-diff · version 1.0.0 · Forms · free, no key needed

Diff two answer maps against one shared form definition.

Use when you need to: diff form answers · compare form submissions.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "definition": {
    "fields": [
      {
        "id": "note",
        "label": "Note",
        "type": "string",
        "required": false
      },
      {
        "id": "tags",
        "label": "Tags",
        "type": "multi",
        "required": false,
        "choices": [
          "x",
          "y"
        ]
      },
      {
        "id": "qty",
        "label": "Qty",
        "type": "number",
        "required": false
      }
    ]
  },
  "left": {
    "note": "",
    "tags": [
      "y",
      "x"
    ],
    "qty": null
  },
  "right": {
    "tags": [
      "x",
      "y"
    ],
    "qty": 1
  }
}

Response:

{
  "result": {
    "added": [],
    "removed": [
      {
        "id": "note",
        "presence": "empty",
        "value": ""
      }
    ],
    "changed": [
      {
        "id": "qty",
        "reason": "null_versus_value",
        "left_presence": "null",
        "right_presence": "value",
        "left": null,
        "right": 1
      }
    ],
    "invalid": [],
    "order_only": [
      {
        "id": "tags",
        "left": [
          "y",
          "x"
        ],
        "right": [
          "x",
          "y"
        ]
      }
    ],
    "unknown": [],
    "counts": {
      "added": 0,
      "removed": 1,
      "changed": 1,
      "invalid": 0,
      "order_only": 1,
      "unknown": 0,
      "unchanged": 0,
      "fields": 3,
      "left_missing": 0,
      "left_null": 1,
      "left_empty": 1,
      "right_missing": 1,
      "right_null": 0,
      "right_empty": 0
    }
  }
}

How to call it

MCP

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

{
  "id": "form-answer-diff",
  "version": "1.0.0",
  "input": {
    "definition": {
      "fields": [
        {
          "id": "note",
          "label": "Note",
          "type": "string",
          "required": false
        },
        {
          "id": "tags",
          "label": "Tags",
          "type": "multi",
          "required": false,
          "choices": [
            "x",
            "y"
          ]
        },
        {
          "id": "qty",
          "label": "Qty",
          "type": "number",
          "required": false
        }
      ]
    },
    "left": {
      "note": "",
      "tags": [
        "y",
        "x"
      ],
      "qty": null
    },
    "right": {
      "tags": [
        "x",
        "y"
      ],
      "qty": 1
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/form-answer-diff/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"definition":{"fields":[{"id":"note","label":"Note","type":"string","required":false},{"id":"tags","label":"Tags","type":"multi","required":false,"choices":["x","y"]},{"id":"qty","label":"Qty","type":"number","required":false}]},"left":{"note":"","tags":["y","x"],"qty":null},"right":{"tags":["x","y"],"qty":1}}'

The machine-readable contract is at /v1/tools/form-answer-diff/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.