office-live-mcp

v1.2.3
office-live-mcp Checked 1 hour ago Published 23 days ago

MCP server that lets AI assistants manipulate live, open Word, Excel and PowerPoint documents via Office.js

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_presentations

Lists all PowerPoint presentations currently connected to the bridge server. Shows presentation IDs (file paths for saved files, generated IDs for unsaved) and connection status. Use this to find the presentationId to pass to other tools when multiple presentations are open.

inspect_deck

Deck overview: slide dimensions, theme (colors + fonts), and all slides with slide number (1-based), ID, and shape count. Use as the first call to understand deck structure. Theme is cached after the first call. For shape details, follow up with scan_slide or inspect_slide on specific slides. For available layouts, use inspect_layouts.

ParameterTypeDescription
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

inspect_layouts

Returns slide layouts with names, OOXML type (e.g. blank, twoObj, secHead), master/layout indices, and detailed placeholders. Use `fields` to control which data is returned. By default reads all layouts from every slide master in OOXML (complete list, requires file access — may take a moment on first call for cloud files). Layouts sharing a name across different masters are distinguished by `masterIndex`. Set usedOnly to return only layouts assigned to existing slides (fast, Office.js only, no file access).

ParameterTypeDescription
fieldsstringComma-separated layout fields to include. Placeholders sub-fields in parens. Default: "index,masterIndex,name,type,usedBySlides,placeholders(type,idx,name)". All placeholder fields: type,idx,name,desc…
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
usedOnlybooleanIf true, return only layouts currently assigned to slides (fast, Office.js only). Default: false (all layouts from OOXML).

inspect_slide

Detailed slide inspector (~80 tokens/shape): returns every shape with text content, positions, sizes, and fill colors, plus slide dimensions. Supports slideRange for multiple slides. For just positions without text/fills, use scan_slide instead.

ParameterTypeDescription
slideRange *stringSlide numbers, 1-based, e.g. "1", "1-5", "2,4,7". Single number or range.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

scan_slide

Lightweight shape scanner (~40 tokens/shape): lists shape IDs, types, and positions on slides, plus slide dimensions. Supports slideRange for multiple slides. For text content and fills, use inspect_slide instead.

ParameterTypeDescription
slideRange *stringSlide numbers, 1-based, e.g. "1", "1-5", "2,4,7". Single number or range.
namePatternstringGlob-style filter on shape name, e.g. "Title*", "*_source", "Card*_bg". Case-insensitive.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
shapeTypestringFilter by shape type: "Placeholder", "TextBox", "GeometricShape", "Graphic", "Picture", etc.

screenshot_slide

Slide screenshot (~1000 tokens): captures one slide as PNG image. Use to visually verify layout after changes. Do NOT loop over all slides — use preview_deck instead. WARNING: renders with whatever font the host webview substitutes when the deck font is not system-installed (e.g. Century Gothic) — substituted fonts have different metrics, so text width, overflow and centering judgments from these screenshots are UNRELIABLE. For font-faithful QA export via PowerPoint itself (AppleScript: `save pres in POSIX file "/tmp/x.pdf" as save as PDF`, then pdftoppm) and measure geometry with Python (…

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide), from scan_slide results
heightintegerImage height in pixels. If omitted, auto-calculated from width to preserve aspect ratio.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
widthintegerImage width in pixels. Default: 720. Height auto-calculated to preserve aspect ratio unless also specified.

preview_deck

Deck preview: batch overview of all/selected slides with optional thumbnails + text. With images: ~900 tokens/slide; text-only (includeImages=false): ~35 tokens/slide. Use for visual review or content audit. Do NOT use to inspect one slide — use inspect_slide or screenshot_slide instead.

ParameterTypeDescription
imageWidthintegerThumbnail width in pixels. Default: 480. Height auto-calculated to preserve aspect ratio.
includeImagesbooleanInclude slide thumbnails. Default: true. Set false for text-only overview (faster).
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
slideRangestringSlide numbers, 1-based, e.g. "1-6", "2,4,7", "1-3,5,8-11". Omit for all slides.

open_document

Open a document file (.pptx/.docx/.xlsx) as a NEW document in its Office app (PowerPoint, Word or Excel) on the machine where the bridge runs. Only use this when the user explicitly wants a separate new document/window — it does NOT fill a presentation they already have open. To deliver a built deck into the user's open presentation, use import_presentation_file instead.

ParameterTypeDescription
path *stringAbsolute path to the document file. It must already exist on this machine.

