Use this workflow when generating an HWPX from an approved template or from a new blank document by orchestrating the current MCP text, table, style, and copy tools without adding new public server tools.
name template-generation description Use this workflow when generating an HWPX from an approved template or from a new blank document by orchestrating the current MCP text, table, style, and copy tools without adding new public server tools. Template Generation Use this workflow when the output should follow a reusable template or a controlled document structure. Tool Order If a template file already exists, start with copy_document . Replace placeholders with batch_replace or search_and_replace . Update structured tables with set_table_cell_text , merge_table_cells , split_table_cell , and format_table . Add controlled narrative content with add_heading , add_paragraph , and insert_paragraph . Use create_custom_style only when repeated new content needs a reusable named style. In advanced mode, run validate_structure before handoff. Blank-Document Fallback When no template exists, use: create_document add_heading add_paragraph / insert_paragraph add_table format_text / format_table Minimize Layout Drift Prefer approved templates over rebuilding layout from scratch. Use named styles consistently for repeated inserted content. Keep placeholder replacement bounded and predictable. When To Inspect Package Parts A template relies on hidden or non-obvious reference content. You need to confirm which section XML contains a repeated placeholder. The generated result must match a known package structure closely enough to justify advanced inspection. Honest Limitations There is no dedicated template-fill shortcut on the active FastMCP surface. There is no explicit delayed-save step; edits persist immediately. Full reference-structure comparison still belongs upstream or in future MCP work, not in this example skill.