execute_indesign_code
Execute JavaScript code in InDesign's UXP context to perform operations not covered by other tools, with full document access and explicit safety confirmation.
Instructions
Execute arbitrary JavaScript code in the InDesign UXP context. WARNING: this runs with full InDesign DOM access and can create, modify, or destroy documents. Use only as a last resort when no other tool covers the operation.
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": {
"code": "<code>",
"dangerousConfirmation": "<dangerousConfirmation>"
},
"name": "execute_indesign_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute in UXP context. Has access to `app` (InDesign application object). | |
| dangerousConfirmation | Yes | Must be exactly: "I understand this executes arbitrary InDesign code" |