import_presentation_file

Import ALL slides from a .pptx file on disk into a connected live PowerPoint presentation, in one atomic operation. The file is read server-side (its Base64 never enters the model context) and inserted via insertSlidesFromBase64 — the slides appear live in the open presentation while the user watches. This is the route for "build me a full presentation INTO this open deck": generate the complete .pptx offline (e.g. python-pptx), then import it into the connected presentation. No second pane or ribbon click needed.

ParameterTypeDescription
path *stringAbsolute path to the source .pptx file. It must already exist on this machine.
formattingstringFormatting mode for the inserted slides. Default: KeepSourceFormatting.
presentationIdstringDestination presentation ID from list_presentations. Optional when only one presentation is connected.

add_connector

Draw a line or curved connector between two shapes or points, with all OOXML bounding-box math (off/ext/flips, bezier path) computed for you. For bezier curves the path leaves and arrives horizontally — no flip attributes are used, avoiding the custGeom double-mirror pitfall. The shape is appended on top of the slide.

ParameterTypeDescription
from *Endpoint: {shapeId} or {x, y}
slide *integerSlide number, 1-based
to *Endpoint: {shapeId} or {x, y}
alphaPctnumberOpacity in percent (0-100). Omit for fully opaque.
beforeShapeIdstringInsert the connector directly below this shape ID (z-order). Overrides zOrder.
colorstringLine color as RRGGBB hex, e.g. "EF463C". Default EF463C.
curvestringstraight (default) or bezier (horizontal tangents at both ends).
presentationIdstringTarget presentation ID. Optional when only one presentation is connected.
weightPtnumberLine width in points. Default 1.
zOrderstring"top" (default) appends above all shapes; "bottom" inserts below all shapes.

transform_slide

Vertically rescale a band of shapes (e.g. shrink the content of a slide by 30%) in ONE atomic operation. Shapes whose top falls inside [topPt, bottomPt] are remapped to start at newTopPt with factor scaleY. Connector-like shapes (cxnSp, line/connector geometries, single-stroke bezier custGeom) get their height rescaled too so endpoints stay attached; all other shapes keep their height unless listed in scaleHeightShapeIds. Text, images and footers outside the band are untouched.

ParameterTypeDescription
bottomPt *numberBottom of the band to transform, in points.
scaleY *numberVertical scale factor, e.g. 0.7 = 30% shorter.
slide *integerSlide number, 1-based
topPt *numberTop of the band to transform, in points (slide is 960x540 pt).
newTopPtnumberWhere the top of the scaled band should land. Default: keep topPt.
presentationIdstringTarget presentation ID. Optional when only one presentation is connected.
scaleHeightShapeIdsarrayShape IDs (from scan_slide) whose height should scale with the band (e.g. the two big panel rectangles).

show_slide

Bring a slide into view in the live presentation (navigates the user to that slide). Call this BEFORE editing a slide so the user can watch the changes happen; also useful to walk the user through a deck slide by slide.

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide).
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

add_slide

Add a new slide from a layout at a specific position, with placeholder text pre-filled and shapes renamed to layout names. Use inspect_layouts to find available layout names and placeholder names. Returns the new slide number (1-based) and its placeholder shapes with semantic names.

ParameterTypeDescription
layoutName *stringLayout name from inspect_layouts (e.g. "Title and Content", "Section Header"). Case-insensitive match. Layouts starting with "_" are rejected (technical layouts).
placeholdersobjectMap of layout placeholder name → text content. E.g. {"section_title": "Backup Slides", "section_subtitle": "Evidence & appendix"}. Names must match layout placeholder names from inspect_layouts.
positioninteger1-based insertion position (position 1 = the new slide becomes the first slide; existing slides shift right). Default: append at end.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

duplicate_slide

Duplicate a slide within the same presentation. Exports the slide and reimports it at the specified position. Data stays server-side. The reimport makes PowerPoint view jump to the first slide.

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide), of the slide to duplicate
insertAfterSlideinteger1-based slide number to insert the duplicate after. Default: same as slide (duplicate appears right after the source).
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

copy_slides

Copies slides between two open presentations entirely server-side — the Base64 data never enters Claude context. Exports from the source presentation and inserts into the destination in a single operation. Both presentations must be connected to the bridge. Requires PowerPointApi 1.8.

