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.
destructiveSends, cancels or emails people. Clients ask you before running it.
What it does
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 | Description |
|---|---|---|
document_idrequired | string | |
values | map of string | number | boolean | string[] | Map of field_id -> value, and group_id -> option (single) or [options] (multi). |
deterministic | boolean | Disable any non-deterministic layout choices (for reproducible test fixtures). |
idempotency_key | string | 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 |
Call it
Your MCP client builds this request for you. This is what it sends to https://appliflo.com/api/mcp, with the required inputs filled with placeholders.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "fill_document",
"arguments": {
"document_id": "<document_id>"
}
}
}Input schema
The JSON Schema the server lists for this tool in tools/list.
{
"type": "object",
"properties": {
"document_id": {
"type": "string"
},
"values": {
"type": "object",
"description": "Map of field_id -> value, and group_id -> option (single) or [options] (multi).",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"deterministic": {
"type": "boolean",
"description": "Disable any non-deterministic layout choices (for reproducible test fixtures)."
},
"idempotency_key": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "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)."
}
},
"required": [
"document_id"
]
}correct_field
Apply a correction to one detected field (label, semantic_type, bbox, and/or field type — every patch key is optional, only the keys you send are changed).
fill_form_oneshot
One-shot demo/quick-fill: upload a PDF (or a Word DOCX, converted to PDF; as content_base64 OR file_url, exactly one; at most 20 MB) and a values map keyed by each field's detected label text (the only thing knowable before detection runs), and get back a filled PDF in one call — no persisted document_id, no separate detect_fields/fill_document round trip.