docx-openFile
Open .docx files from disk into memory for editing and management, returning a unique ID for further operations with the DOCX MCP Server.
Instructions
Open a .docx file from disk into memory and return id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| path | Yes |
Implementation Reference
- src/index.ts:210-216 (handler)The main handler function for the 'docx-openFile' tool. It parses the input arguments, reads and parses the DOCX file to JSON using parseDocxFileToJson, opens the document in the DocRegistry with the provided or generated ID, and returns the document ID.case "docx-openFile": { const { id, path: filePath } = parseArgs<{ id?: string; path: string }>(args, tools["docx-openFile"].inputSchema); const json = await parseDocxFileToJson(filePath); const docId = id ?? nanoid(); registry.open(docId, json); return ok({ id: docId }); }
- src/index.ts:77-80 (registration)Tool registration entry defining the 'docx-openFile' tool, including its description and input schema for validation."docx-openFile": { description: "Open a .docx file from disk into memory and return id.", inputSchema: { type: "object", required: ["path"], properties: { id: { type: "string" }, path: { type: "string" } } } },
- src/index.ts:79-80 (schema)Input schema for the 'docx-openFile' tool, defining required 'path' and optional 'id' parameters.inputSchema: { type: "object", required: ["path"], properties: { id: { type: "string" }, path: { type: "string" } } } },