Skip to main content
Glama

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

NameRequiredDescriptionDefault
xmlNoModified XML — full slide XML or a single shape's <p:sp> element (when shapeId is provided). Mutually exclusive with 'code'.
codeNoJS 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'.
shapeIdNoOptional shape ID (xml mode only). If provided, replaces only that shape's <p:sp> element instead of the full slide XML.
slideIndexYesZero-based slide index
explanationNoBrief description of what the code does (for logging, max 50 chars). Only used with code mode.
presentationIdNoTarget presentation ID from list_presentations. Optional when only one presentation is connected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden and does so well: it discloses the server-side export/modify/reimport flow, that data never enters context, that code mode preserves untouched attributes, and critically that the reimport deletes and reinserts the slide causing PowerPoint's view to jump to slide 1. These are exactly the side effects an agent needs before invoking a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and mode split, and the behavioral caveat is at the end where it lands as a warning. Some duplication of the code-mode helper list (already in schema) is minor waste, but overall it is dense with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with six params and no output schema, the description covers workflow, mode semantics, context-isolation guarantees, and the view-jump side effect. Nothing an agent needs to call it safely and correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents xml, code, shapeId, explanation, and presentationId including mutual exclusivity and the code-mode helper signature. The description mostly restates the mode structure rather than adding syntax or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (edit slide XML and reimport) and immediately disambiguates the two operating modes. It implicitly and explicitly distinguishes itself from read_slide_xml (used as a prerequisite) and from simpler sibling edit tools (format_shapes, edit_shape_paragraphs) by scoping itself to structural changes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use routing: read_slide_xml first to fetch current XML, and 'reserve this for structural changes (new shapes, layout rebuilds)' which tells the agent when NOT to use it. The two modes are described with their selection criteria, leaving little inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.