apply_schema
Applies a validated schema diff to the live Directus data model, creating, altering and dropping collections and fields. Run diff_schema first, keep a snapshot backup, and pass confirm: true.
Instructions
Applies a diff from diff_schema to the live data model, creating, altering and dropping collections and fields. Requires confirm: true. Destructive and not transactional: a mirror-mode diff drops whatever is missing from the snapshot, and a failure partway leaves the model half-migrated. The hash ties the diff to the model it was computed against and the call is refused when the model has moved since; force bypasses that check and can corrupt the model. Always run diff_schema first and keep a get_schema_snapshot backup.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"diff": "<diff>"
},
"name": "apply_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | Yes | The { hash, diff } object returned by diff_schema | |
| force | No | Bypass the hash and version safety check | |
| confirm | No | Confirm application |