ParameterTypeDescription
destinationPresentationId *stringDestination presentation ID from list_presentations
sourcePresentationId *stringSource presentation ID from list_presentations
sourceSlide *integerSlide number, 1-based (slide 1 = first slide), to copy from the source presentation
formattingstringFormatting mode. Default: KeepSourceFormatting.
targetSlideIdstringInsert after this slide ID in destination (format: "nnn#" or "#mmmmmmmmm" or "nnn#mmmmmmmmm"). If omitted, inserts at the beginning.

edit_shape_paragraphs

Replace paragraph content of a shape with raw OOXML <a:p> XML. Preserves <a:bodyPr> and <a:lstStyle>. Use read_shape_paragraphs first to get the current XML, modify it (using /pptx skill knowledge), then write it back. The slide is exported, modified server-side, and reimported — data never enters Claude's context. NOTE: the reimport deletes and reinserts the slide, but the view is restored to the edited slide afterwards. For text-only changes, execute_officejs still avoids the reimport entirely (in place via shape.textFrame.textRange).

ParameterTypeDescription
shapeId *stringShape ID from inspect_slide results
slide *integerSlide number, 1-based (slide 1 = first slide)
xml *stringThe <a:p> paragraph XML to replace the current text body content with
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

read_shape_paragraphs

Read raw OOXML <a:p> paragraphs from a shape's text body. Returns the paragraph XML as a string — preserves all formatting (bold, colors, bullets, etc.) that textRange.text strips. Use with the /pptx skill's OOXML knowledge to understand and modify the XML.

ParameterTypeDescription
shapeId *stringShape ID from inspect_slide results (e.g. "5")
slide *integerSlide number, 1-based (slide 1 = first slide), from scan_slide results
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

read_deck_text

Lightweight text extractor: returns slide titles and body text as plain strings (~20x smaller than inspect_slide). Use for content review, narrative analysis, or any read-only text task. Supports slideRange and optional speaker notes.

ParameterTypeDescription
includeNotesbooleanInclude speaker notes. Default: false.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
slideRangestringSlide numbers, 1-based, e.g. "1", "1-5", "2,4,7". Omit for all slides.

search_text

Search for text across all slides (or a slide range) in the presentation — like grep for slides. Searches shape text, table cells, and speaker notes. Returns matching shapes with context at the chosen level. Case-insensitive substring by default; supports regex.

ParameterTypeDescription
query *stringText to search for. Plain substring by default, or a regex pattern when regex=true.
caseSensitivebooleanCase-sensitive search. Default: false.
contextstringResult detail level. "shape" (default): matching shapes with text. "slide": all shapes on matching slides with matched markers. "none": just matching slide indices.
includeNotesbooleanSearch speaker notes in addition to slide content. Default: true.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
regexbooleanTreat query as a regular expression. Default: false (plain substring).
slideRangestringOptional slide range to search, e.g. "1-5" or "2-8". Slide numbers are 1-based. Omit to search all slides.

format_shapes

Apply formatting to multiple shapes on a slide in one call. Generates Office.js code internally. Use for fill color, font bold/italic/size/color/name. Cannot set corner radius or borders (use edit_slide_xml code mode for those). Runs in place (no slide reimport), so PowerPoint view position is preserved.

ParameterTypeDescription
shapes *arrayShapes to format with their properties
slide *integerSlide number, 1-based (slide 1 = first slide)
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

edit_slide_xml

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, but the view is restored to the edited slide afterwards — reserve this for structural changes (new shapes, layout rebuilds…

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide)
codestringJS 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. Mutuall…
explanationstringBrief description of what the code does (for logging, max 50 chars). Only used with code mode.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
shapeIdstringOptional shape ID (xml mode only). If provided, replaces only that shape's <p:sp> element instead of the full slide XML.
xmlstringModified XML — full slide XML or a single shape's <p:sp> element (when shapeId is provided). Mutually exclusive with 'code'.

edit_slide_zip

Update multiple files in the slide zip and reimport in a single operation. Accepts a map of { path: content } — can modify existing files or add new ones (e.g. chart XML + rels). Auto-registers Content_Types for new chart files. Use read_slide_zip first to get the current content.

ParameterTypeDescription
files *objectMap of { zipPath: newContent }. Can include existing paths (to modify) or new paths (to add). Example: { "ppt/slides/slide1.xml": "<p:sld>...</p:sld>", "ppt/charts/chart1.xml": "<c:chartSpace>...</c:c…
slide *integerSlide number, 1-based (slide 1 = first slide)
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

read_slide_xml

Read the full raw OOXML of a slide, or filter to a specific shape. Returns the slide's ppt/slides/slide1.xml content. Use with the /pptx skill's OOXML knowledge to understand the XML structure.

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide), from scan_slide results
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
shapeIdstringOptional shape ID to filter to. If provided, returns only that shape's <p:sp> element.

