Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Fill Form (AcroForm)

fill_form
Idempotent

Fill interactive form fields in an existing PDF with matching values, including text, checkboxes, dropdowns, and radio buttons. Unknown field names are listed in the error to help identify them.

Instructions

Fill field values into an existing PDF's interactive form (AcroForm). If you do not know the field names, pass a nonexistent one — the error lists every field name and type. CJK values need fontPath or the PDF_WRITER_FONT environment variable. flatten: true makes the form non-interactive after filling, but on a tagged PDF that breaks PDF/UA conformance and additionally requires allowBreakingTags: true. XFA forms are not supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesObject of field name → value. Value type matches the field kind: text = string or number / checkbox = boolean / dropdown, optionlist = string or string array / radio = string. Example: {"user.name": "山田 太郎", "agree": true, "plan": "A"}
flattenNoFlatten to non-interactive after filling. Default false. When true, values can no longer be edited.
fontPathNoFont used to render values (.ttf/.otf). Falls back to the PDF_WRITER_FONT environment variable, then the standard font. Required for CJK values.
inputPathYesAbsolute path of the target PDF.
outputPathNoDestination file path (absolute). When omitted, a base64 string is returned instead.
returnBase64NoWhen true, include a base64 string in the result in addition to saving.
allowBreakingTagsNoAllow flattening even on a tagged PDF. Default false. When true, PDF/UA-1 conformance breaks.
allowBreakingSignaturesNoWhen the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.21.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already mark this as a non-read-only, idempotent, non-destructive operation. The description adds valuable behavior beyond that: flattening breaks PDF/UA conformance on tagged PDFs and requires allowBreakingTags: true, CJK values need a font, and the error response lists all field names/types when given an unknown field. It does not mention signature-breaking behavior (covered in the schema) or the base64 return option (also in schema), but it covers the most consequential side effects and requirements.

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

Conciseness5/5

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

The description is a compact paragraph of four sentences, each earning its place: main purpose, field-discovery tip, CJK requirement, and flatten side-effect warning. It is front-loaded with the core action and keeps the most important caveats early. No redundant or filler content.

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 a tool with 8 parameters, nested objects, and no output schema, the description covers the essential behavioral and usage context an agent needs: how to discover field names, font requirements for non-Latin text, the flattening caveat, and the unsupported XFA case. Output format and signature-breaking behavior are already documented in the schema, so they do not need repetition. The description is complete for successful invocation.

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?

The schema already describes all 8 parameters with 100% coverage, so the baseline is 3. The description enhances this by explaining cross-parameter dependencies (CJK requires fontPath or the PDF_WRITER_FONT env var, flatten on a tagged PDF requires allowBreakingTags), and it explains the field-naming trick that affects how the fields parameter is used. This goes beyond simply restating the schema and gives the agent practical guidance on parameter usage.

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?

The description opens with a specific verb-resource pair ('Fill field values into an existing PDF's interactive form (AcroForm)') and explicitly scopes the tool to AcroForm, distinguishing it from the sibling flatten_form and other PDF tools. It also notes XFA forms are unsupported, further clarifying its domain. An agent can unambiguously identify this as the tool for populating interactive form fields.

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?

The description gives practical guidance: a trick for discovering field names by passing a nonexistent one, a prerequisite for CJK values (fontPath or env var), and a clear exclusion (XFA not supported). It does not explicitly point to the sibling flatten_form for flatten-only workflows, and it does not contrast with other form-related tools, but the scope and exclusions are sufficient for most selection decisions.

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