Skip to main content
Glama
chaosst

doc-fine-tuning-mcp

by chaosst

doc-fine-tuning-mcp —— opencode 사무 문서 정밀 수정 마커

opencode용 MCP server: LLM이 사무 문서를 정밀 수정해야 할 때, 별도 브라우저 앱 창에서 문서를 시각적으로 열어, 사용자가 문단 전체를 클릭(또는 연속 문자열을 드래그 선택하여 더 정밀하게 마킹)하고 각 위치의 수정 프롬프트를 입력하면, 한 번에 여러 곳을 마킹할 수 있습니다. 완료 후 agent에게 넘겨주면 LLM이 사용자의 프롬프트에 따라 각 위치를 수정합니다. 마킹 창은 agent의 취소/종료 시 자동으로 닫히며, 동일 문서의 다중 라운드 마킹 시 동일 창을 재사용하여 자동으로 다시 로드됩니다.

지원 형식: .docx / .xlsx / .pptx(OOXML). v1은 구형식(.doc/.xls/.ppt)을 지원하지 않습니다.

작업 흐름

用户对 opencode 说:把 D:\报告.docx 的第 3 段和标题改得更正式
   │
   ▼
opencode 插件 doc-edit-listener 检测到"文档精细修改意图",注入引导
   │
   ▼
LLM 调用 doc-edit_annotate_document("D:\报告.docx")
   │   → 本地 HTTP 服务启动,独立浏览器应用窗口打开标注页 http://127.0.0.1:<port>/?session=xxx
   │   (同一文档再次标注:复用该窗口自动重载,不重开新窗口)
   ▼
你在页面上:看到文档 → 点击整段/单元格/形状(或拖选连续字符串)→ 输入提示词 → 继续标注下一处 → 点【完成】
   │   (标注以 loc + prompt 形式提交给服务端;完成后 agent 窗口重新聚焦)
   ▼
LLM 调用 doc-edit_wait_for_annotations 拿到全部标注
   │   (若窗口被关闭:返回 status=closed + reason,LLM 据此决定重开或询问你)
   ▼
LLM 对每个标注:doc-edit_read_location 读取原文 → 依据提示词生成新内容
   │   → doc-edit_apply_edit 应用修改(首次自动备份 .bak-<时间戳>)
   ▼
标注窗口自动重载(服务端推送),展示修改后的最新文档供你检查
   │   → LLM 再次 doc-edit_wait_for_annotations 等待下一轮标注(多轮循环)
   ▼
你点【完成】且无标注 / 点【取消】/ 关闭窗口 → 修改流程结束

Related MCP server: MCP Word Commander

아키텍처

opencode
 ├─ 插件 doc-edit-listener(监听消息 → 检测修改意图 → 注入引导)
 └─ MCP 客户端 ──stdio──► doc-edit MCP server(Node/TS, @modelcontextprotocol/sdk)
                          ├─ 标注工具:annotate_document / wait_for_annotations / cancel_session
                          ├─ 编辑原语:read_structure / read_location / apply_edit
                          ├─ 本地 HTTP 服务(127.0.0.1:动态端口)→ H5 标注页 + API
                          └─ Python 编辑引擎(python-docx / openpyxl / python-pptx)
  • 위치 지정의 일관성: 페이지에서 사용자가 클릭한 위치(loc)는 JS 측에서 OOXML을 순회하여 생성하며, Python 엔진은 동일한 순회 알고리즘으로 위치를 파싱합니다. tests/parity 테스트로 양측의 loc→텍스트 매핑이 완전히 일치함을 보장합니다(특히 Word 표 내 문단, PPT 다중 도형).

  • 실행 주체는 LLM: 새 콘텐츠를 생성하는 모든 단계는 LLM이 사용자의 프롬프트에 기반하여 수행합니다. MCP server는 "페이지 열기, 마킹 수집, 위치별 파일 읽기/쓰기"만 담당합니다.

설치

1. 프로젝트 클론 및 의존성 설치

cd D:\develop\doc-fine-tuning-mcp
npm install
# Python 编辑引擎(创建 .venv 并安装 python-docx/openpyxl/python-pptx)
cmd //c scripts\\setup_venv.bat

2. 빌드

npm run build          # 编译 src → dist/(MCP server)
cd web && npm install && npm run build   # 构建 H5 标注页 → web/dist/

3. MCP server를 opencode에 등록

~/.config/opencode/opencode.jsoncmcp 블록에 추가(개발 모드, 로컬 빌드 산출물을 가리킴):

"doc-edit": {
  "type": "local",
  "command": ["node", "D:/develop/doc-fine-tuning-mcp/dist/index.js"],
  "enabled": true
}

배포 모드(선택): npm pack으로 tgz를 생성한 후 npx -y --package <경로>/doc-fine-tuning-mcp-<버전>.tgz doc-fine-tuning-mcp로 변경하면 프로젝트 내 다른 MCP와 동일하게 사용할 수 있습니다.

4. 리스너 플러그인 설치

