Skip to main content
Glama

edit_office_document

Destructive

Modify Office files by applying ordered operations: replace, delete, style, add text, charts, and tables. Save to a new file or overwrite the original with a backup.

Instructions

Legacy general-purpose editor kept for backward compatibility; for Excel use edit_excel_workbook and for PowerPoint use edit_presentation instead of this wide operation model. Still supports replace/delete/modify/style/add/clear on any type plus the Excel/PPT capability actions. Rewrites the file — when output_path is omitted the INPUT FILE IS OVERWRITTEN IN PLACE, so pass output_path or options {"backup": true} for a .bak copy. New documents belong to create_office_document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optionsNoTool options.
input_pathYesPath to the existing document.
operationsYesList of edit operations applied in order.
output_pathNoOutput path (defaults to the input file).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed29 schema fields changedv0.8.0
    • changedInput schema / $defs / EditOperation / properties / action / description
      Previous value: -"Operation type:\n- \"replace\": find old_text, replace with new_text (regex optional)\n- \"delete\": remove text matching target\n- \"modify\": find old_text, replace with new_text\n- \"style\": apply a style string to the whole document\n- \"add\": append text at a column (Excel)\n- \"clear\": clear document content"New value: +"Operation type. Only the listed fields are meaningful per action:\n- \"replace\": old_text, new_text, regex (all doc types)\n- \"delete\": target, regex (all doc types)\n- \"modify\": old_text, new_text (all doc types)\n- \"style\": style, apply_all (all doc types)\n- \"add\": text, column (Excel append; Word/PPT append paragraph)\n- \"clear\": (no fields)\n- \"write_cell\": cell, text (value), sheet_name, style, is_formula (Excel)\n- \"set_formula\": cell, formula, sheet_name (Excel)\n- \"freeze_panes\": range (Excel)\n- \"add_chart\": chart_type + chart_data_range (Excel) OR chart_type + chart_data (PPT), sheet_name (Excel)\n- \"conditional_format\": conditional_format OR range + cell_is opts (Excel)\n- \"data_validation\": data_validation OR range (Excel)\n- \"add_table\": rows (first row = header), slide_index (PPT)\n- \"add_picture\": path, slide_index (PPT)\n- \"add_shape\": slide_index, fill, line, shape_type (PPT)\n- \"apply_layout\": slide_index, layout (PPT)\n- \"set_transition\": slide_index, transition (PPT)\n- \"add_notes\": slide_index, notes (PPT)\n- \"add_slide\": layout (PPT, optional)\n- \"sort\": range, key_columns, orders, order (Excel)\n- \"add_sheet\": sheet_name (Excel)\n- \"set_range_style\": range, style (Excel)\n- \"number_format\": number_format (\"RANGE=FORMAT\", e.g. \"A1:A10=0.00%\")\nUnused fields for an action are ignored."
    • changedInput schema / $defs / EditOperation / properties / action / enum
      Previous value: -[
      -  "replace",
      -  "delete",
      -  "modify",
      -  "style",
      -  "add",
      -  "clear"
      -]New value: +[
      +  "replace",
      +  "delete",
      +  "modify",
      +  "style",
      +  "add",
      +  "clear",
      +  "write_cell",
      +  "set_formula",
      +  "freeze_panes",
      +  "add_chart",
      +  "conditional_format",
      +  "data_validation",
      +  "add_table",
      +  "add_picture",
      +  "add_shape",
      +  "apply_layout",
      +  "set_transition",
      +  "add_notes",
      +  "add_slide",
      +  "sort",
      +  "add_sheet",
      +  "set_range_style",
      +  "number_format"
      +]
    • addedInput schema / $defs / EditOperation / properties / cell
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Target cell reference, e.g. \"A1\" (Excel).",
      +  "title": "Cell"
      +}
    • addedInput schema / $defs / EditOperation / properties / cf_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Conditional format type (color_scale/data_bar/cell_is/formula).",
      +  "title": "Cf Type"
      +}
    • addedInput schema / $defs / EditOperation / properties / chart_data
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {},
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "PPT chart data for add_chart.",
      +  "title": "Chart Data"
      +}
    • addedInput schema / $defs / EditOperation / properties / chart_data_range
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Excel chart data range for add_chart.",
      +  "title": "Chart Data Range"
      +}
    • addedInput schema / $defs / EditOperation / properties / chart_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Chart type for add_chart.",
      +  "title": "Chart Type"
      +}
    • addedInput schema / $defs / EditOperation / properties / dv_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Data validation type (list/whole/decimal/date/text_length).",
      +  "title": "Dv Type"
      +}
    • addedInput schema / $defs / EditOperation / properties / fill
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Shape fill color hex (add_shape).",
      +  "title": "Fill"
      +}
    • addedInput schema / $defs / EditOperation / properties / formula
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Excel formula string (set_formula).",
      +  "title": "Formula"
      +}
    • addedInput schema / $defs / EditOperation / properties / formula1
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Data validation formula1 (e.g. \"yes,no\").",
      +  "title": "Formula1"
      +}
    • addedInput schema / $defs / EditOperation / properties / formula2
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Data validation formula2 (e.g. upper bound).",
      +  "title": "Formula2"
      +}
    • addedInput schema / $defs / EditOperation / properties / is_formula
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "write_cell only: true stores text as a formula (must start with \"=\"), false forces a literal string even when it starts with \"=\", omitted keeps the automatic behaviour.",
      +  "title": "Is Formula"
      +}
    • addedInput schema / $defs / EditOperation / properties / key_columns
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "0-based sort key columns (sort).",
      +  "title": "Key Columns"
      +}
    • addedInput schema / $defs / EditOperation / properties / layout
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Slide layout name/index (apply_layout).",
      +  "title": "Layout"
      +}
    • addedInput schema / $defs / EditOperation / properties / line
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Shape line color hex (add_shape).",
      +  "title": "Line"
      +}
    • addedInput schema / $defs / EditOperation / properties / notes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Speaker notes text (add_notes).",
      +  "title": "Notes"
      +}
    • addedInput schema / $defs / EditOperation / properties / number_format
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Number format spec \"RANGE=FORMAT\" (number_format).",
      +  "title": "Number Format"
      +}
    • addedInput schema / $defs / EditOperation / properties / order
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Single sort order asc/desc (sort).",
      +  "title": "Order"
      +}
    • addedInput schema / $defs / EditOperation / properties / orders
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Per-key sort orders asc/desc (sort).",
      +  "title": "Orders"
      +}
    • addedInput schema / $defs / EditOperation / properties / path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Image path (add_picture).",
      +  "title": "Path"
      +}
    • addedInput schema / $defs / EditOperation / properties / range
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Cell range for freeze_panes/conditional_format/data_validation/add_chart (Excel).",
      +  "title": "Range"
      +}
    • addedInput schema / $defs / EditOperation / properties / rows
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {},
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Table rows for add_table (PPT). First row is the header.",
      +  "title": "Rows"
      +}
    • addedInput schema / $defs / EditOperation / properties / shape_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Autoshape type (add_shape), e.g. rectangle/oval/arrow/line.",
      +  "title": "Shape Type"
      +}
    • addedInput schema / $defs / EditOperation / properties / sheet_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Target worksheet (Excel).",
      +  "title": "Sheet Name"
      +}
    • addedInput schema / $defs / EditOperation / properties / slide_index
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Target slide index (PPT add_table/add_chart).",
      +  "title": "Slide Index"
      +}
    • changedInput schema / $defs / EditOperation / properties / text / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / $defs / EditOperation / properties / text / description
      Previous value: -"Text to add (add)."New value: +"Text to add (add) or scalar value to write (write_cell; formulas start with \"=\")."
    • addedInput schema / $defs / EditOperation / properties / transition
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Transition name (set_transition).",
      +  "title": "Transition"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / $defs / ToolOptions / properties / action
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "compare",
      +        "snapshot",
      +        "list_snapshots",
      +        "restore"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Sub-operation for compare_documents: \"compare\" (default) diffs two documents; \"snapshot\" records path_a state; \"list_snapshots\" lists recorded snapshots; \"restore\" writes a snapshot back to path_b.",
      +  "title": "Action"
      +}
    • addedInput schema / $defs / ToolOptions / properties / snapshot_dir
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Directory to store/read document snapshots (default: ~/.tianshang-scribe/snapshots/).",
      +  "title": "Snapshot Dir"
      +}
    • addedInput schema / $defs / ToolOptions / properties / snapshot_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Snapshot identifier used by the restore action.",
      +  "title": "Snapshot Id"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "edit_office_documentDictOutput",
      +  "type": "object"
      +}
  3. First observedv0.3.0

TDQS

A3.9/5.0
Behavior2/5

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

No annotations are provided to indicate read-only or destructive nature meaningful. The description only states it edits Word documents without describing side effects, reversibility, or whether it overwrites the source file, which is a significant gap for an edit tool.

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

Conciseness5/5

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

A single concise sentence that states the tool's purpose and names alternatives. Clear and efficient.

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?

The description gives purpose and alternative routing but lacks behavioral details like output format, mutation of input, or return value. With no destructive/read-only hints beyond the false flags, the agent relies on the schema for specifics.

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?

The schema provides detailed per-operation parameter descriptions with 100% coverage illustration. The description itself adds little parameter detail, relying on the schema, which is acceptable given the coverage. Slight deduction because the description does not summarize the key operation fields.

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?

The description clearly identifies the tool as an editor for office documentsaisôcienta and specifies it can still edit Word documents, while naming the sibling tools for Excel and PPT. An agent can readily distinguish it from related tools.

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?

Explicitly instructs to use edit_excel_workbook or edit_presentation instead for Excel/PPT, leaving no ambiguity about when this tool should be used.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tianshang301/TianshangScribe'

If you have feedback or need assistance with the MCP directory API, please join our Discord server