Skip to main content
Glama

Apply an edit plan

apply_plan
Destructive

Apply a DocumentPlan JSON to a Word document by connectionId and documentId, then save through the provider in Replace, NewVersion, or NewDocument mode.

Instructions

Apply a DocumentPlan JSON to (connectionId, documentId) and save through the provider. Returns {isValid, committed, writeOutcome, possibleOutput, receipt, sourceDocumentId, outputConnectionId, outputDocumentId, outputVersion, outputName, outputContentType, changes, errors, calculation}; non-applicable values are null. The receipt hashes the effective plan and exact input/output bytes and keeps the host-authenticated actor separate from the plan's display revision author. saveMode: 'Replace' (default, overwrites the source after an optimistic version check), 'NewVersion' (keeps the source and mints a new id under the same connection), 'NewDocument' (mints a fresh id with an optional newName for display). Plan-validation and operation-conflict failures have writeOutcome 'notWritten'. A provider failure after a write began may instead return 'unknown' or 'writtenNotRegistered' with possibleOutput; never retry those blindly or report the document unchanged until the host reconciles the possible output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newNameYes
planJsonYes
saveModeYesReplace
documentIdYes
connectionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.0
    • changedInput schema / properties / saveMode / default
      Previous value: -"NewVersion"New value: +"Replace"
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructive/non-idempotent annotations: it enumerates the full return object, explains the receipt hashing and actor separation, defines each writeOutcome including the dangerous 'unknown'/'writtenNotRegistered' states with possibleOutput, and explicitly forbids blind retries. No contradiction with destructiveHint=true or idempotentHint=false.

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 action and return shape, then moves to saveMode semantics and failure handling. The long inline enumeration of return keys is information-dense but borders on over-long; every clause still carries operational meaning.

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?

With no output schema and a high-risk destructive write, the description supplies the return shape, the outcome taxonomy, and the reconciliation guidance an agent needs. Nothing essential for correct invocation is missing.

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?

Schema coverage is 0%, so the description must compensate, and it does for saveMode, newName, and the connection/document pairing plus the planJson payload type. It never describes the DocumentPlan JSON structure or expected content, and it calls newName optional while the schema lists it as required.

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 precise verb+resource: apply a DocumentPlan JSON to a (connectionId, documentId) pair and persist it through the provider. The phrase 'and save through the provider' implicitly separates it from preview_plan/preview_document_merge, which do not commit.

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 concrete guidance for the saveMode choices (Replace default overwrites after an optimistic version check, NewVersion keeps the source, NewDocument mints a fresh id) and warns when not to retry. It never names preview_plan as the non-committing alternative, so the routing decision is only implied.

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