플러그인은 두 파일로 구성됩니다: doc-edit-listener.ts와 그 의존성인 감지 모듈 lib\detect.ts. opencode 플러그인 디렉터리는 그 아래의 .ts 파일을 자동으로 플러그인으로 스캔하지만, 하위 디렉터리는 재귀적으로 스캔하지 않으므로 detect.tslib\ 하위 디렉터리에 두면 독립 플러그인으로 오인되지 않습니다.

copy plugin\doc-edit-listener.ts %USERPROFILE%\.config\opencode\plugin\doc-edit-listener.ts
mkdir %USERPROFILE%\.config\opencode\plugin\lib
copy plugin\lib\detect.ts %USERPROFILE%\.config\opencode\plugin\lib\detect.ts

⚠️ 플러그인 모듈은 플러그인 자체만 내보낼 수 있습니다(default). doc-edit-listener.ts에 명명된 함수를 추가로 내보내지 마세요. 그렇지 않으면 opencode가 이를 추가 훅/플러그인으로 간주하여 로드 실패 및 "Unexpected server error"가 발생합니다 (hooks가 비워지면서 Provider.defaultModel 크래시로 이어짐). 감지 로직은 항상 lib/detect.ts에 두세요.

플러그인은 @opencode-ai/plugin에 의존합니다(~/.config/opencode/node_modules에 1.18.11이 내장됨). opencode를 재시작하면 적용됩니다.

5. 엔드투엔드 자체 점검

npm test                  # 引擎 / parity / mcp 客户端 / 插件 全部测试
node scripts/e2e-verify.ts   # 输出 PASS 即闭环可用

MCP 도구 설명

도구

입력 파라미터

설명

annotate_document

path

별도 마킹 창을 열고, 마킹 세션을 생성/재사용하며 {session_id, url} 반환

wait_for_annotations

session_id, timeout_seconds?

done/cancelled/closed/timeout까지 블로킹, 마킹 목록 + user_actions(사용자 롤백 등 작업, LLM이 수정을 요약하는 데 사용) 반환

cancel_session

session_id

마킹 세션 취소

read_structure

path, max_items?

문서 개요(docx는 문단별 / xlsx는 시트별 샘플링 / pptx는 페이지별 도형)

read_location

path, loc

지정 위치 원문 + 인접 컨텍스트(docx locrange가 있으면 부분 문자열 반환)

apply_edit

path, loc, new_content, mode?, style?

수정 적용(docx locrange가 있으면 해당 부분 문자열만 교체, 최초 자동 백업 .bak-<타임스탬프>)

template_replace

path, variables

{{변수}} 플레이스홀더 일괄 교체(docx 전용, run 경계를 넘어도 교체 가능, {matched, replaced, missing_vars, applied} 반환)

find_replace

path, find, replace, match_case?

전체 텍스트 찾기/바꾸기(docx 전용, 일반 문자열, 정규식 아님, {matched, replaced, locations} 반환)

preview_edits

path, edits

수정 일괄 미리보기(메모리에서만 적용, 디스크에 쓰지 않음, 각 위치의 {loc, before, after} 반환)

list_versions

path

버전 이력 나열(apply_edit 전마다 <path>.versions/에 자동 스냅샷, 새 버전이 앞에 옴, 작업 유형/사람이 읽을 수 있는 설명/시간 포함)

restore_version

path, index

지정 버전으로 롤백(롤백 전에 현재 상태를 먼저 스냅샷하므로 되돌릴 수 있음)

mode: replace / append / prepend / insert_after / delete. style(선택): { bold, italic, sizePt, color }.

참고: template_replace / find_replace의 교체는 run 수준 형식 보존을 사용합니다. 교체 구간이 서로 다른 형식의 여러 run을 걸칠 때, 새 텍스트는 소스 run 문자 가중치에 따라 분할되어 각 run의 형식을 상속합니다(첫 run 형식만 유지하는 것으로 퇴화하지 않음).

위치 설명자 loc

페이지 클릭으로 생성된 loc는 "어디를 수정할지"의 유일한 증명이며, 여섯 가지 유형이 있습니다:

| { kind: "docx-paragraph",       paraIndex }                  // Word 段落(body 文档序,0-based)
| { kind: "docx-cell",            tableIndex, rowIndex, colIndex, paraIndex }   // Word 表格内段落
| { kind: "xlsx-cell",            sheet, row, col }            // Excel 单元格(1-based,同 A1)
| { kind: "xlsx-range",           sheet, row1, col1, row2, col2 }
| { kind: "pptx-shape",           slideIndex, shapeIndex }     // PPT 形状(1-based)
| { kind: "pptx-shape-paragraph", slideIndex, shapeIndex, paraIndex }

