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 (default `5`; Free
scans up to 5 pages per call and Starter $19/mo / Pro $49/mo unlocks up to
50 pages per document); 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 (default `5`; Free tier scans up to 5 pages per call, while Starter $19/mo and Pro $49/mo unlock up to 50 pages per document). 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. Changed2 schema fields changed
    • changedInput schema / properties / max_pages / default
      Previous value: -10New value: +5
    • changedInput schema / properties / max_pages / description
      Previous 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`."New value: +"Maximum number of pages (starting from page 0, minimum 1) to scan during ML field detection (default `5`; Free tier scans up to 5 pages per call, while Starter $19/mo and Pro $49/mo unlock up to 50 pages per document). Unscanned pages are reported in `summary.unprocessed_page_indices`."
  2. 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`."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say it is a non-read-only, open-world, non-destructive, non-idempotent operation; the description adds far more: a three-step resolution order (template -> AcroForm -> ML), 24-hour workspace_id lifetime, tier page limits, truncation risk for base64 over ~200 KB, and that longer documents return unprocessed_page_indices for a follow-up call.

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 with purpose, then a source-selection list, then resolution order, then an explicit when-to-use block — good structure. Slight redundancy: the Free/Starter/Pro page limits appear in both the description and the max_pages schema, and the download_url/upload_token caveat is restated.

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, nested-object, open-world entry point to a workspace pipeline, the description covers input selection, precedence, fallback behavior, page limits, and where the workspace_id surfaces. An output schema exists, yet it still points to summary.workspace_id and summary.unprocessed_page_indices where agents need them.

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 88%, so the schema already documents each parameter, but the description adds genuine cross-parameter meaning: exactly one input source must be supplied, plus the resolution order and why file_base64 is capped. It does not restate min_confidence or filename, leaving those entirely to the schema, which is acceptable at this coverage level.

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?

Opens with a specific verb and resource: 'Open a PDF (or an image of a form: JPG/PNG/TIFF) and detect its fields.' It also names what it is not — the 'When to use' block routes re-reads to list_fields and template browsing to list_templates, so an agent can separate it from siblings without opening a schema.

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?

Explicit when-to-use section: call once to initialize a workspace, or again with larger max_pages or force_detect=True; use list_fields to re-read without re-detection. Alternatives (request_file_upload, list_templates, list_fields) are each tied to the condition that selects them.

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.