Skip to main content
Glama

apply_changes_from_file

Idempotent

Apply changes from a JSON file to a .docx document as tracked changes with comments, enabling large or reusable change sets.

Instructions

Same as apply_changes but reads the change list from a JSON file.

Useful for large change sets that would exceed token limits in a direct tool call, or for reusing a change set across multiple runs.

The JSON file must contain either a bare array of change objects, or an object with a "changes" key::

 [
   {"fragment_id": 1, "change_type": "modify", "new_text": "..."},
   {"cell_id": "2.1.1", "change_type": "modify_cell", "new_text": "..."}
 ]

See apply_changes for change object schema and rules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorNoAuthor name for tracked changes and comments. Defaults to "AI Review".AI Review
output_pathNoWhere to save the redlined document. Defaults to ``<stem>_redlined.docx`` beside the input file.
changes_fileYesAbsolute path to the JSON file containing changes.
document_pathYesAbsolute path to the input .docx file.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description adds valuable context beyond the annotations by detailing the required JSON file format (bare array or object with 'changes' key) and providing an example. It also references apply_changes for rules. Annotations already indicate idempotency and non-destructiveness, so the description complements rather than repeats them. No contradictions.

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?

The description is efficient and well-organized: a lead reference to the sibling tool, explicit use cases, and a compact example of the file format. Every sentence earns its place without redundancy or fluff.

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?

Given the schema covers all parameters and the description provides usage scenarios, file format requirements, and a pointer to apply_changes for the change-object schema, the tool is fully contextualized. The presence of an output schema further reduces the need for the description to explain return values. This is a complete package for a tool of this complexity.

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 descriptions for all four parameters (100% coverage), so the description doesn't need to explain them. It adds minimal value for parameters beyond the changes_file example, which illustrates content but not the parameter meaning. The baseline 3 is appropriate since the schema does the heavy lifting.

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 states the tool is 'Same as apply_changes but reads the change list from a JSON file,' immediately distinguishing it from the sibling apply_changes. It specifies the action (applying changes) and the resource (document with changes from a file), leaving no ambiguity about its purpose.

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?

The description explicitly identifies when to use this tool: 'for large change sets that would exceed token limits in a direct tool call, or for reusing a change set across multiple runs.' It also directs users to apply_changes for schema and rules, implicitly providing the alternative context. This is clear usage guidance.

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

Install Server

Other Tools

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/sontanon/docx-mcp'

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