사용 설명 및 팁

  • LLM은 다음을 수행해야 합니다: 먼저 annotate_document로 사용자가 마킹하게 함 → wait_for_annotations로 마킹 수집 → 각 마킹에 대해 read_location으로 원문 확인 → 프롬프트에 따라 새 콘텐츠 생성 → apply_edit. 수정 위치를 추측하지 마세요.

  • 버전 이력 오류 수정: apply_edit 전마다 문서가 <path>.versions/에 스냅샷됩니다. 수정 후 내용이 비정상적이면(교체 결과가 프롬프트와 불일치, 사용자가 특정 라운드 결과에 불만) list_versions로 스냅샷을 확인하고 restore_version으로 수정 전으로 되돌린 후 다시 생성하세요. 롤백 후 이전 마킹의 loc 인덱스가 무효화될 수 있으므로 read_location으로 다시 확인하거나 사용자에게 다시 마킹을 요청하세요(첫 라운드에서의 롤백이 가장 유용합니다 — 마킹이 여전히 원본 문서를 기반으로 하기 때문). 마킹 창 사이드바의 「기록」 탭에서도 버전 체인(각 항목에 작업 설명/시간/크기 포함)을 직접 확인하고 원클릭 롤백할 수 있습니다. 사용자의 롤백 작업은 세션 user_actions에 기록되어 wait_for_annotations와 함께 반환됩니다 — LLM은 user_actions에 restore가 포함된 것을 보면 문서가 롤백되었고 이후 수정이 무효화될 수 있음을 인지하고 확인 후 계속 진행하세요.

  • 대기 폴링(타임아웃 없음): wait_for_annotations는 기본적으로 타임아웃이 없습니다(사용자가 제출/취소/창 닫기 또는 agent 종료까지 대기). 일부 클라이언트는 단일 도구 호출에 타임아웃 상한(약 60초)이 있어 단일 호출이 잘릴 수 있습니다 — 도구를 다시 호출하면 계속 대기하며, 세션이 잘려서 취소되지는 않습니다.

  • 창 닫기: 사용자가 마킹 창을 닫으면 wait_for_annotationsclosed + reason(window_closed / page_unload / window_lost / agent_cancelled / agent_exited)을 반환합니다. LLM은 원인에 따라 마킹을 다시 열거나(annotate_document 재호출) 사용자에게 물어봐야 합니다.

  • 창 자동 재로드(푸시 모드): apply_edit / template_replace / find_replace / restore_version 수정이 성공할 때마다 서버가 해당 문서의 마킹 창에 자동으로 재로드를 푸시(약 2초 디바운스, 연속 수정은 한 번으로 병합)하여 창이 즉시 수정된 최신 내용을 표시합니다 — LLM이 annotate_document를 다시 수동 호출할 필요가 없습니다.

  • 스크롤 시야 유지: 재로드 후 페이지는 이전 읽기 위치로 돌아갑니다(시야 앵커링 — 뷰포트 상단 근처의 내용을 기록하고 오프셋에 따라 복원, 단순히 맨 위로 돌아가지 않음). xlsx의 현재 시트와 pptx의 현재 페이지도 유지됩니다.

  • 다중 대화에서 server 창 소유권 공유: WorkBuddy 등 클라이언트는 전역적으로 동일한 MCP server 프로세스를 공유하므로, 모든 대화의 마킹 세션이 같은 프로세스에 섞입니다. 수정 후 다른 대화의 창으로 재로드되는 것을 방지하기 위해, LLM은 wait_for_annotations에서 마킹을 받은 후 반환된 session_id그대로 apply_edit 등 수정 도구에 전달해야 합니다(도구는 이 선택적 파라미터를 지원). 서버는 이를 기반으로 이 세션의 창만 정확히 재로드합니다. 전달하지 않으면 서버가 "최근 활성 세션"으로 폴백하며, 경로에 여러 활성 세션이 있으면 재로드하지 않습니다(오작동 방지). 동일 문서의 마킹 창은 공유 server에서 재사용되므로, 같은 시점에 한 대화에서만 동일 문서를 조작하는 것이 좋습니다.

  • 동일 문서 재사용: 동일 문서에 대해 annotate_document를 다시 호출하면 기존 창을 재사용하여 자동 재로드됩니다(페이지가 최신 파일을 다시 가져오고 이전 라운드 마킹을 지움). 새 창을 열지 않습니다.

  • 다중 라운드 마킹 루프: agent가 한 라운드의 마킹을 처리한 후 창이 자동 재로드되어 사용자가 수정을 확인하고 계속 마킹할 수 있습니다. agent는 wait_for_annotations를 다시 호출하여 다음 라운드를 기다려야 합니다. 창에서 【완료】를 클릭하고 마킹을 추가하지 않으면 이번 라운드에 더 이상 수정할 것이 없음을 의미합니다. 【취소】를 클릭하면 창을 직접 닫고 이번 라운드를 종료합니다(wait_for_annotations가 이에 따라 중지).

  • 문자열 수준 마킹: Word 페이지에서 연속 문자열을 드래그 선택하면 마킹이 해당 문자열(loc.range)에 정확히 지정됩니다. apply_edit는 그것만 교체합니다.

  • 취소: 사용자가 페이지에서 【취소】를 클릭하거나 LLM이 cancel_session을 호출하면 세션이 cancelled로 설정되고 마킹 창이 직접 닫힙니다. agent 프로세스가 종료되면 모든 마킹 창이 자동으로 닫힙니다.

  • 수정은 비파괴적입니다: 첫 편집 전에 자동으로 문서명.bak-<타임스탬프>가 생성되고, 매 수정 전에 <path>.versions/ 버전 체인에 자동 스냅샷됩니다(list_versions / restore_version으로 임의 단계로 롤백 가능).

