Skip to main content
Glama

docx-create

Create a Word document from JSON input with support for images, tables, and rich formatting. Returns a document ID for subsequent operations.

Instructions

Create a new docx from JSON, returns an id. Use docx-getSchema first to understand the required JSON structure. Supports images via 'data' (base64), 'path' (local file), or 'url' (remote image with fallback).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed31 schema fields changedv1.0.0
    • changedInput schema / properties / json / $defs / Block / oneOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/Paragraph"
      -  },
      -  {
      -    "$ref": "#/$defs/Table"
      -  },
      -  {
      -    "$ref": "#/$defs/Image"
      -  },
      -  {
      -    "$ref": "#/$defs/Heading"
      -  },
      -  {
      -    "$ref": "#/$defs/CodeBlock"
      -  },
      -  {
      -    "$ref": "#/$defs/List"
      -  },
      -  {
      -    "$ref": "#/$defs/PageBreak"
      -  }
      -]New value: +[
      +  {
      +    "$ref": "#/$defs/Paragraph"
      +  },
      +  {
      +    "$ref": "#/$defs/Table"
      +  },
      +  {
      +    "$ref": "#/$defs/Image"
      +  },
      +  {
      +    "$ref": "#/$defs/Heading"
      +  },
      +  {
      +    "$ref": "#/$defs/CodeBlock"
      +  },
      +  {
      +    "$ref": "#/$defs/List"
      +  },
      +  {
      +    "$ref": "#/$defs/PageBreak"
      +  },
      +  {
      +    "$ref": "#/$defs/HorizontalRule"
      +  },
      +  {
      +    "$ref": "#/$defs/Blockquote"
      +  },
      +  {
      +    "$ref": "#/$defs/InfoBox"
      +  },
      +  {
      +    "$ref": "#/$defs/TextBox"
      +  }
      +]
    • addedInput schema / properties / json / $defs / Blockquote
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "backgroundColor": {
      +      "type": "string"
      +    },
      +    "borderColor": {
      +      "default": "#cccccc",
      +      "type": "string"
      +    },
      +    "children": {
      +      "items": {
      +        "$ref": "#/$defs/Block"
      +      },
      +      "type": "array"
      +    },
      +    "leftIndent": {
      +      "default": 720,
      +      "type": "number"
      +    },
      +    "style": {
      +      "default": "default",
      +      "enum": [
      +        "default",
      +        "emphasized",
      +        "minimal"
      +      ],
      +      "type": "string"
      +    },
      +    "type": {
      +      "const": "blockquote"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "children"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / CurrentDate
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bold": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "color": {
      +      "default": "#000000",
      +      "type": "string"
      +    },
      +    "format": {
      +      "default": "MM/dd/yyyy",
      +      "description": "Date format string",
      +      "type": "string"
      +    },
      +    "italics": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "size": {
      +      "default": 12,
      +      "type": "number"
      +    },
      +    "type": {
      +      "const": "currentDate"
      +    }
      +  },
      +  "required": [
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / DocumentTitle
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bold": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "color": {
      +      "default": "#000000",
      +      "type": "string"
      +    },
      +    "italics": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "size": {
      +      "default": 12,
      +      "type": "number"
      +    },
      +    "type": {
      +      "const": "documentTitle"
      +    }
      +  },
      +  "required": [
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / FootnoteReference
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "customMark": {
      +      "description": "Custom reference mark (overrides numberFormat)",
      +      "type": "string"
      +    },
      +    "footnoteId": {
      +      "type": "string"
      +    },
      +    "numberFormat": {
      +      "default": "decimal",
      +      "enum": [
      +        "decimal",
      +        "upperRoman",
      +        "lowerRoman",
      +        "upperLetter",
      +        "lowerLetter",
      +        "symbol"
      +      ]
      +    },
      +    "type": {
      +      "const": "footnoteReference"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "footnoteId"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / HeaderFooterContent
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "alignment": {
      +      "default": "left",
      +      "enum": [
      +        "left",
      +        "center",
      +        "right"
      +      ]
      +    },
      +    "children": {
      +      "items": {
      +        "$ref": "#/$defs/HeaderFooterElement"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / HeaderFooterElement
      Added value: +{
      +  "oneOf": [
      +    {
      +      "$ref": "#/$defs/HeaderFooterText"
      +    },
      +    {
      +      "$ref": "#/$defs/PageNumber"
      +    },
      +    {
      +      "$ref": "#/$defs/HeaderFooterImage"
      +    },
      +    {
      +      "$ref": "#/$defs/CurrentDate"
      +    },
      +    {
      +      "$ref": "#/$defs/DocumentTitle"
      +    }
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / HeaderFooterImage
      Added value: +{
      +  "additionalProperties": false,
      +  "oneOf": [
      +    {
      +      "required": [
      +        "data",
      +        "format"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "path"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "url"
      +      ]
      +    }
      +  ],
      +  "properties": {
      +    "data": {
      +      "description": "base64-encoded image data",
      +      "type": "string"
      +    },
      +    "format": {
      +      "enum": [
      +        "png",
      +        "jpeg",
      +        "jpg"
      +      ]
      +    },
      +    "height": {
      +      "type": "number"
      +    },
      +    "path": {
      +      "description": "local file path to image",
      +      "type": "string"
      +    },
      +    "type": {
      +      "const": "image"
      +    },
      +    "url": {
      +      "description": "URL to download image from",
      +      "type": "string"
      +    },
      +    "width": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / HeaderFooterText
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bold": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "color": {
      +      "default": "#000000",
      +      "type": "string"
      +    },
      +    "fontFamily": {
      +      "default": "Arial",
      +      "type": "string"
      +    },
      +    "italics": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "size": {
      +      "default": 12,
      +      "type": "number"
      +    },
      +    "text": {
      +      "type": "string"
      +    },
      +    "type": {
      +      "const": "text"
      +    },
      +    "underline": {
      +      "default": false,
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "text"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / HorizontalRule
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "alignment": {
      +      "default": "center",
      +      "enum": [
      +        "left",
      +        "center",
      +        "right"
      +      ],
      +      "type": "string"
      +    },
      +    "color": {
      +      "default": "#000000",
      +      "type": "string"
      +    },
      +    "size": {
      +      "default": 1,
      +      "type": "number"
      +    },
      +    "style": {
      +      "default": "single",
      +      "enum": [
      +        "single",
      +        "double",
      +        "thick",
      +        "thin",
      +        "dotted",
      +        "dashed"
      +      ],
      +      "type": "string"
      +    },
      +    "type": {
      +      "const": "horizontalRule"
      +    },
      +    "width": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / InfoBox
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "boxType": {
      +      "default": "info",
      +      "enum": [
      +        "info",
      +        "warning",
      +        "error",
      +        "success",
      +        "note"
      +      ],
      +      "type": "string"
      +    },
      +    "children": {
      +      "items": {
      +        "$ref": "#/$defs/Block"
      +      },
      +      "type": "array"
      +    },
      +    "customColors": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "backgroundColor": {
      +          "type": "string"
      +        },
      +        "borderColor": {
      +          "type": "string"
      +        },
      +        "textColor": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "icon": {
      +      "default": true,
      +      "type": "boolean"
      +    },
      +    "title": {
      +      "type": "string"
      +    },
      +    "type": {
      +      "const": "infoBox"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "boxType",
      +    "children"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / json / $defs / Inline / oneOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/TextRun"
      -  },
      -  {
      -    "$ref": "#/$defs/Hyperlink"
      -  }
      -]New value: +[
      +  {
      +    "$ref": "#/$defs/TextRun"
      +  },
      +  {
      +    "$ref": "#/$defs/Hyperlink"
      +  },
      +  {
      +    "$ref": "#/$defs/FootnoteReference"
      +  }
      +]
    • addedInput schema / properties / json / $defs / NoteContent
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "children": {
      +      "items": {
      +        "$ref": "#/$defs/Block"
      +      },
      +      "type": "array"
      +    },
      +    "separator": {
      +      "default": "line",
      +      "description": "Separator style before the note",
      +      "enum": [
      +        "line",
      +        "none",
      +        "continuation"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "children"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / PageNumber
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bold": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "color": {
      +      "default": "#000000",
      +      "type": "string"
      +    },
      +    "format": {
      +      "default": "decimal",
      +      "enum": [
      +        "decimal",
      +        "upperRoman",
      +        "lowerRoman",
      +        "upperLetter",
      +        "lowerLetter"
      +      ]
      +    },
      +    "italics": {
      +      "default": false,
      +      "type": "boolean"
      +    },
      +    "size": {
      +      "default": 12,
      +      "type": "number"
      +    },
      +    "start": {
      +      "default": 1,
      +      "type": "number"
      +    },
      +    "type": {
      +      "const": "pageNumber"
      +    }
      +  },
      +  "required": [
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / Table / properties / alignment
      Added value: +{
      +  "default": "left",
      +  "enum": [
      +    "left",
      +    "center",
      +    "right"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / Table / properties / borderColor
      Added value: +{
      +  "default": "#000000",
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / Table / properties / borderSize
      Added value: +{
      +  "default": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / json / $defs / Table / properties / borderStyle
      Added value: +{
      +  "default": "single",
      +  "enum": [
      +    "single",
      +    "double",
      +    "thick",
      +    "thin",
      +    "dotted",
      +    "dashed"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / Table / properties / style
      Added value: +{
      +  "default": "none",
      +  "enum": [
      +    "none",
      +    "table-grid",
      +    "table-list",
      +    "table-colorful"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / TableCell / properties / backgroundColor
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / TableCell / properties / borders
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bottom": {
      +      "default": true,
      +      "type": "boolean"
      +    },
      +    "left": {
      +      "default": true,
      +      "type": "boolean"
      +    },
      +    "right": {
      +      "default": true,
      +      "type": "boolean"
      +    },
      +    "top": {
      +      "default": true,
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / TableCell / properties / margins
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bottom": {
      +      "default": 0,
      +      "type": "number"
      +    },
      +    "left": {
      +      "default": 108,
      +      "type": "number"
      +    },
      +    "right": {
      +      "default": 108,
      +      "type": "number"
      +    },
      +    "top": {
      +      "default": 0,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / $defs / TableCell / properties / verticalAlign
      Added value: +{
      +  "default": "top",
      +  "enum": [
      +    "top",
      +    "center",
      +    "bottom"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / json / $defs / TableRow / properties / cantSplit
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / json / $defs / TableRow / properties / height
      Added value: +{
      +  "type": "number"
      +}
    • addedInput schema / properties / json / $defs / TableRow / properties / isHeader
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / json / $defs / TextBox
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "borders": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "color": {
      +          "default": "#000000",
      +          "type": "string"
      +        },
      +        "size": {
      +          "default": 1,
      +          "type": "number"
      +        },
      +        "style": {
      +          "default": "single",
      +          "enum": [
      +            "single",
      +            "double",
      +            "thick",
      +            "thin",
      +            "dotted",
      +            "dashed",
      +            "none"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "children": {
      +      "items": {
      +        "$ref": "#/$defs/Block"
      +      },
      +      "type": "array"
      +    },
      +    "fill": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "color": {
      +          "type": "string"
      +        },
      +        "transparency": {
      +          "default": 0,
      +          "maximum": 100,
      +          "minimum": 0,
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "height": {
      +      "type": "number"
      +    },
      +    "position": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "anchor": {
      +          "default": "paragraph",
      +          "enum": [
      +            "page",
      +            "margin",
      +            "paragraph"
      +          ],
      +          "type": "string"
      +        },
      +        "x": {
      +          "type": "number"
      +        },
      +        "y": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": {
      +      "const": "textBox"
      +    },
      +    "width": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "children"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / json / properties / footers
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "default": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    },
      +    "even": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    },
      +    "first": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / properties / footnotes
      Added value: +{
      +  "additionalProperties": false,
      +  "patternProperties": {
      +    "^[a-zA-Z0-9_-]+$": {
      +      "$ref": "#/$defs/NoteContent"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / properties / headers
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "default": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    },
      +    "even": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    },
      +    "first": {
      +      "$ref": "#/$defs/HeaderFooterContent"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / json / properties / pageSettings
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "footerMargin": {
      +      "default": 720,
      +      "type": "number"
      +    },
      +    "headerMargin": {
      +      "default": 720,
      +      "type": "number"
      +    },
      +    "margins": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "bottom": {
      +          "default": 1440,
      +          "type": "number"
      +        },
      +        "left": {
      +          "default": 1440,
      +          "type": "number"
      +        },
      +        "right": {
      +          "default": 1440,
      +          "type": "number"
      +        },
      +        "top": {
      +          "default": 1440,
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "orientation": {
      +      "default": "portrait",
      +      "enum": [
      +        "portrait",
      +        "landscape"
      +      ],
      +      "type": "string"
      +    },
      +    "pageSize": {
      +      "default": "A4",
      +      "enum": [
      +        "A4",
      +        "A3",
      +        "A5",
      +        "Letter",
      +        "Legal",
      +        "Tabloid",
      +        "Executive"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only mentions the tool returns an id. It does not disclose side effects, permissions, or limitations such as whether it overwrites existing files or where the document is stored.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first states purpose and output, second gives prerequisite and a key detail. No unnecessary words, efficient for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the input schema and lack of output schema/annotations, the description is minimal. It relies heavily on docx-getSchema for full details, which is acceptable but leaves many aspects uncovered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'json' is complex with no schema description (0% coverage). The description adds value by mentioning image support via data/path/url and directing to docx-getSchema, but it does not explain the rest of the JSON structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it creates a new docx from JSON and returns an id, which distinguishes it from sibling tools like docx-editContent or docx-insertContent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises using docx-getSchema first to understand the JSON structure, providing a clear prerequisite. However, it lacks guidance on when not to use this tool versus siblings for editing or querying.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.