edit_slide_xml
Edit a PowerPoint slide's XML or manipulate its DOM with JS code, then reimport server-side without exposing data to Claude. Use for structural changes like adding shapes or rebuilding layouts.
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. NOTE: the reimport deletes and reinserts the slide, which makes PowerPoint's view jump to the first slide — reserve this for structural changes (new shapes, layout rebuilds).
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. |