알려진 제한 사항

  • .docx / .xlsx / .pptx(OOXML)만 지원합니다.

  • Word: docx-preview 렌더링 순서와 body 순회 순서가 1:1이라고 가정합니다(극단적인 레이아웃 요소에서는 편차가 있을 수 있음, web/src/viewers/docxViewer.ts 상단 주석 참조).

  • PPT: 도형 위치는 텍스트 매칭으로 폴백하며, 도형 텍스트가 중복되면 부정확할 수 있습니다.

  • Excel: SheetJS + 경량 그리드. 셀 더블클릭으로 페이지 내 편집 지원(수정 항목이 마킹으로 반환되어 LLM이 적용). 병합 셀의 비좌상단 셀은 읽기 전용. 수식 셀을 직접 편집하면 수식이 일반 값으로 교체됩니다.

  • 세션 상태는 메모리에 있으므로 MCP server 재시작 시 소멸됩니다.

FAQ

Q: 브라우저가 자동으로 열리지 않나요? A: 마킹 페이지는 Chrome/Edge의 별도 앱 창(주소 표시줄/도구 모음/탭 없음)에서 열립니다. Chrome/Edge를 찾지 못하거나 시작에 실패해도 도구는 여전히 url을 반환하므로, LLM이 링크를 보내주면 수동으로 열면 됩니다(이 경우 창 닫기 감지는 페이지 하트비트로 퇴화).

Q: 마킹 창이 왜 스스로 닫히나요? A: Esc로 agent를 취소하거나 agent/opencode 프로세스가 종료되면 서버가 마킹 창을 능동적으로 닫습니다. 페이지에서 【완료】나 【취소】를 클릭하면 창은 읽기 전용으로 유지되어 재사용을 기다립니다(동일 문서의 다음 라운드에서 바로 재로드).

Q: 마킹 페이지가 열리지 않거나 / 흰 화면이 나오나요? A: cd web && npm run build를 실행했는지 확인하세요(서버는 web/dist가 없으면 플레이스홀더 안내 페이지만 반환). 문서 경로가 절대 경로이고 파일이 존재하는지 확인하세요.

Q: 플러그인이 왜 필요한가요? A: 플러그인은 메시지 계층에서 "문서 정밀 수정" 의도를 감지하여 안내를 주입하고, LLM이 작업을 시작하기 전에 먼저 사용자가 마킹하도록 하여 위치를 추측하고 직접 수정하는 것을 방지합니다. 참고: 플러그인은 opencode에서만 동작합니다. WorkBuddy 등 다른 MCP 클라이언트에서는 LLM의 흐름 안내가 도구 설명과 wait_for_annotations가 반환하는 next 필드에서 제공됩니다(다중 라운드 루프 규약이 내장됨).

Q: 수정 완료 후 창이 자동으로 재로드되는데, 다시 마킹하고 【완료】를 클릭하면 agent가 계속 처리하나요? A: agent가 여전히 대기 중인지에 따라 다릅니다:

  • agent가 안내에 따라 "마킹 처리 → wait_for_annotations 재호출" 루프에 있으면, 사용자가 제출한 새 마킹을 즉시 받아 계속 처리합니다(다중 라운드가 끊김 없이 이어짐);

  • agent가 이미 턴을 종료했다면(더 이상 도구를 호출하지 않음), 사용자의 마킹은 서버에 임시 저장되지만 agent를 자동으로 깨우지 않습니다 — 이 경우 agent에게 "마킹이 제출되었으니 계속 처리해 주세요"라고 한마디 하면 됩니다. 이는 "실행 주체는 LLM" 아키텍처의 고유한 경계입니다: 서버가 agent를 대신하여 다음 라운드를 능동적으로 인계할 수 없습니다.

Q: 두 대화가 동시에 같은 문서를 편집하면 창이 섞이나요? A: WorkBuddy는 전역적으로 동일한 server 프로세스를 공유하므로, 동일 문서의 마킹 창이 재사용되어 공유됩니다. 수정 후 자동 재로드는 이제 세션에 정확히 바인딩됩니다: LLM이 apply_edit 등 도구에 wait_for_annotations가 반환한 session_id를 포함하면 이 대화의 창만 재로드됩니다. 포함하지 않으면 최근 활성 세션으로 폴백하며, 경로에 여러 활성 세션이 있으면 재로드하지 않는 것이 오작동보다 낫습니다. 같은 시점에 한 대화에서만 동일 문서를 조작하는 것이 좋습니다.

Available Tools

11 tools
annotate_documentA