read_slide_zip

Read multiple files from the exported slide zip. Returns slide XML, relationships, chart XMLs, and Content_Types. Use this to inspect chart data, rels, or other zip contents beyond what read_slide_xml provides. When no paths specified, auto-discovers all text/XML files in the zip.

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide)
pathsarraySpecific zip paths to read (e.g. ["ppt/slides/slide1.xml", "ppt/charts/chart1.xml"]). If omitted, auto-discovers all text/XML files.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

edit_speaker_notes

Set speaker notes on one or more slides. Accepts markdown text (paragraphs, **bold**, *italic*). Converts to OOXML server-side and injects via single-slide reimport. Replaces all existing notes on the specified slides.

ParameterTypeDescription
notes *arrayArray of slide notes to set.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

read_speaker_notes

Read speaker notes from slides. Uses full-deck export (cached by revision) to parse notes from OOXML — Office.js has no notes API. Returns plain text per slide.

ParameterTypeDescription
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
slideRangestringSlide numbers, 1-based, e.g. "1", "1-5", "2,4,7". Omit to read all slides.

edit_slide_chart

Create a chart on a slide from structured data. Generates all OOXML automatically (chart XML, rels, graphic frame, Content_Types). Supports column, bar, line, pie, doughnut, and area charts with multiple series.

ParameterTypeDescription
categories *arrayCategory labels (x-axis or pie slices)
chartType *stringChart type
series *arrayData series
slide *integerSlide number, 1-based (slide 1 = first slide)
title *stringChart title
optionsobjectChart options
positionobjectChart position in points. Defaults to centered on slide.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

insert_image

Inserts an image onto a slide using Office.js setSelectedDataAsync with CoercionType.Image. Accepts a file path, URL, or raw base64 data. Optionally target a specific slide (the view stays there so the user sees the insert; call show_slide first per the view etiquette) and control position/size in points.

ParameterTypeDescription
source *stringFile path, URL, or base64 image data depending on sourceType
sourceType *stringHow to interpret source: "file" reads from disk, "url" fetches from network, "base64" uses data directly
colorstringHex color to tint SVG images (e.g. "#FF5733"). Only applies to SVG sources. Works best with mono/outline icons.
heightnumberImage height in points
leftnumberHorizontal position in points (1 point = 1/72 inch)
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.
slideintegerSlide number, 1-based (slide 1 = first slide), to navigate to before inserting. If omitted, inserts on the currently active slide.
topnumberVertical position in points
widthnumberImage width in points

get_local_copy

Returns a local file path for the presentation. For local files, returns the existing path. For SharePoint/cloud files, exports server-side and saves to a temp .pptx. Caches by revision number — re-exports only when the presentation has been saved since last export.

ParameterTypeDescription
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

search_fluent_icons

Search Microsoft Fluent UI icon library. Returns matching icons with svgBase64 ready for insert_image (sourceType: "base64") — the SVG content is fetched server-side so dead icon URLs can never break the workflow. Prefer mono (_M) variants for professional decks. Retry with synonyms if no good matches (e.g. "innovation" → "lightbulb", "security" → "shield").

ParameterTypeDescription
query *stringSearch query (e.g. "warning", "arrow down", "lightbulb")
includeSvgbooleanFetch the SVG content for each result (default true, capped at 6 fetches). Set false for a URL-only listing.
stylestringFilter by style: "regular" for mono/outline icons, "filled" for solid icons. Omit for both.
topintegerMax results to return (default 10)

execute_officejs

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. Edits run in place without reimporting the slide, so PowerPoint's current view position is preserved — prefer this over edit_shape_paragraphs / edit_slide_xml for text-only or f…

ParameterTypeDescription
code *stringOffice.js code to execute. Runs inside PowerPoint.run() with 'context' available. Use 'return' to send back a result.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

verify_slides

Run programmatic checks on a slide: detect overlapping shapes, out-of-bounds shapes, empty text, tiny shapes, unused placeholders, placeholder drift from layout defaults, and full-bleed background covers. Returns a list of issues found. Uses the same shape data as inspect_slide — no OOXML needed.

ParameterTypeDescription
slide *integerSlide number, 1-based (slide 1 = first slide)
checksarrayChecks to run. Default: all checks.
presentationIdstringTarget presentation ID from list_presentations. Optional when only one presentation is connected.

