Write DOCX contents
write_contents_to_docxWrite content blocks from get_contents_from_docx to a .docx file, creating a new file or replacing the existing document body.
Instructions
Write content blocks to a .docx file. Creates a new file if the path does not exist; replaces the document body if it already exists. Pass blocks collected from get_contents_from_docx. Call before write_styles_to_docx when reformatting.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"contents": "<contents>"
},
"name": "write_contents_to_docx"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Output path for the .docx file. Provided by the MCP client in each tool call. | |
| contents | Yes | Content blocks to write (paragraph/table dicts from get_contents_from_docx). |