打开文档标注页面(H5):创建标注会话并启动本地 HTTP 服务,在独立浏览器应用窗口打开标注页(无地址栏/工具栏/标签页)。若同一文档已有存活窗口则直接复用(原位重载、清空上轮标注),不重新开窗。返回 {session_id, url}。多轮循环:窗口会在文档被修改后自动重载最新内容(apply_edit 成功后服务端主动推送),无需每次手动调用本工具;也可在本轮开始或需要立即刷新时主动调用。同一文档重复调用会复用现有窗口。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes目标文档绝对路径(.docx / .xlsx / .pptx)

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it discloses session creation, local HTTP service startup, window reuse/in-place reload, clearing of previous annotations, automatic reload after apply_edit via server push, and the returned {session_id, url}. This goes well beyond what the schema alone communicates.

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?

The description is information-dense and front-loads the primary action and return value before the multi-turn loop explanation. Minor redundancy exists: the final sentence about reusing existing windows repeats the earlier reuse statement, slightly padding an otherwise efficient description.

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 having no output schema, the description states the return value explicitly. It also covers the window lifecycle, the automatic reload mechanism, and the exact conditions under which the agent should call the tool again. For a tool that starts a local service and manages a browser window, nothing needed for a correct call 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 100% and the schema already describes path as an absolute .docx/.xlsx/.pptx path. The description adds meaning by making path the identity used for window reuse ('同一文档'), which clarifies that the same path maps to the same session/window. That is value beyond the schema's type-level description.

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 names a specific action ('打开文档标注页面'), explains the underlying work (create annotation session, start local HTTP service, open an H5 page in a standalone browser window), and distinguishes the tool's key reuse behavior from a simple one-shot opener. It leaves no ambiguity about the resource it operates on.

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?

It provides clear when-to-use and when-not-to-use guidance: call at the start of a round or when an immediate refresh is needed, but not after every edit because the window auto-reloads after apply_edit. It does not explicitly name alternatives among the sibling tools, but the behavioral loop guidance is strong enough to route an agent correctly.

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

apply_editA

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

ParametersJSON 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 时忽略,可为空字符串)

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.

cancel_sessionB

取消标注会话(用户点了“取消”)。返回 {session_id, status}。

ParametersJSON Schema
NameRequiredDescriptionDefault
session_idYes标注会话 ID

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions cancellation and the return shape, but does not explain side effects (e.g., whether in-flight requests are aborted, whether the session is permanently deleted or recoverable), authentication requirements, or idempotency. For a mutating action without annotation coverage, this is a significant gap.

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 a single, concise sentence that front-loads the action and immediately states the return value. There is no wasted text, and it is appropriately sized for a simple cancellation tool.

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?

Given the low complexity (one parameter, no output schema, no annotations), the description provides the essential action and return format. It is minimally sufficient for an agent to invoke the tool, but lacks contextual details like side effects or error handling. For a mutation tool, this is adequate but not rich; a 3 reflects the missing behavioral context without over-penalizing given the tool's simplicity.

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?

Schema description coverage is 100%, so the parameter 'session_id' is fully documented in the schema. The description adds no extra meaning about the parameter (e.g., format, constraints, or how to obtain it). Per the rubric, baseline 3 applies when schema covers the parameter, and the description does not need to repeat it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb '取消' (cancel) and a clear resource '标注会话' (annotation session). This distinguishes it from siblings like 'annotate_document' and 'wait_for_annotations', though it does not explicitly name an alternative like the highest-quality examples. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use this tool versus alternatives. It only states the action and return value. It implies usage for canceling a session, but provides no exclusion criteria, prerequisites, or references to related tools like 'wait_for_annotations' or 'preview_edits'.

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

find_replaceA

在 docx 文档中全文查找并替换字符串(普通字符串,非正则;匹配范围含表格内单元格)。match_case=false 时大小写不敏感,替换文本原样插入。返回 {matched, replaced, locations}。

ParametersJSON Schema
NameRequiredDescriptionDefault
findYes要查找的原文(普通字符串,非正则)
pathYes目标 .docx 文档绝对路径
replaceYes替换为的内容
match_caseNo是否大小写敏感,默认 false
session_idNo(建议)标注会话 ID(wait_for_annotations 返回)。窗口重载精确绑定该会话

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does well: it discloses plain-string matching, table-cell coverage, case-insensitive behavior when match_case=false, verbatim insertion of replacement text, and the return shape. It does not explicitly warn that the file is modified in place or discuss reversibility, but the core mutation semantics are clear.

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 dense sentence with no filler. Every clause adds information: scope, regex exclusion, table-cell inclusion, case sensitivity, replacement semantics, and return contract. The most important operation and scope come first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the action, scope, case behavior, replacement semantics, and return values, which is enough for an agent to invoke it correctly. It lacks only an explicit statement about whether the document is overwritten in place or how to recover, but the core usage context is complete.

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 100%, so the baseline is 3, but the description adds value beyond the schema: it clarifies that match_case=false means case-insensitive, that replacement text is inserted as-is, and that the result includes matched/replaced counts and locations. This deepens understanding of the parameters' runtime behavior.

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 names a concrete operation: full-text find-and-replace in .docx files. It explicitly scopes the behavior as plain-string (non-regex) and includes table cells, which clearly distinguishes it from related tools like template_replace or scoped edits.

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 gives clear context: it is for whole-document plain-string replacement with an optional case-sensitivity flag. It does not explicitly name alternatives or state when not to use it, but the intended use case is unambiguous.

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