list_documents

Lists all Word documents currently connected to the bridge server. Shows document IDs (file paths for saved files, generated IDs for unsaved) and connection status. Use this to find the documentId to pass to other Word tools when multiple documents are open.

execute_wordjs

Execute arbitrary Office.js code inside the live Word document. The code runs inside Word.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. Common operations: read the body (context.document.body), insert paragraphs, search and replace, work with tables, read tracked changes.

ParameterTypeDescription
code *stringOffice.js code to execute. Runs inside Word.run() with 'context' available. Use 'return' to send back a result.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

inspect_document

Overview of the live document: paragraph count, section count, table count, inline picture count, and a preview of the first paragraphs with their styles. Use this first to orient yourself in an unfamiliar document.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
previewParagraphsintegerHow many paragraphs to preview. Default 10.

read_paragraphs

Read paragraphs of the document with their styles, paginated by offset and limit. Returns total count plus the requested slice.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
limitintegerMaximum paragraphs to return. Default 50.
offsetintegerFirst paragraph index to return. Default 0.

get_paragraph

Read one paragraph in full: text, style, alignment and font properties (name, size, bold, italic, color).

ParameterTypeDescription
index *integerZero-based paragraph index.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

insert_paragraph

Insert a new paragraph into the document, optionally with a style (e.g. "Heading 1", "Title", "Quote"). Insert at the start or end of the body, or before/after a given paragraph index. Returns the new paragraph count.

ParameterTypeDescription
text *stringParagraph text. Use empty string for a blank paragraph.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
indexintegerParagraph index for location beforeIndex/afterIndex.
locationstringWhere to insert. Default "end".
stylestringStyle name, e.g. "Heading 1", "Heading 2", "Title", "Quote", "Normal". Built-in names are matched locale-independently.

set_paragraph_text

Replace the text of one paragraph, keeping the paragraph itself (and optionally its style).

ParameterTypeDescription
index *integerZero-based paragraph index.
text *stringNew paragraph text.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

delete_paragraph

Delete one paragraph (text and paragraph mark) from the document.

ParameterTypeDescription
index *integerZero-based paragraph index.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

format_paragraph

Format one paragraph: style, alignment, and font (name, size, bold, italic, color, highlight color). Only provided properties are changed.

ParameterTypeDescription
index *integerZero-based paragraph index.
alignmentstringParagraph alignment.
boldbooleanBold text.
colorstringFont color as #RRGGBB.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
fontNamestringFont family, e.g. "Calibri".
fontSizenumberFont size in points.
highlightColorstringHighlight color as #RRGGBB. Use "#FFFFFF" to clear.
italicbooleanItalic text.
stylestringStyle name, e.g. "Heading 1". Built-in names matched locale-independently.

search_document

Search the document body for text. Returns up to 50 matches with a text snippet around each hit.

ParameterTypeDescription
text *stringText to find.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
matchCasebooleanCase-sensitive search. Default false.

replace_text

Find and replace text throughout the document. Returns the number of replacements made.

ParameterTypeDescription
find *stringText to find.
replace *stringReplacement text.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
matchCasebooleanCase-sensitive search. Default false.

insert_table

Insert a table at the end of the document, optionally pre-filled from a 2D array of strings. Returns row and column counts.

ParameterTypeDescription
columns *integerNumber of columns.
rows *integerNumber of rows.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
valuesarrayOptional 2D array of cell texts (rows x columns) to pre-fill the table.

read_table

Read all cell texts of a table as a 2D array.

ParameterTypeDescription
tableIndex *integerZero-based table index.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

set_table_cell

Write text into one table cell (replacing its content).

ParameterTypeDescription
column *integerZero-based column index.
row *integerZero-based row index.
tableIndex *integerZero-based table index.
text *stringNew cell text.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

insert_page_break

Insert a page break at the end of the document body.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

comment_on_paragraph

Add a comment to a paragraph (anchored on its text).

ParameterTypeDescription
index *integerZero-based paragraph index to comment on.
text *stringComment text.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

get_tracked_changes

List tracked changes (revisions) in the document: type (insertion/deletion), author, date and a text snippet. Read-only; Office.js cannot create tracked changes.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

get_selection

Read the current user selection (cursor) in the document.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

save_document

Save the document. If it has never been saved, Word applies its default save behavior (may prompt).

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

list_content_controls

