Skip to main content
Glama

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

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/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does add real context: the slide is exported, mutated server-side, and reimported, and 'data never enters Claude's context,' which tells the agent the tool is not a conversational read-modify-write. It also implies xml mode replaces the whole slide while code mode preserves untouched attributes. It stops short of stating reversibility, failure behavior, or that a full-XML replacement discards all existing content.

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-loads the purpose and the two modes in the first two sentences, then spends the remainder on the mode-specific contract. The parenthesized global list is long but earns its place by defining the code-mode API. Minor redundancy with the schema's parameter descriptions is the only waste.

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

Completeness3/5

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

Explains the mechanism and both input modes for a 6-parameter mutation tool with no annotations and no output schema, which is substantial. However, it never says what the tool returns or how failures surface, and gives no guidance on verifying the reimport succeeded (e.g., via verify_slides or re-reading with read_slide_xml), which matters for a destructive whole-slide replacement.

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%, so the schema already documents every parameter, including the xml/code mutual exclusivity, shapeId being xml-mode-only, and explanation being code-mode-only. The description largely restates those constraints and adds only the enumeration of code-mode globals (doc, findShapeById, NS_P, NS_A, escapeXml, serializeXml, DOMParser), which the schema also lists. Baseline 3 is appropriate.

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?

Names a specific verb and resource ('Edit slide XML and reimport') and immediately distinguishes itself from siblings like edit_slide_chart and edit_shape_paragraphs by stating its two operating modes (raw xml string vs. JS code against a pre-parsed DOM). An agent can tell exactly what class of operation this is without opening the schema.

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

Usage Guidelines4/5

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

Gives a concrete when-to-use precondition — 'use read_slide_xml first to get current XML' for xml mode — and explains the tradeoff that selects code mode ('Code mode preserves untouched attributes'). It does not explicitly say when to prefer this over siblings such as edit_shape_paragraphs or edit_slide_zip, so the routing guidance is strong but not exhaustive.

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