list_versionsA

列出文档的版本历史(.versions/ 快照链:同一标注轮次内多个编辑合并为一个版本,即每轮首个编辑前快照;新版本在前)。返回 [{index, path, size, mtime, kind?, desc?, ts?}],无版本时返回 []。每条 desc 表达'修改前/该轮标注前的状态'(如'第 1 轮标注前的状态'或'修改前:替换…'),回退到该版本即恢复为该内容。配合 restore_version 实现任意步回退。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes文档绝对路径(.docx / .xlsx / .pptx)

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it reveals the snapshot-chain model, version merging per annotation round, ordering (new versions first), empty-list behavior, and the meaning of each desc as 'state before that annotation round'. This goes far beyond what the schema alone conveys.

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 dense but every clause earns its place: purpose, snapshot semantics, output shape, desc meaning, and companion tool. It is front-loaded with the core action and maintains a logical flow from behavior to return format to usage.

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 tool with one required parameter, no output schema, and no annotations, this description is complete: it explains the return fields, empty result behavior, version semantics, and how to combine with restore_version. An agent can correctly invoke it and interpret results without additional context.

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 input schema already has 100% coverage for the single 'path' parameter, so the baseline is 3. The description does not add parameter-specific semantics beyond the schema, but none are strictly needed here.

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 starts with a specific verb and resource: '列出文档的版本历史' (list document version history). It further clarifies semantics with the snapshot-chain explanation, output array shape, and explicitly names restore_version as the companion tool, so an agent can distinguish it from siblings like restore_version or read_location.

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 clearly indicates this tool is for reading version history and works together with restore_version for arbitrary rollback, giving a concrete workflow context. However, it does not explicitly state when not to use it, e.g., for reading current document content instead of history.

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

preview_editsA

批量预览修改(仅内存计算,不写盘):按顺序在内存中对同一文档应用 edits 列表,返回每处的 {loc, before, after}。适合在真正 apply_edit 前检查一批修改是否符合预期。edits 元素为 {loc, new_content?, mode?, style?}。返回 [{loc, before, after}]。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes文档绝对路径
editsYes要预览的修改列表(按顺序应用,与逐个 apply_edit 一致)

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries full behavioral disclosure and does a good job: it explicitly states the operation is in-memory only and does not write to disk, and that edits are applied sequentially to the same document. It stops short of describing failure modes or precise before/after semantics for edge cases such as delete.

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?

The main safety and purpose information is front-loaded in a compact opening phrase, followed by use case, parameter summary, and return shape. The return format is stated twice, which is mildly redundant, but overall the description is appropriately sized and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a preview tool with no output schema, the description covers what it returns, how it applies edits, and the critical no-write behavior, and it points to apply_edit as the actual mutation path. Minor gaps remain around edge-case behavior such as delete-mode results or invalid locations, but nothing essential blocks correct selection and invocation.

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?

The schema already documents all parameters with 100% coverage, so the baseline is 3. The description adds meaningful semantics beyond the schema by clarifying that the edits list is applied sequentially in memory to the same document, and by summarizing the element shape as {loc, new_content?, mode?, style?}.

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 uses a specific verb and resource: batch preview edits, memory-only, with no write to disk. It explicitly returns per-edit {loc, before, after} and differentiates itself from the sibling apply_edit by positioning itself as a pre-check step.

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?

It clearly states when to use this tool: before actually applying edits via apply_edit, to verify whether a batch of modifications is as expected. It names apply_edit as the real-write alternative, though it does not enumerate when-not-to-use conditions or other sibling tools.

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

read_locationA

读取指定位置的原文与相邻上下文,供生成新内容前核对。返回 {loc, text, context}。

ParametersJSON Schema
NameRequiredDescriptionDefault
locYes统一位置描述符(docs/contracts.md §2):docx-paragraph / docx-cell / xlsx-cell / xlsx-range / pptx-shape / pptx-shape-paragraph
pathYes文档绝对路径

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. The verb '读取' clearly implies a read-only operation, and the explicit return shape {loc, text, context} tells the agent what to expect. It could additionally mention failure behavior or permissions, but the non-destructive nature is evident.

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 a single, front-loaded sentence that communicates purpose, usage context, and return shape without any wasted words. Every part contributes to helping an agent decide whether and how to call the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with two well-documented parameters, the description is mostly complete. It compensates for the lack of an output schema by specifying the return shape. It does not elaborate on the six loc kinds, but the schema enum already covers that, so nothing critical is missing.

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?

Schema coverage is 100%, so both parameters are already documented in the schema. The description adds no additional semantic information about the parameters themselves; it only describes the return value. The schema's descriptions of path and loc are sufficient, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (read), the resource (a specified location), and the scope (original text plus adjacent context), making the tool's purpose understandable. It does not explicitly differentiate from sibling tools like read_structure, but the focus on content and context is distinct enough.

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 gives a clear usage context: it should be used to check the original text and surrounding context before generating new content. It does not mention alternatives or when not to use this tool, but the stated scenario provides actionable guidance.

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