List all content controls (template fields) in the document: id, title, tag, type, current text and placeholder. Use set_content_control_text with the id to fill them.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
tagstringOnly return content controls with this tag.
titlestringOnly return content controls with this title.

set_content_control_text

Replace the text of a content control (template field) identified by its id from list_content_controls. Optionally update its title and tag.

ParameterTypeDescription
id *integerContent control id from list_content_controls.
text *stringNew text for the content control.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
tagstringNew tag for the content control.
titlestringNew title for the content control.

read_comments

Read all comments in the document body: id, author, text, resolved state, date, and replies. Note: adding replies is not supported by the current Word.js API set.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

get_document_properties

Read the document metadata: title, author, subject, keywords, comments, category, creation and last-save dates.

ParameterTypeDescription
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

set_document_properties

Set document metadata (title, author, subject, keywords, comments, category). Only provided fields are changed.

ParameterTypeDescription
authorstringDocument author.
categorystringDocument category.
commentsstringDocument comments field.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
keywordsstringDocument keywords.
subjectstringDocument subject.
titlestringDocument title.

edit_table_columns

Add or delete columns of a table. Add: position "Before" inserts left of the first column, "After" right of the last column; optionally pre-fill with values (2D array, one column per entry). Delete: remove count columns starting at columnIndex (0-based). Note: some Word builds reject column operations with InvalidArgument.

ParameterTypeDescription
action *stringAdd or delete columns.
tableIndex *integerZero-based table index.
columnIndexintegerFor delete: first column index to remove.
countintegerNumber of columns (default 1).
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.
positionstringFor add: "Before" inserts at the left edge, "After" at the right edge.
valuesarrayFor add: cell texts as 2D array (rows x added columns).

set_table_cells

Set the text of multiple table cells in one call. Rows and columns are 0-based indices into the table.

ParameterTypeDescription
cells *arrayCells to update.
tableIndex *integerZero-based table index.
documentIdstringTarget document ID from list_documents. Optional when only one document is connected.

list_workbooks

Lists all Excel workbooks currently connected to the bridge server. Shows workbook IDs (file paths for saved files, generated IDs for unsaved) and connection status. Use this to find the workbookId to pass to other Excel tools when multiple workbooks are open.

execute_exceljs

Execute arbitrary Office.js code inside the live Excel workbook. The code runs inside Excel.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. Common operations: read/write ranges (workbook.worksheets), formulas, tables, charts. Cell references use A1 notation; values/formulas are returned as arrays matching the range shape.

ParameterTypeDescription
code *stringOffice.js code to execute. Runs inside Excel.run() with 'context' available. Use 'return' to send back a result.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

inspect_workbook

Overview of the live workbook: all worksheets (name, position, visibility, used-range address), all Excel tables (name, sheet, range), all named ranges, and all PivotTables (name, sheet). Use this first to orient yourself in an unfamiliar workbook.

ParameterTypeDescription
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

read_range

Read values, formulas and number formats from a range of the live workbook. Returns a 2D array (rows x columns) plus the range address and dimensions. Use "usedRange": true to read the whole used range of the sheet.

ParameterTypeDescription
includeFormulasbooleanInclude the formulas grid (default true).
includeNumberFormatbooleanInclude the number-format grid (default false).
rangestringA1 range address, e.g. "A1:C10" or "MyTable". Omit when usedRange is true.
sheetNamestringWorksheet name. Defaults to the active worksheet.
usedRangebooleanRead the entire used range of the worksheet instead of a specific address.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

write_range

Write values and/or formulas into a range of the live workbook. Accepts a 2D array (rows x columns) or a single scalar that fills the whole range. Formulas are set separately from values. Also supports setting the number format. Content in the target range is overwritten.

ParameterTypeDescription
range *stringA1 range address, e.g. "A1:C10".
formulas2D array of formula strings (e.g. "=SUM(A1:A10)"), or a single formula broadcast across the range.
numberFormatNumber format string (e.g. "0.00", "#,##0", "dd/mm/yyyy"), 2D array or single broadcast.
sheetNamestringWorksheet name. Defaults to the active worksheet.
values2D array of values, or a single scalar broadcast across the range.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

format_range

Format a range: font (name, size, bold, italic, underline, color), fill color, borders (all/outline with style, weight, color), alignment, wrap, and number format. Only the provided properties are changed.

