create-doc
Create editable Word DOCX documents for business, legal, and research reports that users can continue editing in Word. Supports markdown, styles, headers/footers, and tables.
Instructions
Create a styled, EDITABLE Word DOCX. USE for stakeholder/business/legal/research deliverables the user will keep editing in Word, or when they say 'Word / .docx / editable / draft / template'. NOT for: a final/print/send-as-PDF deliverable (→ create-pdf), code/API/README docs (→ create-markdown), or tabular/numeric data (→ create-excel). The most full-featured tool: Document DNA defaults, 8 style presets, headers/footers with page numbers, margins, blueprint validation, and real tables. ALWAYS format the body with markdown — never a wall of plain text. Simplest: put the whole body in the content string. Supported markdown: '# H1' '## H2' '### H3' headings; 'bold'; 'italic'; 'code'; '- ' or '1. ' lists; '> ' blockquotes; '---' horizontal rule; fenced code blocks; '| a | b |' GitHub tables (with a '|---|---|' separator row); 'text' links. EXAMPLE content: "## Overview\nThis report covers Q2 results.\n\n### Highlights\n- Revenue up 18%\n- Two new markets\n\n| Metric | Value |\n|---|---|\n| MRR | $42k |\n| Churn | 1.2% |\n\n> Next review: July." Title MUST be specific. Duplicate → { duplicate: true, existingPath } (switch to edit-doc). Response includes formattingQuality and formatSuggestion — if formatSuggestion is set, the content fits another format better, so heed it. Use dryRun: true for preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags for registry search and discovery. | |
| style | No | Advanced: fine-grained style overrides merged on top of stylePreset. | |
| title | Yes | Specific descriptive title (rejected: 'Document', 'Untitled', etc.). Becomes the document H1. | |
| dryRun | No | Return a preview without writing the file (default: false). | |
| footer | No | Page footer: { text, alignment?, color? }. Use {current}/{total} placeholders for page numbers. | |
| header | No | Page header: { text, alignment?: 'left'|'center'|'right', color?: '#hex' }. Applies to every page. | |
| tables | No | Optional tables as 2D arrays. First row is the header. | |
| content | No | PREFERRED. The entire document body as ONE markdown string. Supported markdown: '# H1' '## H2' '### H3' headings; '**bold**'; '*italic*'; '`code`'; '- ' or '1. ' lists; '> ' blockquotes; '---' horizontal rule; ```fenced code blocks```; '| a | b |' GitHub tables (with a '|---|---|' separator row); '[text](https://url)' links. The title is added as the document H1 automatically, so start the body at '## '. EXAMPLE content: "## Overview\nThis report covers **Q2** results.\n\n### Highlights\n- Revenue up *18%*\n- Two new markets\n\n| Metric | Value |\n|---|---|\n| MRR | $42k |\n| Churn | 1.2% |\n\n> Next review: July." Use this instead of `paragraphs` unless you need per-paragraph style objects. | |
| docType | No | Tone and depth of the documentation. | |
| margins | No | Page margins in twips (1440 = 1 inch). Defaults: top/bottom 720 (or 1440 if header/footer set), left/right 1080. | |
| category | No | Document category for subfolder organization. | |
| blueprint | No | Optional blueprint name to validate the structure against (see list-templates). | |
| uploadUrl | No | OPTIONAL. HTTPS URL of a receiver that will accept a JSON envelope `{data:base64, filename, mimeType, size}` POSTed with this Bearer auth. If you have NOT been given an uploadUrl in your context, OMIT this field and the tool just writes the file locally. Single-use semantics — do not retry on 4xx. Works with any compliant receiver (CogniRunner attachment-upload web trigger is the reference implementation, but the contract is generic). | |
| clientHint | No | How the response should be shaped. 'interactive' = polished one-line message for end-users (no chatty registry/lineage notes). 'agent' = verbose response with all metadata for AI consumption. 'auto' (default) = detect from input shape or MCP_CLIENT_TYPE env var, falling back to 'agent'. | |
| outputPath | No | Optional. Default: derived from title, placed under docs/<category>/. | |
| paragraphs | No | ALTERNATIVE to `content`. Document body as an array — each entry a markdown string OR { text, headingLevel: 'heading1'|'heading2'|'heading3' }. Prefer the single `content` string. | |
| description | No | Brief description stored in the registry. | |
| stylePreset | No | Style preset. 'claude-like' (modern blue-accented professional) is the default for general-purpose docs. 'professional' is the executive serif look. Auto-selected from category if omitted. | |
| uploadFilename | No | OPTIONAL. Filename to put in the upload envelope. Defaults to the local file's basename. Useful when the local file got auto-suffixed (e.g. duplicate prevention) and you want a clean name on the receiver side. | |
| backgroundColor | No | Optional page background hex color, e.g. '#FFFFFF'. | |
| tableHeaderFill | No | Optional override for table header cell fill color (hex). | |
| uploadAuthHeader | No | OPTIONAL. Authorization header value for uploadUrl (e.g. 'Bearer abc123'). REQUIRED when uploadUrl is set; ignored otherwise. Never logged. | |
| enforceDocsFolder | No | If false, allow output outside docs/. Default: true (recommended). | |
| preventDuplicates | No | If false, allow same-title duplicates. Default: true (recommended). |