edit_slide_xml
Edit PowerPoint slide XML directly or via JavaScript DOM code, then reimport it while preserving untouched attributes and keeping slide data out of context.
Instructions
Edit slide XML and reimport. Two modes: (1) xml mode — provide finished XML string (use read_slide_xml first to get current XML), (2) code mode — provide JS code that manipulates the pre-parsed DOM (receives: doc, findShapeById, NS_P, NS_A, escapeXml, serializeXml, DOMParser). Code mode preserves untouched attributes. The slide is exported, modified server-side, and reimported — data never enters Claude's context.
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": {
"slideIndex": "<slideIndex>"
},
"name": "edit_slide_xml"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | Modified XML — full slide XML or a single shape's <p:sp> element (when shapeId is provided). Mutually exclusive with 'code'. | |
| code | No | JS code that manipulates the pre-parsed slide DOM. Receives: doc (Document), findShapeById(id) → Element|null, NS_P, NS_A (namespace strings), escapeXml(text), serializeXml(node), DOMParser. Mutually exclusive with 'xml'. | |
| shapeId | No | Optional shape ID (xml mode only). If provided, replaces only that shape's <p:sp> element instead of the full slide XML. | |
| slideIndex | Yes | Zero-based slide index | |
| explanation | No | Brief description of what the code does (for logging, max 50 chars). Only used with code mode. | |
| presentationId | No | Target presentation ID from list_presentations. Optional when only one presentation is connected. |