# fill_document

> Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF.

Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first.

Stamp caller-supplied values into a document's detected fields (keyed by field_id from list_fields/detect_fields) and store the filled PDF. Returns per-field results — check EVERY result before assuming the fill succeeded: 'filled'/'formatted' means the value was stamped in-box; 'overflowed' means the value did NOT fit and was NOT stamped (shorten the value or leave it for a human); 'skipped' means the value was invalid for the field's type (see the result's reason). Never assume a fill succeeded without checking results. A choice question (groups[] from list_fields) is answered with values[<group id>] = one option (single) or a list (multi), each named by the option's value or label; an unknown option, two options for a single question, or more than max is refused with a 422 naming the valid options. groups[] in the result says which options were ticked. Call download_document with artifact:'filled' afterward to retrieve the stamped PDF. A box for a government ID number (passport, visa grant, tax file, social security, driver licence) is stamped in full, but its rendered_text comes back masked to its last 3 characters. Masked values (•••123) can't be sent back: ask the person for the full number.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `document_id` | string | yes |  |
| `values` | map of string \| number \| boolean \| string[] | no | Map of field_id -> value, and group_id -> option (single) or [options] (multi) |
| `deterministic` | boolean | no | Disable any non-deterministic layout choices (for reproducible test fixtures) |
| `idempotency_key` | string | no | Same key = same call: a retry (e.g. after a timeout) returns the first result instead of doing it again. The same key with other arguments is refused (422 idempotency_key_reused). Up to 255 characters |
