> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eigenai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema-Triggered Patch

> Automatically patches existing data when the MCP/schema is updated — reconciling records to align with the new schema without a full regeneration.

Schema-Triggered Patch automatically patches existing data when the MCP/schema is updated — reconciling records to align with the new schema without a full regeneration. When function implementations or names have changed, instead of regenerating an entire dataset from scratch, you provide a function mapping that specifies which functions have changed, and the system regenerates only the affected dialogue segments.

## When to Use

* Function names have been renamed (e.g., `getUser` to `fetchUser`)
* Function implementations have changed and existing conversations need to reflect the new behavior
* You want to update a subset of conversations without losing the overall dataset structure

## Parameters

| Parameter          | Required | Description                                                                                            |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------ |
| `input`            | Yes      | Path to existing data file or directory                                                                |
| `function_mapping` | Yes      | JSONL file mapping previous function names to new function names                                       |
| `request`          | Yes      | Description of regeneration instructions                                                               |
| `mcp_server_url`   | Yes      | URL of the [MCP server](/products/eigendata-cli/core-concepts/mcp-server) providing the updated schema |
| `domain`           | No       | [Domain](/products/eigendata-cli/core-concepts/domain) context for regeneration                        |
| `reference_doc`    | No       | Path to reference documentation                                                                        |

## Function Mapping File

The function mapping is a JSONL file where each line maps a previous function name to its new name. This tells the system which conversation segments need regeneration.

```jsonl theme={null}
{"previous": "getUser", "new": "fetchUser"}
{"previous": "createOrder", "new": "submitOrder"}
```

This feature uses the standard [chatbot interaction flow](/products/eigendata-cli/core-concepts/chatbot-interaction). Describe what you need in natural language, and the CLI guides you through parameter collection and confirmation.

## Using /execute

You can also run schema-triggered-patch non-interactively via [`/execute`](../utility-commands/execute) with a YAML config:

```yaml theme={null}
task: schema-triggered-patch
input: ./data/conversations.jsonl
function_mapping: ./mappings/function_changes.jsonl
request: Regenerate only the affected dialogue segments based on the function mapping.
domain: airline customer service
mcp_server_url: http://127.0.0.1:8009
```

## Output

After a run completes, results are saved under `outputs/` as a new run directory, for example:

* `outputs/schema-triggered-patch_output_<run_id>/`

Inside the run directory:

* `generated_data.jsonl` - The regenerated dataset in JSONL format
* `datapoints/` - One JSON file per sample (expanded view of `generated_data.jsonl`)
* `metadata.json` - Run metadata (task type, parameters, primary files, timestamps)

The [viewer](../utility-commands/view) provides a split view that shows regenerated segments alongside the original data for easy comparison.