read_structureA

读取文档大纲:docx 逐段 {loc,text};xlsx 每 sheet 维度与抽样;pptx 每页形状文本。返回 {format, items|sheets|slides}。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes文档绝对路径
max_itemsNo限制返回条目数,默认 500

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It clearly communicates that this is a read operation and specifies the exact return shape per format: paragraph-level {loc,text} for docx, sheet dimensions/sampling for xlsx, and shape text for pptx. It stops short of describing error behavior or limits beyond the schema.

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 compact and information-dense, covering three file formats and the return envelope in a single sentence. Every clause earns its place with no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, but the description compensates by explicitly stating the return structure '{format, items|sheets|slides}' and per-format content. It is complete enough for an agent to know what to expect. Minor gaps like max_items interaction with sampling are not critical for basic invocation.

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?

Schema description coverage is 100%: both 'path' and 'max_items' are described in the schema. The tool description adds no parameter-level detail beyond what the schema already provides, so the baseline score of 3 is appropriate.

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 verb ('read') and resource ('document outline') and goes beyond that by detailing format-specific behavior for docx, xlsx, and pptx. This clearly distinguishes it from read_location and other sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for inspecting document structure before performing edits or annotations, but it does not explicitly name alternatives or state when not to use it. The format breakdown gives implicit context, but there is no direct when/when-not guidance.

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

restore_versionA

将文档直接回退到 list_versions 给出的某个版本(回到该版本锚点:文档被覆盖为该版本内容,回退前不会快照当前状态,因此版本记录不会增加)。⚠️ 警告:该版本之后的全部修改将丢失,且回退本身不可通过新快照撤销(但既有版本链仍保留,可再回退到其它版本)。回退后旧标注的 loc 索引可能失效,应重新 read_structure 遍历后再继续编辑。返回 {restored_index, path, version_path, versions}。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes文档绝对路径
indexYes要恢复的版本序号(list_versions 返回的 index)
session_idNo(建议)标注会话 ID(wait_for_annotations 返回)。窗口重载精确绑定该会话

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries full responsibility and does so thoroughly: it discloses that no snapshot is taken before rollback, version history will not increase, later modifications are lost, the rollback cannot be undone via a new snapshot, and old annotation loc indices may become invalid.

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 dense but well-structured: the core action is bolded and front-loaded, followed by the critical warning, the post-rollback guidance, and the return shape. Every sentence earns its place, with no redundant filler.

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 destructive version-restore tool with no annotations and no output schema, the description is remarkably complete: it covers the action, the exact behavior regarding version history, data loss, irreversibility, follow-up steps, and the return payload.

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?

