Skip to main content
Glama

Inspect PDF form fields

pdf_inspect
Read-onlyIdempotent

Lists AcroForm field names, types, options, current values, max lengths, fill-template data, and XFA status from a PDF to help prepare valid form fills without modifying the file.

Instructions

List the form fields (AcroForm) of a PDF: names, types, options, current values and per-field maxLength where declared, plus a fillTemplate object ready to pass to pdf_fill and a hasXFA flag (hybrid AcroForm/XFA inputs lose their XFA layer when filled). A PDF with no fillable form returns count 0. Read-only: the PDF is fetched or read but never modified. pdf_fill rejects unknown field names and over-length values; this tool lists the names and the maxLength values it checks against.

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>"
    },
    "name": "pdf_inspect"
  }
}

Input Schema

NameRequiredDescriptionDefault
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. A URL or data URI works when this server runs remotely (Smithery, hosted gateways), where local paths do not exist.

Output Schema

NameRequiredDescriptionDefault
countYesNumber of form fields found; 0 when the PDF has no fillable form
fieldsYesOne entry per form field, in document order
hasXFAYesTrue for hybrid AcroForm/XFA documents, whose XFA layer is dropped when filled
truncatedYesTrue when the form exceeded an API enumeration cap; fields is then a prefix, not the full list
fillTemplateYesField name to empty-or-current value, ready to edit and pass to pdf_fill

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.1
    • addedOutput schema / properties / fields / items / properties / label
      Added value: +{
      +  "description": "Alternate (tooltip) name, present only when the form declares one",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / pdf_path / description
      Previous value: -"PDF 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."New value: +"PDF 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. A URL or data URI works when this server runs remotely (Smithery, hosted gateways), where local paths do not exist."
  3. Changed11 schema fields changedv0.5.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / password
      Added value: +{
      +  "description": "Password to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it).",
      +  "type": "string"
      +}
    • changedInput schema / properties / pdf_path / description
      Previous value: -"PDF source: an absolute file path, 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."New value: +"PDF 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."
    • addedOutput schema / properties / count / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / count / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / fields / items / properties / maxLength / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / fields / items / properties / maxLength / minimum
      Added value: +-9007199254740991
    • changedOutput schema / properties / fields / items / properties / type / description
      Previous value: -"text, checkbox, radio, optionlist, or unsupported"New value: +"text, checkbox, dropdown, radio, optionlist, or unsupported"
    • addedOutput schema / properties / fillTemplate / properties
      Added value: +{}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when the form exceeded an API enumeration cap; fields is then a prefix, not the full list",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "count",
      -  "hasXFA",
      -  "fields",
      -  "fillTemplate"
      -]New value: +[
      +  "count",
      +  "hasXFA",
      +  "truncated",
      +  "fields",
      +  "fillTemplate"
      +]
  4. Changed2 schema fields changedv0.3.2
    • changedInput schema / properties / pdf_path / description
      Previous value: -"Absolute path to the PDF to inspect"New value: +"PDF source: an absolute file path, 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."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "count": {
      +      "description": "Number of form fields found; 0 when the PDF has no fillable form",
      +      "type": "integer"
      +    },
      +    "fields": {
      +      "description": "One entry per form field, in document order",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "checked": {
      +            "type": "boolean"
      +          },
      +          "maxLength": {
      +            "description": "Longer values are rejected by pdf_fill",
      +            "type": "integer"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "options": {
      +            "description": "Permitted values for radio/dropdown/optionlist fields",
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "raw": {},
      +          "readOnly": {
      +            "type": "boolean"
      +          },
      +          "type": {
      +            "description": "text, checkbox, radio, optionlist, or unsupported",
      +            "type": "string"
      +          },
      +          "value": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "type",
      +          "readOnly"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "fillTemplate": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Field name to empty-or-current value, ready to edit and pass to pdf_fill",
      +      "type": "object"
      +    },
      +    "hasXFA": {
      +      "description": "True for hybrid AcroForm/XFA documents, whose XFA layer is dropped when filled",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "count",
      +    "hasXFA",
      +    "fields",
      +    "fillTemplate"
      +  ],
      +  "type": "object"
      +}
  5. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, and the description reinforces this with 'the PDF is fetched or read but never modified'. Beyond the annotations it adds real behavioral context: the hasXFA flag and the warning that hybrid AcroForm/XFA inputs lose their XFA layer when filled, plus the validation contract pdf_fill enforces (unknown names, over-length values).

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?

Three sentences, front-loaded with the core verb and return payload, then the XFA caveat, then the read-only/validation contract. Dense but each sentence contributes; the middle clause listing every returned field is long, though it is the most useful part.

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, yet the description still signals the key return elements (count 0 case, hasXFA) and the downstream contract with pdf_fill. Combined with the read-only guarantee and the XFA data-loss caveat, an agent has everything needed to call it correctly and interpret the result.

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

Parameters3/5

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

Schema coverage is 100% for both parameters, including URL/data-URI vs local path and the owner-vs-user password distinction, so the schema carries the semantics. The description only lightly echoes the dual path/URL sourcing ('fetched or read') without adding format or syntax detail; baseline 3 is appropriate.

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?

Names a specific verb and resource ('List the form fields (AcroForm) of a PDF') and enumerates exactly what is returned: names, types, options, current values, maxLength, a fillTemplate object and a hasXFA flag. It also ties itself to the sibling pdf_fill, so an agent can place it in the workflow without opening another 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?

The workflow position is clear: this is the read-before-fill step, and fillTemplate is 'ready to pass to pdf_fill'. It also pre-empts the empty case ('A PDF with no fillable form returns count 0'), which covers the detect-style question. It does not explicitly exclude any sibling (e.g. pdf_detect_fields), so it stops short of 5.

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