Skip to main content
Glama

Add fillable form fields to a PDF

pdf_add_fields
DestructiveIdempotent

Create standard fillable AcroForm fields at exact positions in an existing PDF: text, checkbox, radio, dropdown, and signature. Fill them later with pdf_fill.

Instructions

Create standard fillable AcroForm fields in an existing PDF at exact positions: text, multiline text, checkbox, radio group, dropdown and signature box. Coordinates are PDF points measured from the bottom-left corner of the page as the viewer sees it (1 inch = 72 pt; US Letter is 612 x 792), the same frame and 1-based page numbers as pdf_edit; x and y are the field's bottom-left corner and the whole rectangle must lie inside the page (each side at least 4 pt). Every entry needs type, name and page; every type except radio also needs x, y, width and height; radio and dropdown need options. Unknown keys are rejected. A radio entry is one group whose options each carry their own value, x, y, width and height. name is 1-200 characters with no dot, unique in the request and not already a field name in the PDF (a name that equals the first part of an existing dotted name is also taken). Text takes multiline, max_length, default and font_size; checkbox takes checked; dropdown takes options (strings), default and font_size. All entries also take required, read_only, border (default true) and background (default false). font_size is a number from 1 to 200 or "auto". If omitted, text, multiline text and dropdown fields get a fixed size of min(12 pt, the largest size at which one line fits the field height), at least 4 pt, so they draw predictably when filled; a value longer than the box is then clipped, not shrunk. "auto" stores size 0, and pdf_fill then sizes the text to the box when the blank field is first filled (a short value is enlarged, a long one shrunk) and keeps that size, so a later, longer value is clipped: for predictable text omit font_size or set a number. Defaults and dropdown options use standard fonts (WinAnsi characters only: euro sign and curly quotes work, Polish L-stroke and CJK fail). The signature type creates an EMPTY signature field for a signing tool to use: nothing is signed, it is not an e-signature. At most 200 entries and 200 widgets per call, and 2,000 fields in the finished form. Fields are plain AcroForm with no JavaScript. Fill the result with pdf_fill (pdf_inspect lists the new fields). Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pdf_path": "<pdf_path>",
      "fields": "<fields>"
    },
    "name": "pdf_add_fields"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsYesFields to create. Nothing is added unless every entry is valid. Required keys: every entry type, name, page; text, checkbox, dropdown and signature also x, y, width, height; radio and dropdown also options (radio options carry their own rectangles).
passwordNoPassword to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it).
pdf_pathYesPDF source: a path to a .pdf file inside the allowed directories (PDFOPS_ROOT, default the working directory), an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist.
output_pathNoPath of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save.

Output Schema

NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
warningNoPresent as xfa-layer-dropped when a hybrid AcroForm/XFA input lost its XFA layer
output_pathNoAbsolute path written, when output_path was supplied
resource_uriNopdfops:// uri of the inline application/pdf resource, when output_path was omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only flag readOnly=false, destructive=true, idempotent=true, openWorld=true. The description adds substantial context beyond that: atomic validation ('Nothing is added unless every entry is valid'), overwrite behavior at output_path, source immutability, hard limits (200 entries/200 widgets/2,000 fields), the 7 MB inline-return cutoff, and 'plain AcroForm with no JavaScript.' These are exactly the operational facts an agent needs.

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

Conciseness3/5

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

Almost every sentence carries useful information, but the text is delivered as one dense, unstructured paragraph of roughly 350 words. Constraint, semantics, and return-value details are interleaved rather than grouped, which makes it harder to scan than its content warrants.

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 mutation tool with four parameters and an output schema, the description covers everything needed: input validation rules, coordinate frame, limits, character-set constraints, return format (output_path or inline resource with the 7 MB cap), and the follow-up fill step. Nothing essential to calling it correctly is missing.

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 the baseline is 3. The description nonetheless adds real meaning beyond the schema: the WinAnsi character restriction with concrete examples (euro sign works, Polish L-stroke and CJK fail), the rationale for font_size 'auto' versus a fixed size and its clipping consequences, and the subtle name rule that a name matching the first part of an existing dotted name is also taken.

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 opening sentence gives a specific verb and resource — 'Create standard fillable AcroForm fields in an existing PDF at exact positions' — and enumerates the supported field types (text, multiline, checkbox, radio, dropdown, signature). It is immediately distinguishable from siblings like pdf_fill and pdf_edit, which are referenced as different operations.

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 routes clearly: 'Fill the result with pdf_fill (pdf_inspect lists the new fields)' and notes the coordinate frame matches pdf_edit. It also clarifies a key when-not case — signature type creates an empty field, 'nothing is signed, it is not an e-signature.' It does not give explicit exclusions for when to prefer another field-creation path, but the workflow context is clear.

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