Skip to main content
Glama

JustFill PDF Form Automation

Open a PDF or scan

open_pdf

Open a PDF (or an image of a form: JPG/PNG/TIFF) and detect its fields.

The document comes from exactly ONE of:
- `file`: a PDF/image the user attached in the chat, for clients that
  provide file parameters (no upload needed). A file without a
  download_url cannot be fetched; an upload_token covers that case,
- `url`: a public link to the document,
- `upload_token`: from request_file_upload, for files on the user's
  device or chat attachments that `file` cannot carry,
- `file_base64`: exact bytes of a small file (< ~200 KB). Larger base64
  passed through a model gets truncated, and a compressed or rebuilt file
  breaks field detection and no longer matches its template.
Resolution order: saved template (deterministic) -> embedded AcroForm ->
ML detection with per-field confidence. force_detect=True skips templates.
ML detection scans only the first `max_pages` pages; for a longer document
the result lists `unprocessed_page_indices`, which another open_pdf call
with a larger max_pages scans.
Returns a 24-hour `workspace_id` (`summary.workspace_id`), which every
subsequent workspace tool takes.

When to use:
- Call `open_pdf` once to load a document and initialize a workspace (or call
  it again with a larger `max_pages` or `force_detect=True`).
- Use `list_fields` to re-read fields in an already-open workspace without
  re-running detection, or `list_templates` to browse saved account templates.

Input Schema

NameRequiredDescriptionDefault
urlNoPublic HTTP or HTTPS URL of the PDF or form image (JPG, PNG, TIFF, WEBP; max 50 MB). Mutually exclusive with `file`, `upload_token`, and `file_base64`.
fileNo
filenameNoDisplay filename for the workspace and default output filename stem (e.g. `'w9.pdf'`). Automatically inferred from the attachment or URL path when left at the default `'document.pdf'`.document.pdf
max_pagesNoMaximum number of pages (starting from page 0, minimum 1) to scan during ML field detection. Unscanned pages are reported in `summary.unprocessed_page_indices`.
file_base64NoBase64-encoded bytes of a small unmodified PDF or image (< ~200 KB). For larger files, use `file`, `url`, or `request_file_upload` + `upload_token` to avoid model truncation. Mutually exclusive with `file`, `url`, and `upload_token`.
force_detectNoIf `True`, skips saved account templates and embedded AcroForm fields and forces a fresh ML detection pass across the first `max_pages` pages.
upload_tokenNoOne-time upload token returned by `request_file_upload` after the file has been uploaded (or `'latest'` to use the most recent unconsumed upload). Mutually exclusive with `file`, `url`, and `file_base64`.
min_confidenceNoMinimum ML detection confidence threshold in `0.0`–`1.0` (inclusive). ML-detected fields scoring below `min_confidence` are omitted; deterministic template and AcroForm fields always have confidence `1.0` and are kept.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / file_base64 / description
      Added value: +"Base64-encoded bytes of a small unmodified PDF or image (< ~200 KB). For larger files, use `file`, `url`, or `request_file_upload` + `upload_token` to avoid model truncation. Mutually exclusive with `file`, `url`, and `upload_token`."
    • addedInput schema / properties / filename / description
      Added value: +"Display filename for the workspace and default output filename stem (e.g. `'w9.pdf'`). Automatically inferred from the attachment or URL path when left at the default `'document.pdf'`."
    • addedInput schema / properties / force_detect / description
      Added value: +"If `True`, skips saved account templates and embedded AcroForm fields and forces a fresh ML detection pass across the first `max_pages` pages."
    • addedInput schema / properties / max_pages / description
      Added value: +"Maximum number of pages (starting from page 0, minimum 1) to scan during ML field detection. Unscanned pages are reported in `summary.unprocessed_page_indices`."
    • addedInput schema / properties / min_confidence / description
      Added value: +"Minimum ML detection confidence threshold in `0.0`–`1.0` (inclusive). ML-detected fields scoring below `min_confidence` are omitted; deterministic template and AcroForm fields always have confidence `1.0` and are kept."
    • addedInput schema / properties / upload_token / description
      Added value: +"One-time upload token returned by `request_file_upload` after the file has been uploaded (or `'latest'` to use the most recent unconsumed upload). Mutually exclusive with `file`, `url`, and `file_base64`."
    • addedInput schema / properties / url / description
      Added value: +"Public HTTP or HTTPS URL of the PDF or form image (JPG, PNG, TIFF, WEBP; max 50 MB). Mutually exclusive with `file`, `upload_token`, and `file_base64`."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare mutability and open-world hints; the description adds the substantive traits: the deterministic -> AcroForm -> ML resolution order, that detection is page-limited with unprocessed_page_indices reported, and that the workspace_id expires in 24 hours. It also warns that rebuilt/compressed files break field detection and that large base64 gets truncated.

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?

Front-loaded purpose followed by a bulleted source selector and a usage block, so the structure is easy to scan. It repeats the base64 size/truncation caveat from the schema and the max_pages behavior, which is mild redundancy but not damaging.

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?

An output schema exists, so return values need no explanation, and the description still names the key return field (summary.workspace_id) and its lifetime. For an 8-parameter, nested, open-world ingestion tool, nothing an agent needs in order to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is already 88%, yet the description still adds value the schema cannot: the exactly-one-source constraint with a resolution-order rationale, the guidance that a file lacking download_url must use upload_token, and the ~200 KB base64 limit with the reason. This is meaningfully more than the field-level descriptions.

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 and resource ("Open a PDF ... and detect its fields") and immediately names the accepted variants (JPG/PNG/TIFF). It is clearly distinguishable from siblings like list_fields and request_file_upload, which are called out by name.

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

Usage Guidelines5/5

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

The closing "When to use" block explicitly says to call it once to load a document and initialize a workspace, and routes to list_fields for re-reading and list_templates for browsing templates. It also names the re-invocation conditions (larger max_pages or force_detect=True).

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.