docx-exportJson
Extract the JSON model from a DOCX document to access its structure and content programmatically for editing or integration purposes.
Instructions
Return the current JSON model for a given id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:217-222 (handler)Handler function for the 'docx-exportJson' tool. Parses the input arguments to extract the document ID, retrieves the document from the registry, checks if it exists, and returns its JSON representation wrapped in the 'ok' response format.case "docx-exportJson": { const { id } = parseArgs<{ id: string }>(args, tools["docx-exportJson"].inputSchema); const doc = registry.get(id); if (!doc) throw new McpError(ErrorCode.InvalidParams, `doc not found: ${id}`); return ok(doc.json); }
- src/index.ts:81-84 (schema)Tool registration entry including the description and input schema for 'docx-exportJson'. The schema requires a single 'id' string parameter representing the document ID."docx-exportJson": { description: "Return the current JSON model for a given id.", inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } } } }
- src/index.ts:102-103 (registration)Registration of all tools, including 'docx-exportJson', in the ListToolsRequestHandler. Maps the tools object to the required format for the MCP server.tools: Object.entries(tools).map(([name, t]) => ({ name, description: t.description, inputSchema: t.inputSchema as any })) }));