Skip to main content
Glama

Fill / flatten an existing AcroForm

fill_form
Idempotent

Populate AcroForm fields in an existing PDF and optionally flatten the form, preserving signatures from prior revisions.

Instructions

Fill and/or flatten the AcroForm of an EXISTING PDF (add_form creates one) as an incremental update — prior signatures stay valid for their revision. values: fully-qualified name → string (array for multi-select), boolean or export state for checkbox/radio. flatten:true stamps appearances and drops the interactive layer (with no values = pure flatten). Unknown names → FORM_FIELD_NOT_FOUND unless onUnknownField:'ignore'; signature fields cannot be filled (FORM_UNSUPPORTED). Encrypted sources: password.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valuesNoMap of fully-qualified field name → value. Text/choice: a string (array of strings for multi-select listboxes). Checkbox/radio: a boolean or the export-state string. Omit (or pass {}) with flatten:true for a pure flatten.
flattenNoWhen true, stamp appearances into page content and remove the interactive fields after filling.
passwordNoPassword (user or owner) of an encrypted source. Never logged or echoed.
pdfBase64YesBase64-encoded source PDF containing the AcroForm to fill. Use read_form_fields first to discover field names.
nonWinAnsiNoBehaviour when a value contains non-WinAnsi characters (appearance font is Helvetica/WinAnsi). 'throw' (default) rejects it; 'needAppearances' writes the value and sets /NeedAppearances so the viewer regenerates the appearance.throw
outputModeNo'base64' (default) returns the PDF inline; 'file' writes it inside the PDFNATIVE_MCP_OUTPUT_DIR sandbox (SECURITY_VIOLATION when the sandbox is not configured).base64
outputPathNoRequired when outputMode='file'. Relative path inside the sandbox; must end with .pdf.
onUnknownFieldNoBehaviour for a value key that matches no field. 'throw' (default) → FORM_FIELD_NOT_FOUND; 'ignore' skips it.throw

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
summaryNoTool-specific summary, when produced.
filePathNoSandboxed absolute path (file mode).
sizeBytesYes
diagnosticsNoEngine diagnostics (when includeDiagnostics=true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.2
    • changedOutput schema / properties / diagnostics / description
      Previous value: -"PDF/A diagnostics (when includeDiagnostics=true)."New value: +"Engine diagnostics (when includeDiagnostics=true)."
  2. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations by disclosing that writes are incremental so prior signatures stay valid for their revision, that flatten.drops the interactive layer, that unknown field names raise FORM_FIELD_NOT_FOUND unless onUnknownField:'ignore', that signature fields cannot be filled (FORM_UNSUPPORTED), and that encrypted sources need a password. These are exactly the behavioral traits an agent needs and none are derivable from readOnlyHint/idempotentHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Effectively four dense sentences with no filler; the operation and its alternative are front-loaded and error behavior is packed into terse semicolon clauses. The telegraphic compression (backticked terms, arrow notation) costs a little readability, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter mutation tool with a nested values object and an output schema, the description covers scope, alternatives, mutation semantics, error codes, security (encryption) and the incremental-update guarantee. Return values need not be explained since an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so baseline is 3, but the description adds real meaning: the values map semantics (fully-qualified name → string/array/boolean/export state), the pure-flatten shorthand, and the signature-field exclusion. It omits explaining outputMode/outputPath sandbox behavior, which lives only in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (fill and/or flatten) on a specific resource (the AcroForm of an EXISTING PDF) and explicitly contrasts with the sibling that creates one (add_form). An agent can distinguish this from add_form and read_form_fields without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names add_form as the alternative for creating forms and states the selection condition ('EXISTING PDF'), plus clarifies that flatten with no values is a pure flatten. It does not explicitly route to read_form_fields for discovery in the description itself (though the schema does), so it stops just short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.