update_diagram
Replace a diagram's DBML source or rename it, with validation and base_version conflict checks so newer saved changes are not overwritten.
Instructions
Replace a diagram's DBML source (and/or rename it). This overwrites the whole source — fetch it with get_diagram first if you need to edit rather than replace it outright, and pass its version as base_version so you never overwrite someone else's newer change. New DBML is validated first: errors mean nothing is saved; warnings are returned with the result.
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": {
"diagram_id": "<diagram_id>"
},
"name": "update_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | New title. Omit to leave unchanged. | |
| renames | No | Tables, columns, enums and table groups this edit renames. Always list them: without it a rename can look like a removed column plus a new one, and a migration generated from the diagram would drop the column and its data instead of renaming it. | |
| diagram_id | Yes | The diagram id (a UUID), from list_diagrams. | |
| dbml_source | No | New full DBML text. Omit to leave unchanged. | |
| base_version | No | The diagram's `version` from get_diagram. When given, the update is refused if someone else saved since, instead of overwriting their change. Recommended whenever you edit. |