---
title: ToolRouter — Tool Detail
description: Detailed documentation for a ToolRouter tool including skills, parameters, and examples.
url: https://toolrouter.com/tools/docx-tools
---
# Word Documents

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.

- **Version:** 0.01
- **Categories:** productivity, data
- **Workflow:** create_document → read_document → modify_document

## Skills (3)

### Create Document (`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.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `content` | array | No | Array of content blocks for a single-section document. Each block has a "type" field. Use this OR "sections", not both. |
| `sections` | array | No | Multi-section document with different page layouts per section. Use this OR "content", not both. |
| `page_setup` | object | No | Global page setup (applies when using "content", overridden per-section when using "sections") |
| `header` | object | No | Document header (for single-section documents) |
| `footer` | object | No | Document footer (for single-section documents) |
| `comments` | array | No | Comments to add to the document |
| `footnotes` | array | No | Footnote definitions. Reference in paragraphs via footnote_ref: {"id": N} |
| `endnotes` | array | No | Endnote definitions. Reference in paragraphs via endnote_ref: {"id": N} |
| `styles` | array | No | Custom style definitions |
| `filename` | string | No | Output filename (default: document.docx) |

**Returns:** A downloadable .docx file with all content, formatting, tables, images, and metadata applied

**Examples:**

*Professional report with headings, formatted text, and a table:*

```json
{
  "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"
}
```

*Document with bullet lists, numbered lists, and hyperlinks:*

```json
{
  "content": [
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Project Plan",
        "heading": "h1"
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Key Objectives",
        "heading": "h2"
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Increase test coverage to 90%",
        "bullet": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Reduce API latency by 50%",
        "bullet": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Launch mobile app",
        "bullet": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Timeline",
        "heading": "h2"
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Phase 1: Research and planning",
        "numbered": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Phase 2: Implementation",
        "numbered": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "Phase 3: Testing and launch",
        "numbered": true
      }
    },
    {
      "type": "paragraph",
      "paragraph": {
        "text": "For details, see: ",
        "hyperlinks": [
          {
            "text": "Project Wiki",
            "url": "https://wiki.example.com/project"
          }
        ]
      }
    }
  ],
  "page_setup": {
    "size": "a4",
    "orientation": "portrait"
  },
  "filename": "project-plan.docx"
}
```

### Read Document (`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.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | Yes | URL of the .docx file to read. The tool server CAN fetch any public URL — always pass it. |
| `include_raw_text` | boolean | No | Include full plain text extraction (default: true) |
| `include_comments` | boolean | No | Extract comments with author, date, text (default: false) |
| `include_tracked_changes` | boolean | No | Extract tracked insertions and deletions (default: false) |
| `include_properties` | boolean | No | Extract document properties: title, author, dates, page count (default: false) |
| `include_styles` | boolean | No | List all styles used in the document (default: false) |
| `include_headers` | boolean | No | Extract header and footer text (default: false) |
| `include_images` | boolean | No | List embedded images with size and base64 (default: false) |
| `include_hyperlinks` | boolean | No | Extract hyperlinks and bookmarks (default: false) |
| `include_footnotes` | boolean | No | Extract footnotes and endnotes (default: false) |

**Returns:** Structured JSON with all document content, paragraphs, tables, and optional deep metadata (comments, tracked changes, properties, styles, images, hyperlinks)

**Examples:**

*Read all content from a Word document:*

```json
{
  "url": "https://example.com/report.docx"
}
```

*Deep inspection with all metadata:*

```json
{
  "url": "https://example.com/contract.docx",
  "include_comments": true,
  "include_tracked_changes": true,
  "include_properties": true,
  "include_styles": true,
  "include_headers": true,
  "include_images": true,
  "include_hyperlinks": true,
  "include_footnotes": true
}
```

### Modify Document (`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.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | Yes | URL of the .docx file to modify. The tool server CAN fetch any public URL — always pass it. |
| `operations` | array | Yes | Operations to apply in order. Each has an "action" field plus action-specific params. |
| `filename` | string | No | Output filename (default: modified.docx) |

**Returns:** The modified .docx file with a summary of all operations applied

**Examples:**

*Add paragraphs, replace text, and insert a table:*

```json
{
  "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"
    }
  ]
}
```

*Add comments, tracked changes, and update properties:*

```json
{
  "url": "https://example.com/contract.docx",
  "operations": [
    {
      "action": "add_comment",
      "text": "Please review this clause",
      "author": "Legal Team",
      "anchor_text": "termination"
    },
    {
      "action": "add_tracked_change",
      "type": "insertion",
      "text": "Subject to board approval. ",
      "author": "CFO",
      "position": "end"
    },
    {
      "action": "update_properties",
      "title": "Service Agreement v2",
      "author": "Legal Department"
    },
    {
      "action": "add_footer",
      "text": "DRAFT - Not for distribution",
      "alignment": "center",
      "include_page_number": true
    }
  ]
}
```

## Quick Start

```bash
# Via CLI
TOOLROUTER_API_KEY=tr_live_xxx npx -y toolrouter-mcp call docx-tools create_document --content [object Object],[object Object],[object Object],[object Object] --header [object Object] --footer [object Object] --filename quarterly-report.docx

# Via REST API
curl -H "Authorization: Bearer tr_live_xxx" \
     -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
```

## 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.

---

## Get Started with ToolRouter

**Already connected?** Call any tool with `use_tool({ tool, skill, input })`. Browse tools with `discover` or visit https://toolrouter.com/llms-full.txt

**New to ToolRouter?** Connect with one command (no API key needed — auto-provisions on first use):

```bash
# MCP (Claude Code, Codex CLI)
claude mcp add toolrouter -- npx -y toolrouter-mcp

# MCP (Cursor, Windsurf, Cline, VS Code, Gemini CLI, Claude Desktop)
{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

# Claude Chat / Claude Cowork / Claude Mobile — add as a connector:
# Settings → Connectors → Add custom connector → URL: https://api.toolrouter.com/mcp

# ChatGPT — add as an app:
# Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL: https://api.toolrouter.com/mcp

# CLI (works instantly, no restart needed)
npx -y toolrouter-mcp tools                    # browse all tools
npx -y toolrouter-mcp search "seo"             # search by keyword
npx -y toolrouter-mcp call seo analyze_page --url https://example.com
```

Free tools work immediately. For paid tools, visit https://toolrouter.com/claim to add credits.

All platforms: https://toolrouter.com/connect | Full catalog: https://toolrouter.com/llms-full.txt | Docs: https://toolrouter.com/docs