Skip to main content
docx_create IMPORTANT: For headings and paragraphs, use docx_edit with type “markdown” instead: it is faster, creates proper styles, and handles positioning via target + placement. Only use docx_create for tables or when markdown cannot express the content. Creates a single paragraph, heading, or table. Returns nodeId and ref for the created block. After creating, the returned ref is valid for ONE immediate docx_format call. For subsequent operations, re-fetch blocks with docx_get_content to get fresh refs (refs expire after any mutation). When the user asks for a “heading”, use action “heading” with a level (default 1). Use action “paragraph” for regular body text. Position with “at”: {kind:“documentEnd”} (default), {kind:“documentStart”}, or {kind:“after”/“before”, target:{kind:“block”, nodeType, nodeId}} for relative placement. When creating multiple items in sequence, use the previous response nodeId as the next “at” target to maintain correct ordering. Do NOT use newlines in “text” to create multiple paragraphs; call this tool separately for each one.

Parameters

string, enum: 'heading' | 'paragraph' | 'table'
required
The action to perform. One of: heading, paragraph, table.
boolean
Bypass confirmation checks.
string, enum: 'direct' | 'tracked'
Edit mode: “direct” applies changes immediately, “tracked” records as suggestions.
boolean
Preview the result without applying changes.
Position: {kind:‘documentEnd’} to append, {kind:‘documentStart’} to prepend, or {kind:‘before’|‘after’, target:{kind:‘block’, nodeType:’…’, nodeId:’…’}} for relative placement.
string
Paragraph text content. Each call creates ONE paragraph. For multiple items (e.g. list items), call docx_create separately for each item: do NOT use newlines to put multiple items in one paragraph.
object
Full paragraph input as JSON (alternative to individual text/at params).
number
Heading level (1-6). Required for action ‘heading’.
number
Required for action ‘table’.
number
Required for action ‘table’.
string
required
The HERO documentId of the docx to target.