set_page
Replace one page's content in a local .drawio file with new mxGraphModel XML while leaving other pages untouched and preserving that page's compression; use list_pages/get_page first.
Instructions
Replaces the content of one page (diagram) in a local .drawio file with new mxGraphModel XML, leaving every other page in the file untouched. Compression of the replaced page matches whatever that page's original compression state was. Use list_pages/get_page first to find the target page.
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": {
"path": "<path>",
"page": "<page>",
"content": "<content>"
},
"name": "set_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | Which page to replace: a zero-based page index (e.g. "0"), the page's exact name, or the page's id as shown by list_pages. | |
| path | Yes | Absolute or relative path to the local file. Must end in .drawio or .xml. | |
| content | Yes | The new page content as plain mxGraphModel XML (uncompressed). Must be a single <mxGraphModel> element without any <diagram> tags. |