Form definition diff

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

Diff two form definitions by stable field id, including choice lists and field order.

Use when you need to: diff form fields · form structure diff.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "left": {
    "fields": [
      {
        "id": "email",
        "label": "Email",
        "type": "string",
        "required": true
      },
      {
        "id": "plan",
        "label": "Plan",
        "type": "choice",
        "required": true,
        "choices": [
          "free",
          "pro"
        ]
      }
    ]
  },
  "right": {
    "fields": [
      {
        "id": "plan",
        "label": "Plan",
        "type": "choice",
        "required": true,
        "choices": [
          "pro",
          "team"
        ]
      },
      {
        "id": "seats",
        "label": "Seats",
        "type": "integer",
        "required": false
      }
    ]
  }
}

Response:

{
  "result": {
    "added": [
      {
        "id": "seats",
        "field": {
          "id": "seats",
          "label": "Seats",
          "type": "integer",
          "required": false
        }
      }
    ],
    "removed": [
      {
        "id": "email",
        "field": {
          "id": "email",
          "label": "Email",
          "type": "string",
          "required": true
        }
      }
    ],
    "changed": [
      {
        "id": "plan",
        "changes": [
          "choices"
        ],
        "left": {
          "id": "plan",
          "label": "Plan",
          "type": "choice",
          "required": true,
          "choices": [
            "free",
            "pro"
          ]
        },
        "right": {
          "id": "plan",
          "label": "Plan",
          "type": "choice",
          "required": true,
          "choices": [
            "pro",
            "team"
          ]
        },
        "choice_added": [
          "team"
        ],
        "choice_removed": [
          "free"
        ],
        "choice_reordered": false
      }
    ],
    "order_changed": false,
    "counts": {
      "added": 1,
      "removed": 1,
      "changed": 1,
      "unchanged": 0,
      "reordered": 0
    }
  }
}

How to call it

MCP

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

{
  "id": "form-definition-diff",
  "version": "1.0.0",
  "input": {
    "left": {
      "fields": [
        {
          "id": "email",
          "label": "Email",
          "type": "string",
          "required": true
        },
        {
          "id": "plan",
          "label": "Plan",
          "type": "choice",
          "required": true,
          "choices": [
            "free",
            "pro"
          ]
        }
      ]
    },
    "right": {
      "fields": [
        {
          "id": "plan",
          "label": "Plan",
          "type": "choice",
          "required": true,
          "choices": [
            "pro",
            "team"
          ]
        },
        {
          "id": "seats",
          "label": "Seats",
          "type": "integer",
          "required": false
        }
      ]
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/form-definition-diff/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"left":{"fields":[{"id":"email","label":"Email","type":"string","required":true},{"id":"plan","label":"Plan","type":"choice","required":true,"choices":["free","pro"]}]},"right":{"fields":[{"id":"plan","label":"Plan","type":"choice","required":true,"choices":["pro","team"]},{"id":"seats","label":"Seats","type":"integer","required":false}]}}'

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

CLI

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

Get the client at /clients/cli/.