Tools / Word Documents
Word Documents icon

Word Documents

Create, read & modify Word docs

Create, read, and modify Word documents (.docx) without Microsoft Word. Full formatting support: headings, lists, tables, images, tracked changes, comments, styles, hyperlinks, footnotes, and multi-section layouts. All skills return downloadable files.

3 skillsv0.01
Create Document

Build a Word document from structured data: paragraphs with formatting, headings, lists, tables with merges, images, headers/footers, TOC, tracked changes, comments, styles, multi-section layouts, hyperlinks, and footnotes. Returns a downloadable .docx file.

Returns: A downloadable .docx file with all content, formatting, tables, images, and metadata applied
Parameters
contentarrayArray of content blocks for a single-section document. Each block has a "type" field. Use this OR "sections", not both.
sectionsarrayMulti-section document with different page layouts per section. Use this OR "content", not both.
page_setupobjectGlobal page setup (applies when using "content", overridden per-section when using "sections")
headerobjectDocument header (for single-section documents)
footerobjectDocument footer (for single-section documents)
commentsarrayComments to add to the document
footnotesarrayFootnote definitions. Reference in paragraphs via footnote_ref: {"id": N}
endnotesarrayEndnote definitions. Reference in paragraphs via endnote_ref: {"id": N}
stylesarrayCustom style definitions
filenamestringOutput filename (default: document.docx)
Example
Professional report with headings, formatted text, and a table
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{
  "tool": "docx-tools",
  "skill": "create_document",
  "input": {
    "content": [
      {
        "type": "paragraph",
        "paragraph": {
          "text": "Quarterly Report",
          "heading": "h1",
          "alignment": "center"
        }
      },
      {
        "type": "paragraph",
        "paragraph": {
          "text": "Q1 2026 Performance Summary",
          "heading": "h2"
        }
      },
      {
        "type": "paragraph",
        "paragraph": {
          "runs": [
            {
              "text": "Revenue grew by ",
              "size": 12
            },
            {
              "text": "15%",
              "bold": true,
              "color": "00AA00",
              "size": 12
            },
            {
              "text": " compared to the previous quarter.",
              "size": 12
            }
          ]
        }
      },
      {
        "type": "table",
        "table": {
          "rows": [
            {
              "cells": [
                {
                  "text": "Metric",
                  "bold": true,
                  "shading": "4472C4",
                  "color": "FFFFFF"
                },
                {
                  "text": "Q4 2025",
                  "bold": true,
                  "shading": "4472C4",
                  "color": "FFFFFF"
                },
                {
                  "text": "Q1 2026",
                  "bold": true,
                  "shading": "4472C4",
                  "color": "FFFFFF"
                }
              ],
              "is_header": true
            },
            {
              "cells": [
                {
                  "text": "Revenue"
                },
                {
                  "text": "$1.2M"
                },
                {
                  "text": "$1.38M"
                }
              ]
            },
            {
              "cells": [
                {
                  "text": "Users"
                },
                {
                  "text": "45,000"
                },
                {
                  "text": "52,300"
                }
              ]
            }
          ]
        }
      }
    ],
    "header": {
      "text": "CONFIDENTIAL",
      "alignment": "right",
      "size": 8
    },
    "footer": {
      "text": "Acme Corp",
      "include_page_number": true
    },
    "filename": "quarterly-report.docx"
  }
}' \
  https://api.toolrouter.com/v1/tools/call
Read Document

Extract all content from a Word document as structured JSON — paragraphs, tables, raw text, word counts. Optionally extracts comments, tracked changes, properties, styles, headers, images, hyperlinks, and footnotes. Use to inspect a file before modifying.

Returns: Structured JSON with all document content, paragraphs, tables, and optional deep metadata (comments, tracked changes, properties, styles, images, hyperlinks)
Parameters
url *stringURL of the .docx file to read. The tool server CAN fetch any public URL — always pass it.
include_raw_textbooleanInclude full plain text extraction (default: true)
include_commentsbooleanExtract comments with author, date, text (default: false)
include_tracked_changesbooleanExtract tracked insertions and deletions (default: false)
include_propertiesbooleanExtract document properties: title, author, dates, page count (default: false)
include_stylesbooleanList all styles used in the document (default: false)
include_headersbooleanExtract header and footer text (default: false)
include_imagesbooleanList embedded images with size and base64 (default: false)
include_hyperlinksbooleanExtract hyperlinks and bookmarks (default: false)
include_footnotesbooleanExtract footnotes and endnotes (default: false)
Example
Read all content from a Word document
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{
  "tool": "docx-tools",
  "skill": "read_document",
  "input": {
    "url": "https://example.com/report.docx"
  }
}' \
  https://api.toolrouter.com/v1/tools/call
Modify Document

Apply batch operations to an existing Word document: insert/delete/replace paragraphs, insert tables and images, add comments and tracked changes, accept/reject changes, update properties, add headers/footers, page breaks, and styles. Returns the modified .docx file.

Returns: The modified .docx file with a summary of all operations applied
Parameters
url *stringURL of the .docx file to modify. The tool server CAN fetch any public URL — always pass it.
operations *arrayOperations to apply in order. Each has an "action" field plus action-specific params.
filenamestringOutput filename (default: modified.docx)
Example
Add paragraphs, replace text, and insert a table
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{
  "tool": "docx-tools",
  "skill": "modify_document",
  "input": {
    "url": "https://example.com/template.docx",
    "operations": [
      {
        "action": "insert_paragraph",
        "text": "Executive Summary",
        "style": "Heading1",
        "position": "beginning"
      },
      {
        "action": "replace_text",
        "find": "[COMPANY_NAME]",
        "replace": "Acme Corporation"
      },
      {
        "action": "insert_table",
        "rows": [
          [
            "Name",
            "Role",
            "Start Date"
          ],
          [
            "Jane Smith",
            "CTO",
            "2026-01-15"
          ],
          [
            "John Doe",
            "VP Engineering",
            "2026-02-01"
          ]
        ],
        "header_row": true,
        "position": "end"
      }
    ]
  }
}' \
  https://api.toolrouter.com/v1/tools/call
Loading reviews...
Loading activity...
v0.012026-03-23
  • Initial release with create, read, and modify skills

Quick Start

MCP (Claude Code)
claude mcp add --transport stdio \
  --env TOOLROUTER_API_KEY=YOUR_API_KEY \
  toolrouter -- npx -y toolrouter-mcp
REST API
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{"tool":"docx-tools","skill":"create_document","input":{}}' \
  https://api.toolrouter.com/v1/tools/call

Frequently Asked Questions

Can I create a formatted Word document without Word?

Yes. `create_document` builds .docx files from structured content, including paragraphs, tables, images, headers, footers, styles, tracked changes, footnotes, and multi-section layouts.

Can I inspect comments or tracked changes in an existing file?

`read_document` reads a .docx into structured JSON and can include comments, tracked changes, and other document metadata when you need a deeper edit pass.

Can I update an existing document instead of rebuilding it?

Yes. `modify_document` applies operations to an existing .docx file URL, which is useful when you only need targeted edits or cleanup.

What layout details can it handle?

It supports single-section and multi-section documents, page setup in DXA units, table cell spans, and page elements like TOC blocks, bookmarks, and page breaks.