ParameterTypeDescription
range *stringA1 range address, e.g. "A1:C10".
boldbooleanBold text.
borderColorstringBorder color as #RRGGBB. Default "#000000".
borderStylestringBorder line style. Default "Continuous".
bordersstringWhich borders to apply. "none" clears borders.
fillColorstringCell fill color as #RRGGBB, e.g. "#FFFF00".
fontColorstringFont color as #RRGGBB, e.g. "#FF0000".
fontNamestringFont family, e.g. "Calibri".
fontSizenumberFont size in points.
horizontalAlignmentstring
italicbooleanItalic text.
numberFormatstringNumber format string, e.g. "0.00%".
sheetNamestringWorksheet name. Defaults to the active worksheet.
underlinestringUnderline style.
verticalAlignmentstring
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.
wrapTextbooleanWrap text within cells.

set_dimensions

Set column widths and/or row heights for a range, in points. Optionally autofit columns or rows to their content.

ParameterTypeDescription
range *stringA1 range address, e.g. "A:A" or "1:10" or "A1:C10".
autofitColumnsbooleanAutofit column widths to content.
autofitRowsbooleanAutofit row heights to content.
columnWidthnumberColumn width in points.
rowHeightnumberRow height in points.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_worksheet

Add a new worksheet to the workbook, optionally at a specific position, and activate it. Returns the new sheet name and position.

ParameterTypeDescription
namestringName for the new worksheet. Auto-generated when omitted.
positionintegerZero-based position to insert at. Default: append at end.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

update_worksheet

Update an existing worksheet: rename it, move it to a position, change visibility, set the tab color, or activate it. Only provided properties are changed.

ParameterTypeDescription
sheetName *stringCurrent name of the worksheet to update.
activatebooleanMake this the active worksheet.
newNamestringNew name for the worksheet.
positionintegerZero-based position to move the sheet to.
tabColorstringTab color as #RRGGBB. Use "" to clear.
visibilitystringSheet visibility.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

delete_worksheet

Delete a worksheet from the workbook. This removes its contents permanently and can break formulas referencing it.

ParameterTypeDescription
sheetName *stringName of the worksheet to delete.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

sort_range

Sort a range by one or more columns. Fields are given as zero-based column offsets within the range.

ParameterTypeDescription
fields *arraySort fields, applied in order.
range *stringA1 range address to sort, e.g. "A2:D100" (include or exclude headers as needed).
hasHeadersbooleanTrue if the first row is a header row that should not be sorted. Default false.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

find_in_range

Find text in a range or the whole used range. Returns the address of the first match, or all matches as a (possibly multi-area) address string.

ParameterTypeDescription
text *stringText to find.
allbooleanReturn all matches instead of only the first. Default true.
completeMatchbooleanMatch the entire cell contents. Default false.
matchCasebooleanCase-sensitive search. Default false.
rangestringA1 range address to search. Defaults to the used range.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_table

Create an Excel table (ListObject) over a range. Returns the table name and range.

ParameterTypeDescription
range *stringA1 range address including headers, e.g. "A1:D20".
hasHeadersbooleanTrue if the first row contains headers. Default true.
namestringTable name. Auto-generated when omitted.
sheetNamestringWorksheet name. Defaults to the active worksheet.
stylestringBuilt-in table style name, e.g. "TableStyleMedium2".
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_chart

Create a chart from a range. Chart types: ColumnClustered, ColumnStacked, BarClustered, BarStacked, Line, LineMarkers, Pie, Doughnut, Area, XYScatterLines. Returns the chart name and title.

ParameterTypeDescription
range *stringA1 range address with the data (and labels) to plot.
chartTypestringChart type. Default ColumnClustered.
sheetNamestringWorksheet name. Defaults to the active worksheet.
titlestringChart title. Empty string removes the title.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_conditional_format

Add a conditional formatting rule to a range. Supports cellValue (compare with a formula and fill on match), colorScale (min/max gradient), dataBar, and iconSet rules.

ParameterTypeDescription
range *stringA1 range address.
ruleType *stringType of rule.
fillColorstringcellValue: fill color on match, as #RRGGBB. Default "#FFC7CE".
formula1stringcellValue: comparison value/formula, e.g. "0" or "=TODAY()".
formula2stringcellValue: second bound for Between/NotBetween.
iconSetStylestringiconSet: icon set style. Default ThreeTrafficLights1.
maxColorstringcolorScale: maximum color. Default "#63BE7B".
minColorstringcolorScale: minimum color. Default "#F8696B".
operatorstringcellValue: comparison operator.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_name

Define a named range (named formula) in the workbook, e.g. name "TaxRate" for "=Sheet1!$B$1".

