Re-arrange layout with AI
relayout_diagramRearrange diagram layouts automatically for improved readability. Confirm the token cost to start the async job and receive updated XML, warnings, and a quality score.
Instructions
Automatically re-arrange a diagram's layout for readability (async). Starts the job and waits for it to finish, returning the re-laid XML + fresh warnings/score. Every re-layout costs credits based on the tokens it uses (like edit/fix) and requires confirm=true. If the job is still running when the wait elapses, returns a job_id you can poll with get_relayout_status.
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": "relayout_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Consent to the token-based charge (required to start). | |
| diagram_id | Yes | The diagram id |