Form field map

form-field-map · version 1.0.0 · Forms · free, no key needed

Rename form fields with an explicit id map and reject collisions.

Use when you need to: map form field ids · migrate form fields.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "definition": {
    "fields": [
      {
        "id": "email",
        "label": "Email",
        "type": "string",
        "required": true
      },
      {
        "id": "name",
        "label": "Name",
        "type": "string",
        "required": false
      }
    ]
  },
  "answers": {
    "email": "a@b.test",
    "name": "Ada"
  },
  "mapping": [
    {
      "from": "email",
      "to": "email_address"
    }
  ],
  "unmapped": "keep"
}

Response:

{
  "result": {
    "definition": {
      "fields": [
        {
          "id": "email_address",
          "label": "Email",
          "type": "string",
          "required": true
        },
        {
          "id": "name",
          "label": "Name",
          "type": "string",
          "required": false
        }
      ]
    },
    "answers": {
      "email_address": "a@b.test",
      "name": "Ada"
    },
    "renamed": [
      {
        "from": "email",
        "to": "email_address"
      }
    ],
    "dropped": [],
    "unchanged_ids": [
      "name"
    ],
    "counts": {
      "fields_in": 2,
      "fields_out": 2,
      "renamed": 1,
      "dropped": 0,
      "unchanged_ids": 1,
      "answers_moved": 1,
      "answers_dropped": 0,
      "answers_kept": 1
    }
  }
}

How to call it

MCP

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

{
  "id": "form-field-map",
  "version": "1.0.0",
  "input": {
    "definition": {
      "fields": [
        {
          "id": "email",
          "label": "Email",
          "type": "string",
          "required": true
        },
        {
          "id": "name",
          "label": "Name",
          "type": "string",
          "required": false
        }
      ]
    },
    "answers": {
      "email": "a@b.test",
      "name": "Ada"
    },
    "mapping": [
      {
        "from": "email",
        "to": "email_address"
      }
    ],
    "unmapped": "keep"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/form-field-map/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"definition":{"fields":[{"id":"email","label":"Email","type":"string","required":true},{"id":"name","label":"Name","type":"string","required":false}]},"answers":{"email":"a@b.test","name":"Ada"},"mapping":[{"from":"email","to":"email_address"}],"unmapped":"keep"}'

The machine-readable contract is at /v1/tools/form-field-map/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.