Skip to main content
Glama

Edit several documents

edit_documents
Destructive

Apply one edit plan to multiple Word documents at once, such as renaming a company or updating a term across a folder, with preview before saving and per-document atomic writes.

Instructions

Apply one plan to several documents in one call - rename a company, update a disclaimer, or change a term across a folder. sources lists up to 100 documents, each exactly as edit_document takes source; list the folder yourself first. Name text with "match": "all" so each document changes wherever the text appears: { "op": "changeText", "target": { "find": "Acme Corp", "match": "all", "caseSensitive": true }, "with": "Globex Inc." }. find ignores case and matches inside words unless the target adds "caseSensitive": true or "wholeWord": true; a rename usually wants both. Each document is edited on its own and atomically: one that fails is left untouched and the others still save. A document in which no "match": "all" target matched is reported as unchanged and not saved. Run with preview=true first to see every document's changes without writing anything, then again without it. The plan cannot carry a snapshot. saveMode behaves as in apply_plan; NewDocument keeps each source and saves a new copy beside it. Returns {isValid, preview, summary: {total, committed, previewed, unchanged, failed, notAttempted}, items}; each item is {source, status} followed by exactly what edit_document returns for that document, receipt included.

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": {
      "connectionId": "<connectionId>",
      "sources": "<sources>",
      "planJson": "<planJson>",
      "preview": "<preview>",
      "saveMode": "<saveMode>"
    },
    "name": "edit_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
previewYes
sourcesYes
planJsonYes
saveModeYesReplace
connectionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare destructive=true and non-idempotent; the description adds substantial context beyond that: per-document atomicity ('one that fails is left untouched and the others still save'), the no-match case being reported as unchanged and not written, and the snapshot prohibition. It even documents the non-obvious NewDocument copy-beside-source behavior.

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 purpose, then mechanics, then return shape — a logical order. The inline JSON example and the case-sensitivity/whole-word note both earn their space, but the single dense paragraph could be split for scanability.

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?

Despite no output schema, the description enumerates the return shape (isValid, preview, summary counters, items with source/status plus edit_document's per-document payload). Combined with atomicity, preview workflow, and saveMode notes, an agent has everything needed to call it safely.

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

Parameters4/5

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

With 0% schema description coverage the description must carry all five parameters, and it explains four well: sources (up to 100, same shape as edit_document), planJson (with a concrete op/target/with example plus caseSensitive and wholeWord semantics), preview (dry-run toggle), and saveMode (delegated to apply_plan, NewDocument spelled out). connectionId is never mentioned, and saveMode's full value set is left to the schema default.

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?

Opens with a specific verb and scope: 'Apply one plan to several documents in one call', then concretizes with rename/disclaimer/term-replacement examples. It is clearly distinguishable from the singular edit_document (sources 'each exactly as edit_document takes source') and from apply_plan (referenced for saveMode semantics).

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 an explicit workflow ('Run with preview=true first ... then again without it'), a prerequisite ('list the folder yourself first'), and a restriction ('The plan cannot carry a snapshot'). It also routes the reader to edit_document for per-source format and apply_plan for saveMode behavior.

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