Skip to main content
Glama

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
NameRequiredDescriptionDefault
idNo
pathYes

Implementation Reference

  • 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" } } } },
  • 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" } } } },

Other Tools

Related 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/lihongjie0209/docx-mcp'

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