Skip to main content
Glama
u9401066

asset-aware-mcp

by u9401066

save_docx

Save edited document content back to .docx format. Supports DFM or markdown input with automatic format merging and optional Word track changes for review.

Instructions

將編輯後的內容存回 .docx 檔案。

支援兩種模式:

  • DFM 模式(預設):傳入 dfm_content(.dfm 格式全文)

  • MD 模式(from_md=True):從磁碟讀取 content.md + format.yaml

回寫流程:

  1. 解析 DFM/MD → 提取修改

  2. 載入原始 IR

  3. 合併修改(格式合併策略)

  4. 重建 .docx

安全機制:若內容萎縮 > 50%,預設拒絕輸出(疑似資料遺失)。 使用 force=True 強制輸出。

若 track_changes=True,會將 DFM 中的文字修改以真正 Word Track Changes (w:del/w:ins) 寫回,供使用者在 Word 中逐項審查。

Args: doc_id: 文件 ID dfm_content: 編輯後的 DFM 全文(from_md=True 時可省略) output_path: 輸出路徑(預設為 data/{doc_id}/output.docx) from_md: 若為 True,從磁碟讀取 content.md + format.yaml 而非使用 dfm_content force: 若為 True,即使偵測到嚴重內容萎縮仍強制輸出 track_changes: 若為 True,以 Word Track Changes 寫入文字 diff revision_author: 產生追蹤修訂時使用的作者名稱

Returns: 儲存結果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes
dfm_contentNo
output_pathNo
from_mdNo
forceNo
track_changesNo
revision_authorNoAsset-Aware MCP
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description must fully disclose behavior. It covers safety mechanisms (content shrinkage >50% triggers rejection), force option, track_changes feature, and the overall workflow (parse, load IR, merge, rebuild). This provides comprehensive transparency.

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 well-structured with sections for modes, workflow, safety, and args. It is front-loaded with the purpose. However, some details (e.g., the exact merge strategy) could be condensed without losing clarity.

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?

Given the complexity (8 params, two modes, safety logic), the description covers workflow, parameter semantics, and return value ('儲存結果'). It could be more specific about the return value structure, but it is generally complete for a save operation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden. It lists all 8 parameters with explanations, defaults, and interactions (e.g., dfm_content optional when from_md=True). This greatly aids understanding beyond the bare 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?

The description starts with '將編輯後的內容存回 .docx 檔案' which directly states the action and resource. It details two modes (DFM and MD) and outlines the workflow, clearly distinguishing it from sibling tools like 'docx' which likely handle other docx operations.

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 explains when to use each mode (DFM default, from_md=True for MD) and mentions the force flag for safety overrides. It does not explicitly state when not to use the tool or provide alternatives, but the context is clear enough for typical usage.

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/u9401066/asset-aware-mcp'

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