execute_officejs
Run custom Office.js code inside a live PowerPoint presentation to add shapes, edit text, change colors, or manage slides, returning results from the executed code.
Instructions
Execute arbitrary Office.js code inside the live PowerPoint presentation. The code runs inside PowerPoint.run(async (context) => { ... }) with 'context' available as a variable. Use 'await context.sync()' after loading properties. Return a value to get it back as the tool result. For positioning, all values are in points (1 point = 1/72 inch). Common operations: add shapes, set text, change colors, add/delete slides.
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>"
},
"name": "execute_officejs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Office.js code to execute. Runs inside PowerPoint.run() with 'context' available. Use 'return' to send back a result. | |
| presentationId | No | Target presentation ID from list_presentations. Optional when only one presentation is connected. |