How to fill Word form fields from data with an AI agent
Leave feedback
On this page
A Word form has named fields — text boxes, check boxes, drop-downs — and an agent that fills it by name fills it correctly. Run the GroupDocs.Editor MCP server locally: the agent reads the field names with get_form_fields, fills them with fill_form_fields, and the server reports any value it had no field for:
dnx GroupDocs.Editor.Mcp --yes
with GROUPDOCS_MCP_STORAGE_PATH pointing at your documents folder — or the Docker image, ghcr.io/groupdocs-editor/editor-net-mcp. Per-client config: Register in AI clients.
Fill new-employee-form.docx for Amara Okafor, amara.okafor@northwind.example, Finance, starting 1 December 2026; she agrees to the code of conduct. Her phone is +31 10 555 0100.
Note
The commands and config snippets on this page are for the .NET build of the server — the only platform available today. Installation and client setup: MCP server for .NET. Other platforms will expose the same tools with their own launch command; everything else on this page applies unchanged.
Prerequisites
A Word form with legacy or content form fields (DOCX, DOC, DOCM, DOT, DOTX, RTF, ODT) in the storage folder.
The server registered in your AI client — quick start.
Captured from server 26.10.0 against a synthetic six-field form. The server prints the full path inside your storage folder; it is shortened to …/ here, and the evaluation line every response starts with is trimmed unless shown.
Reading the filled copy back returns "value": "Amara Okafor", "selected": "Finance", "Agree": true — and Newsletter still false, because nobody asked to tick it.
The form has no phone field. The server filled the five it knows and named the one it did not, so the agent can tell you the phone number is not on the form, rather than report a complete form.
One form per row
With a list of people — a CSV, a spreadsheet the agent reads with its own tools, a table pasted into the chat — the agent repeats fill_form_fields per row and names each copy:
Fill one copy of new-employee-form.docx for each row of new-hires.csv, named form-.docx, and list any column that has no field on the form.
outputName keeps the copies apart; without it each call would write new-employee-form_edited.docx again.
Expected result
A filled copy per person, the original form untouched, and a list of values the form had no place for.
Troubleshooting
Symptom
Cause
Fix
“Updated 0 field(s) … Not found: … No file was written.”
the names are the labels on the page, not the field names
call get_form_fields first and use its name values
"count": 0
the document has no form fields — just text and underscores
fill it with replace_text on a placeholder, or add fields in Word
A drop-down keeps its old value
the value is not one of its options
pass one of the listed options exactly
FAQ
Which values does a check box take?"true" or "false".
Can it fill PDF forms? No — Word formats only. Convert the PDF first (turn a PDF into Word) or use a PDF form tool.
Can the filled copy be a PDF? Yes — "format": "pdf" saves the filled form as a PDF to send.
Add to your CLAUDE.md or AGENTS.md
Agents follow project instructions about when to use a tool. Paste this into the instruction file your agent reads (CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, .cursorrules):
To fill Word forms in ./forms, call groupdocs-editor get_form_fields first and
fill by the exact names it returns; one outputName per person. Report every value
the server lists under 'Not found' instead of claiming the form is complete.
Honest limits
Evaluation mode: every edited document starts with an evaluation banner, a saved workbook gains an Evaluation Warning worksheet, and only worksheets and slides 1–2 can be edited (a PDF extraction holds two pages). Licensing.
One formatting run:replace_text does not see a phrase whose words are formatted differently; use the HTML round-trip for those.
No tracked changes: the edited copy carries the new text, not a redline.
PDF editing is a conversion: text and structure come across; exact page layout does not.