ParameterTypeDescription
name *stringName to define, e.g. "TaxRate".
ref *stringReference formula, e.g. "=Sheet1!$A$1:$D$10".
commentstringOptional description.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

set_data_validation

Set a data validation rule on a range. Supports list, wholeNumber, decimal, textLength, and date rules.

ParameterTypeDescription
range *stringA1 range address.
type *stringValidation type.
allowBlankbooleanAllow blank cells. Default true.
formula1stringNumeric/date/textLength: bound value or formula.
formula2stringSecond bound for Between/NotBetween.
liststringList type: comma-separated values, e.g. "Low,Medium,High".
operatorstringNumeric/date/textLength: comparison operator.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

calculate_workbook

Force Excel to recalculate the workbook. Use after writes when you need formula results to be current before reading them back.

ParameterTypeDescription
typestringRecalculation type. Default "Recalculate".
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

insert_or_delete_range

Insert or delete a range, shifting existing cells. For insert, shift is Down or Right; for delete, Up or Left.

ParameterTypeDescription
action *stringWhether to insert or delete.
range *stringA1 range address to insert at or delete.
sheetNamestringWorksheet name. Defaults to the active worksheet.
shiftstringShift direction. Defaults: insert=Down, delete=Up.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

set_merge

Merge or unmerge cells in a range.

ParameterTypeDescription
action *stringWhether to merge or unmerge.
range *stringA1 range address.
acrossbooleanmerge: merge each row separately instead of one area. Default false.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

autofit_range

Autofit column widths and/or row heights of a range to their content.

ParameterTypeDescription
range *stringA1 range address, e.g. "A:F".
columnsbooleanAutofit column widths. Default true.
rowsbooleanAutofit row heights. Default true.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

add_comment

Add a threaded comment to a cell.

ParameterTypeDescription
cellAddress *stringCell reference including sheet, e.g. "Sheet1!A1".
text *stringComment text.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

refresh_pivottables

Refresh all PivotTables in the workbook. Use after data changes when pivot summaries must be current.

ParameterTypeDescription
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

set_worksheet_protection

Protect or unprotect a worksheet. Protection restricts user edits; cells formatted as locked are affected.

ParameterTypeDescription
protect *booleanTrue to protect, false to unprotect.
sheetName *stringWorksheet name.
passwordstringOptional password for the protection.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

read_threaded_comments

Read all threaded comments in the workbook: content, author, creation date, resolved state, and replies. Use reply_to_comment or resolve_comment with a comment id from this output.

ParameterTypeDescription
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

reply_to_comment

Add a reply to an existing threaded comment. Use the comment id from read_comments.

ParameterTypeDescription
commentId *stringComment id from read_comments.
text *stringReply text.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

resolve_comment

Resolve or reopen a threaded comment. Use the comment id from read_comments.

ParameterTypeDescription
commentId *stringComment id from read_comments.
resolved *booleanTrue to resolve, false to reopen.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

freeze_panes

Freeze rows and columns of a worksheet at a cell (everything above and left of the cell stays visible), or unfreeze. E.g. freezeAt "A2" freezes the first row, "B2" freezes row 1 and column A.

ParameterTypeDescription
freezeAt *string | nullCell reference to freeze at, e.g. "A2". Pass null to unfreeze.
sheetName *stringWorksheet name.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

replace_in_sheet

Find and replace text across a whole worksheet (substring match per cell by default). Returns the number of cells changed. Uses findAll so merged/hidden cells behave like the Excel UI.

ParameterTypeDescription
find *stringText to find.
replace *stringReplacement text.
completeMatchbooleanMatch the entire cell contents. Default false.
matchCasebooleanCase-sensitive search. Default false.
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

clear_range

Clear the contents and formatting of a range in the live workbook.

ParameterTypeDescription
range *stringA1 range address, e.g. "A1:C10".
sheetNamestringWorksheet name. Defaults to the active worksheet.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.

copy_range

Copy a source range to a target range in the live workbook. Copies values, formulas and formatting by default; valuesOnly copies just the results.

ParameterTypeDescription
source *stringA1 range address to copy from, e.g. "A1:C3".
target *stringA1 range address (top-left corner) to copy into, e.g. "E1".
sheetNamestringWorksheet name for both ranges. Defaults to the active worksheet.
valuesOnlybooleanCopy only the calculated values, not formulas or formatting.
workbookIdstringTarget workbook ID from list_workbooks. Optional when only one workbook is connected.