Schema description coverage is 100%, so the baseline is 3; the schema already explains path, index, and session_id. The description adds behavioral context around the index parameter (it comes from list_versions) but does not materially extend the schema's parameter documentation.

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 verb ('直接回退' / directly restore), a clear resource (document version from list_versions), and the exact result ('document is overwritten with that version's content'). It also names sibling tools list_versions and read_structure, making the tool's role distinct from listing or editing.

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 clearly identifies list_versions as the source for the version index and instructs the agent to re-run read_structure after rollback before continuing edits. It warns about data loss and irreversibility, but does not explicitly contrast this tool with alternatives like apply_edit or template_replace for non-restore modifications.

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

template_replaceA

批量替换 docx 文档中的 {{变量}} 模板占位符。variables 为 {变量名: 值} 映射;未提供值的变量保持原样并在 missing_vars 中列出。同段落多处占位符按从右到左应用保证坐标正确;跨 run 断裂的占位符也能正确替换。返回 {matched, replaced, missing_vars, applied}。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes目标 .docx 文档绝对路径
variablesYes模板变量映射,如 {"name": "张三", "date": "2026-08-26"}
session_idNo(建议)标注会话 ID(wait_for_annotations 返回)。窗口重载精确绑定该会话

TDQS

A4.2/5.0
Behavior4/5

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

描述揭示了重要的非显而易见行为:未提供值的变量保持原样并在 missing_vars 中列出;同段落多处占位符按从右到左应用保证坐标正确;跨 run 断裂的占位符也能正确替换。这些细节超出 schema 和 annotations 提供的范围(annotations 未提供,schema 未提及这些行为)。

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?

描述紧凑且信息密集,每句话都有明确用途。核心行为在前两个分句中,边界情况(跨 run、从右到左)透明披露,返回结构也说明了。没有冗余。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

描述涵盖了返回结构(matched, replaced, missing_vars, applied)、边界情况行为和参数含义。但没有明确说明失败模式(如文件不存在、权限问题)或是否修改原文件或生成新文件。考虑到描述已经提供大量行为细节,缺少这些不影响基本使用。

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?

Schema 描述覆盖率 100%,所有参数在 schema 中都有描述。描述本身没有为参数添加额外语义,但 variables 参数的行为(未提供值则保持原样)在描述中提到了,这补充了 schema 描述。整体上 schema 已承担主要负担,描述添加了边际价值。

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?

描述明确说明工具行为:批量替换 docx 文档中的 {{变量}} 模板占位符,并提到返回值。与兄弟工具如 find_replace 和 apply_edit 有区分(模板占位符替换 vs 通用查找替换/编辑)。

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?

描述隐含了使用场景(模板填充、缺失变量报告),但没有明确说明何时使用 vs 兄弟工具(如 find_replace)。没有提供排除条件,但通过描述变量映射和缺失变量行为暗示了用途。

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

wait_for_annotationsA

阻塞等待标注会话完成 / 取消 / 窗口关闭,返回用户提交的标注列表。返回 {session_id, status, reason?, annotations, next?},status 为 done | cancelled | closed | timeout。缺省永不超时(timeout_seconds 不传则一直等待直到用户提交/取消/关闭窗口,或 agent 退出);如客户端对单次调用有超时上限,可传 timeout_seconds 设一个安全值,被截断或超时后再次调用本工具继续等待即可(会话在服务端持续存在,不会因单次调用被截断而取消)。status=closed 表示标注窗口已关闭:reason=window_closed/page_unload 是用户主动关闭——本轮标注流程已结束,不要再调用本工具或 annotate_document(除非用户明确要求继续),直接总结结果即可;reason=window_lost(窗口崩溃/被强杀)或 agent_cancelled/agent_exited 时才考虑询问用户是否重开。status=done 且存在标注时:处理这些标注时请在 apply_edit / template_replace / find_replace / restore_version 中带上本返回值中的 session_id(确保标注窗口重载到正确的会话,多对话共享同一 server 时尤为重要);处理完后(窗口会自动重载修改后的内容)应再次调用本工具等待用户下一轮标注。status=done 且标注为空:用户确认本轮无需修改,标注流程已结束(窗口已自动关闭),不要再调用本工具或 annotate_document,直接总结结果即可。

ParametersJSON Schema
NameRequiredDescriptionDefault
session_idYes标注会话 ID(annotate_document 返回)
timeout_secondsNo本次等待超时秒数,默认 1800(30 分钟);若客户端有工具超时上限请设一个安全值并轮询调用

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and delivers: blocking semantics, server-side session persistence across calls, no cancellation on truncation, status expansion, and automatic window reload behavior. However, it contradicts the input-schema default for timeout_seconds (description says 'never time out' by default; schema says 'default 1800'). This inconsistency creates agent-facing ambiguity about the actual default wait 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?

The paragraph is long and dense but nearly every clause carries a distinct behavioral rule spanning multiple statuses and call-pattern scenarios, so the length is justified. Core blocking behavior and default timeout are front-loaded, but the wall of text could be better structured into bullets or status-to-action pairs for faster parsing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-param tool with no output schema and no annotations, the description covers return shape, per-status meaning, follow-up actions, and session persistence — essentially everything needed for correct invocation. The only substantive gap is the timeout-default contradiction with the schema, which leaves an agent uncertain about the real server-side default.

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, but the description adds meaningful semantics beyond the schema: when and why to pass timeout_seconds (client call limits), what to do if the call is truncated (call the tool again), and that session_id must be forwarded into apply_edit/template_replace/find_replace/restore_version. The added value is slightly offset by the timeout-default contradiction with the schema.

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 specific verb and resource: blocks waiting for an annotation session to complete and returns the user's submitted annotations. Explicitly lists the return shape and all possible status values (done | cancelled | closed | timeout), which clearly distinguishes it from sibling edit/apply tools like apply_edit or find_replace. No tautology and no ambiguity.

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?

Provides exhaustive when-to-use and when-not-to-use rules: call again after processing done-annotations, do not call again when status is closed (user-initiated) or done with empty annotations, and only ask the user about reopening for window_lost/agent_cancelled/agent_exited. It also instructs passing session_id into sibling tools and when to set timeout_seconds for client-limited calls. This is textbook-level usage guidance with explicit exclusions and alternatives.

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

TDQS

A4/5.0
Disambiguation4/5

Most tools have clearly distinct roles in the read-annotate-edit-version workflow. The main ambiguity is among apply_edit, find_replace, and template_replace, which all modify documents, though their descriptions clarify different use cases.

Naming Consistency4/5

Tool names are consistently lowercase snake_case and mostly follow a verb_noun pattern like read_location, apply_edit, and list_versions. template_replace and find_replace deviate slightly from the verb-first style, but the naming remains predictable and readable.

Tool Count5/5

11 tools is well within the ideal range, and each tool covers a necessary part of the fine-tuning workflow: reading, annotating, waiting, editing, previewing, and versioning. There are no obvious filler or redundant tools.

Completeness5/5

The toolset covers the full annotation loop: open a session, wait for annotations, apply edits, preview changes, and roll back via versions. Features like document creation or export are outside the stated fine-tuning purpose, so no significant gaps are apparent.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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