Skip to Content

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

NameTypeDescription
document_idrequiredstring
valuesmap of string | number | boolean | string[]Map of field_id -> value, and group_id -> option (single) or [options] (multi).
deterministicbooleanDisable any non-deterministic layout choices (for reproducible test fixtures).
idempotency_keystringSame 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"
  ]
}

On this page