Skip to main content
Glama
chaosst

doc-fine-tuning-mcp

by chaosst

apply_edit

Apply precise edits to Word, Excel, or PowerPoint documents at specified locations, with automatic backup and version history. Supports replace, append, prepend, insert, and delete modes.

Instructions

对指定位置应用修改(首次编辑前自动生成 .bak-<时间戳> 备份;同一标注轮次内只有第一次编辑会快照到版本历史,其余编辑复用该版本——一轮多个标注只产生一个版本,版本描述会汇总本轮全部修改)。mode 缺省 replace;引擎错误返回结构化错误。返回 {ok, loc, new_content, version}(version 为 null 表示本轮已快照过、未新增版本;version.desc 表达该快照为'修改前/该轮标注前的状态'——会话场景为'第 N 轮标注前的状态(本轮修改:…)',无会话为'修改前:<编辑摘要>',回退到该版本即恢复为此内容)。修改成功后,该文档的标注窗口会自动重载展示最新内容(无需再手动调用 annotate_document);用户检查后可能继续标注,此时应再次调用 wait_for_annotations 获取下一轮标注。若修改后发现内容异常,可用 list_versions / restore_version 回退到修改前再重新生成。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locYes统一位置描述符(docs/contracts.md §2):docx-paragraph / docx-cell / xlsx-cell / xlsx-range / pptx-shape / pptx-shape-paragraph
modeNo编辑模式,缺省 replace
pathYes文档绝对路径
styleNo格式样式提示(可选字段;缺省表示保持原样)
session_idNo(建议)标注会话 ID(wait_for_annotations 返回)。提供后窗口重载精确绑定该会话,且同一轮内的多次编辑会合并为一个版本快照
new_contentNo新内容(mode=delete 时忽略,可为空字符串)
Install Server

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description fully discloses the mutation behavior: automatic .bak-<timestamp> backup before first edit, version snapshot only on the first edit of a round, later edits reusing that snapshot, and version.desc representing the pre-edit state. It also discloses structured engine errors, the exact return shape, the auto-reload side effect, and a rollback path.

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 front-loads the core purpose in the first clause and every subsequent sentence adds a distinct operational fact: backup generation, version collapsing, return values, auto-reload behavior, and rollback. It is dense but contains no filler or repeated schema information.

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?

For a mutating tool with six parameters, nested objects, and no output schema, the description defines the return tuple, version semantics, backup and rollback path, and follow-up workflow with wait_for_annotations. No critical input needed to call the tool or react to its result is missing; only the exact structured-error shape is summarized rather than enumerated.

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 description coverage is 100%, so the baseline is 3; the description adds meaningful semantics beyond the schema: mode defaults to replace, delete ignores new_content, and session_id causes same-round edits to merge into one version snapshot. It also explains the meaning of version and version.desc in the response, which the input schema does not cover.

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 states a specific operation: '对指定位置应用修改' (apply modifications at a specified location), immediately clarifying that this is a location-targeted edit tool. It also distinguishes its workflow from annotate_document by stating that the annotation window reloads automatically, and the loc-kind list reinforces that this is structural-position editing rather than a template or search operation.

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?

The description provides strong workflow guidance: call this after receiving annotations, do not manually call annotate_document afterward, call wait_for_annotations again for the next round, and use list_versions/restore_version if the edit result is wrong. It does not explicitly compare against template_replace or find_replace, so the selection boundary among sibling edit tools is left somewhat to inference.

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

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/chaosst/doc-fine-tuning-mcp'

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