Skip to main content
Glama
asset-aware-mcp

asset-aware-mcp

by u9401066

ingest_docx

Converts .docx and .doc files into editable Docx-Flavored Markdown while preserving stored edits; set reset to rebuild from source and discard changes.

Instructions

攝入 .docx / .doc 文件,轉換為 DFM (Docx-Flavored Markdown) 格式。

同一份來源檔若已攝入過,會直接回傳既有文件狀態(保留所有已儲存/已 commit 的編輯與目前 revision),不會重新解析;只有 reset=True 才會明確捨棄所有編輯、 從來源檔重建(有其他 agent 持有有效租約時拒絕,並先備份)。

將 docx 解析為中間表示 (IR),再轉換為可在 VS Code 中編輯的 DFM 格式。 支援複雜元素:合併表格、圖表、頁首頁尾、巨集、目錄等。 支援舊版 .doc 格式(自動透過 LibreOffice 轉換為 .docx)。

輸出目錄結構:

data/{doc_id}/
├── content.dfm      # 可編輯的 Markdown + YAML 標注
├── ir.json          # 目前 IR(每次 save_docx 更新)
├── baseline_ir.json # ingest 時的不可變 IR(累積回寫的比對基準)
├── original.docx    # 原始檔案備份(永不修改)
├── parts/           # 保留的 XML 零件
└── assets/          # 圖片和二進位資產

Args: file_path: .docx 或 .doc 檔案的絕對路徑 reset: 若為 True,捨棄既有文件的所有編輯並從來源檔重新攝入

Returns: 攝入結果摘要(doc_id、區塊數量等)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>"
    },
    "name": "ingest_docx"
  }
}

Input Schema

NameRequiredDescriptionDefault
resetNo
file_pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / reset
      Added value: +{
      +  "default": false,
      +  "title": "Reset",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv1.0.1
    • removedInput schema / properties / ctx
      Removed value: -{
      -  "anyOf": [
      -    {},
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Ctx"
      -}
  3. First observedv0.7.0

TDQS

A4.7/5.0
Behavior5/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 and does so well: it discloses idempotent re-ingest behavior, what reset=True destroys (all saved/committed edits), the lease-based refusal, an automatic backup, and that original.docx is never modified. The output directory map and LibreOffice fallback for legacy .doc add concrete operational context beyond anything structured.

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 core action and the critical idempotency/reset semantics, then organized into args, returns, and a directory map. The IR-to-DFM sentence repeats the opening line slightly, and the directory tree is long, though it earns most of its space by telling the agent where edits and baselines live.

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?

An output schema exists, yet the description still summarizes the return (doc_id, block count) and documents both parameters and on-disk artifacts. For a two-parameter ingest tool with destructive-reset semantics and concurrency constraints, nothing an agent needs to call it safely is missing.

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 coverage is 0%, so the description must compensate, and it does: file_path is defined as an absolute path to a .docx or .doc file, and reset is defined as discarding all existing edits and rebuilding from source, including its default-false implication in the re-ingest sentence.

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 — ingest .docx/.doc files and convert them to DFM — and names the intermediate IR and legacy .doc handling. An agent can distinguish this from save_docx (writes) and get_docx_content (reads) without opening any schema.

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 clear when-to-use context: re-ingesting an already-ingested source returns existing state, and only reset=True rebuilds from source, with an explicit refusal condition when another agent holds a valid lease. It stops short of naming alternative tools (e.g., save_docx for post-ingest edits), so routing is implied rather than explicit.

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