# API Enum Migration Mapper

- Human page: https://happytails.ai/en/developer-tools/api-enum-migration-mapper/
- Markdown: https://happytails.ai/en/developer-tools/api-enum-migration-mapper.md
- Structured JSON: https://happytails.ai/agents/en/developer-tools/api-enum-migration-mapper/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `api-enum-migration-mapper` |
| Category | developer-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Runs in your browser in a background worker. Accepts up to 200000 characters per definition and 10000 enum values.

### Inputs and settings

Text input: Old enum definition.

Example or placeholder shown in the interface (not a validated fixture):

```text
enum: [pending, on_hold, shipped]
```

JSON Schema, OpenAPI, GraphQL enum, .proto enum or one value per line. Up to 200,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `next` | New enum definition | textarea | "" |  |
| `format` | Definition format | select | "auto" | Allowed: auto, json, yaml, graphql, proto, list |
| `pointer` | JSON Pointer to the enum, optional | text | "" |  |
| `name` | Enum name, optional | text | "" |  |
| `matching` | Automatic matching | select | "normalized" | Allowed: normalized, case-insensitive, exact |
| `overrides` | Confirmed overrides, optional | textarea | "" |  |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

Accepts up to 200,000 characters per definition and up to 10,000 values per enum. Matching is done in your browser. Downloads are two CSV files and a JSON report.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "api-enum-migration-mapper",
  "category": "developer-tools",
  "built": true,
  "requirements": "Accepts up to 200,000 characters per definition and up to 10,000 values per enum. Matching is done in your browser. Downloads are two CSV files and a JSON report.",
  "implementation": {
    "fields": [
      {
        "key": "next",
        "label": "New enum definition",
        "value": "",
        "type": "textarea",
        "maxLength": 200000,
        "help": "Paste the new version in the same kinds of format as the old one."
      },
      {
        "key": "format",
        "label": "Definition format",
        "value": "auto",
        "type": "select",
        "values": [
          "auto",
          "json",
          "yaml",
          "graphql",
          "proto",
          "list"
        ]
      },
      {
        "key": "pointer",
        "label": "JSON Pointer to the enum, optional",
        "value": "",
        "type": "text",
        "maxLength": 2000,
        "help": "For JSON or YAML with several enums, such as /components/schemas/Status."
      },
      {
        "key": "name",
        "label": "Enum name, optional",
        "value": "",
        "type": "text",
        "maxLength": 200,
        "help": "For GraphQL or protobuf files with several enums."
      },
      {
        "key": "matching",
        "label": "Automatic matching",
        "value": "normalized",
        "type": "select",
        "values": [
          "normalized",
          "case-insensitive",
          "exact"
        ]
      },
      {
        "key": "overrides",
        "label": "Confirmed overrides, optional",
        "value": "",
        "type": "textarea",
        "maxLength": 200000,
        "help": "CSV with the headers from,to. Leave to empty to mark a value as removed."
      }
    ],
    "registrationFamily": "api-contracts-reference",
    "codeDirection": "ltr",
    "inputMaxLength": 200000,
    "inputErrorCode": "API_CONTRACTS_REFERENCE_TOO_LONG",
    "note": "Runs in your browser in a background worker. Accepts up to 200000 characters per definition and 10000 enum values.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 200000,
      "inputMode": "text",
      "label": "Old enum definition",
      "placeholder": "enum: [pending, on_hold, shipped]",
      "help": "JSON Schema, OpenAPI, GraphQL enum, .proto enum or one value per line. Up to 200,000 characters. Review the settings before running.",
      "helpParts": [
        "JSON Schema, OpenAPI, GraphQL enum, .proto enum or one value per line.",
        "Up to 200,000 characters.",
        "Review the settings before running."
      ],
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Map the values of an old enum to a new one and see which values are unmapped, removed or new. Works with JSON Schema, OpenAPI, GraphQL, protobuf and plain lists.

### How to use API Enum Migration Mapper

1. Paste the old enum definition.
2. Paste the new enum definition and choose how values are matched.
3. Add confirmed overrides for values that were renamed.
4. Run the mapping and download the from,to CSV and the review table.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

## Useful next steps

- [Dataset value mapper](https://happytails.ai/en/data-tools/dataset-value-mapper/) ([Markdown](https://happytails.ai/en/data-tools/dataset-value-mapper.md))

- [JSON schema validator](https://happytails.ai/en/developer-tools/json-schema-validator/) ([Markdown](https://happytails.ai/en/developer-tools/json-schema-validator.md))

- [YAML to JSON](https://happytails.ai/en/data-tools/yaml-to-json/) ([Markdown](https://happytails.ai/en/data-tools/yaml-to-json.md))

Accepts up to 200,000 characters per definition and up to 10,000 values per enum. Matching is done in your browser. Downloads are two CSV files and a JSON report.

## Matching

Identical values of the same JSON type map exactly. Normalized matching also ignores letter case, spaces, dashes and underscores while preserving other punctuation and Unicode characters. When two new values could match, the old value is marked ambiguous instead of guessing. Distinct values in one enum that have identical CSV text, such as 1 and "1", are rejected because a two-column migration file cannot distinguish them. Overrides entered as from,to CSV win; an empty to marks a removed value.

### Where enums are found

For JSON or YAML the tool uses the only enum array in the document, or the one your JSON Pointer names. For GraphQL SDL and .proto files it uses the only enum, or the one you name. A plain list uses one value per line.

### Using the result

The from,to CSV contains only mapped values, ready for Dataset value mapper. The review CSV lists every old value with its status and every new value that nothing maps to. The tool builds the map; it does not change your data.
