Skip to main content
Glama

Fill a PDF form

fill_pdf_form

Fills the fields of a PDF form by their full names, as get_pdf_info lists them, and returns the render with download_url and form: how many fields were filled, which were left out, and which hold a calculation or display format that no viewer ran. The form stays fillable, or flatten draws the values into the pages. A name the form lacks or a value its field does not take fails the call with form_field_unknown or form_value_invalid, naming the field, unless strict is false. Pass exactly one PDF: source, a render or library file of the workspace, or file_base64, the PDF itself. Starter plan and above; 0.5 units on a live key. The values are never stored; a signed form and an XFA form are refused.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fill_pdf_form"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsNoValues by the fields' full names: text for a text field, true or false for a check box, one of the field's options for a dropdown, a radio group or a check box with several on-values, a list of options for a list box
sourceNoA PDF of the workspace: the rnd_ id of a PDF render, or a PDF of the file library by name (such as terms.pdf) or fil_ id
strictNotrue (the default) fails on a name the form lacks or a value its field does not take; false leaves both out and lists them in form.skipped
flattenNoDraw the values into the pages and remove the fields, so the values can no longer be changed
filenameNoName of the file behind download_url; the source's name when left out
file_nameNoName of the PDF given as file_base64 or path, e.g. contract.pdf; the results are named after it
file_base64NoThe PDF itself, base64 encoded, up to 20 MB; sent with the request and not kept

Output Schema

NameRequiredDescriptionDefault
idYesrnd_ id of the render
formNoWhat fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran
pdfaNoThe PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it
errorYesWhy a failed render failed
unitsYesUnits the render counted
outputNoThe format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image
statusYes
einvoiceNoThe e-invoice report, when the render made one
templateYesThe template and version rendered; null for html and conversions
expires_atYesWhen download_url stops working; get_render issues a fresh one
page_countYes
environmentYes
download_urlYesSigned link to the file; null until the render succeeded
accessibilityNoThe PDF/UA-1 verdict, when the template declares it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, non-idempotent), it discloses failure modes with named error codes (form_field_unknown, form_value_invalid), the effect of strict=false (skipped fields listed in form.skipped), the irreversible consequence of flatten (fields removed, values no longer changeable), refusal of signed and XFA forms, that values are never stored, and plan/unit cost. The only gap is that the flatten behavior is close to destructive while destructiveHint is false — it is opt-in and applies to the output render rather than the source, so it reads as a documented option rather than a contradiction.

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?

It is a single dense paragraph, but front-loaded with the core action and its return shape, then ordering errors, input options, billing, and refusals. Nearly every clause carries information; the return-value sentences partially duplicate the output schema, which is the main redundancy.

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

Completeness4/5

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

For a 7-parameter write tool with an output schema, it covers the field-name source, input exclusivity, error semantics, flatten consequences, and refusal cases. Slight duplication of return fields already in the output schema and no mention of limits on field volume keep it from being fully complete.

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 description coverage is 100%, so the baseline is 3, but the description adds real meaning: field values are keyed by full field names obtained from get_pdf_info, and only one of the three PDF inputs (source vs file_base64) may be supplied at a time — an exclusivity rule the schema does not express. The strict/flatten/filename semantics are largely restated from the schema, keeping this below 5.

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 and resource (fills the fields of a PDF form) and immediately pins field naming to a concrete sibling, 'as get_pdf_info lists them'. It also names the return payload (download_url and form summary), so an agent can distinguish it from render, compress_pdf, or redact_pdf without opening the 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?

It gives clear operational conditions: pass exactly one PDF source (render/library file or file_base64), use get_pdf_info to obtain field names, use flatten only when values should stop being editable, and set strict=false to skip rather than fail. What is missing is explicit routing against alternatives such as render or get_pdf_info for read-only inspection, though the cross-reference to get_pdf_info implies the split.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources