Skip to main content
Glama

Inspect PDF form fields

pdf_inspect
Read-onlyIdempotent

List a PDF's AcroForm fields—names, types, options, values, maxLength—and produce a paste-ready fillTemplate with an XFA flag. Inspect first before filling to avoid unknown-field or over-length errors.

Instructions

List a PDF's AcroForm form fields — names, types, options, current values, per-field maxLength where declared — plus a paste-ready fillTemplate object for 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. Call this FIRST when filling an unfamiliar PDF, since pdf_fill rejects unknown field names and over-length values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdf_pathYesPDF 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.

Output Schema

TableJSON 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
fillTemplateYesField name to empty-or-current value, ready to edit and pass to pdf_fill

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, and the description's 'never modified' statement is consistent with them — no contradiction. It adds genuinely useful context beyond the annotations: the hasXFA caveat that hybrid AcroForm/XFA inputs 'lose their XFA layer when filled' and the count-0 edge case for PDFs with no fillable form.

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

Conciseness5/5

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

Three sentences with zero fluff: the core return value is front-loaded, the edge case occupies one short sentence, and the workflow guidance closes it out. The parenthetical XFA caveat is dense but earns its place because it warns of a destructive downstream side effect an agent would otherwise discover only after filling.

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?

With a single well-documented parameter, a full safety profile in annotations, and an output schema present, the bar is low and the description clears it easily. It covers purpose, return contents, the no-fields edge case, the XFA caveat, and ordering relative to pdf_fill — nothing an agent needs to call this tool correctly is missing.

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 description coverage is 100%, so the parameter semantics are fully carried by the input schema, which already documents absolute paths, https URLs, data URIs, and the remote-server caveat. Baseline 3 applies; the description's 'fetched or read' phrasing loosely reinforces the URL/data-URI guidance but adds no new parameter-level meaning.

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 starts with a specific verb and resource — 'List a PDF's AcroForm form fields' — and enumerates exactly what is returned (names, types, options, values, maxLength, a paste-ready fillTemplate, and a hasXFA flag). It distinguishes itself from the sibling pdf_fill by framing the output as direct input for that tool, so an agent can tell them apart without opening either 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?

The final sentence gives explicit when-to-use guidance: 'Call this FIRST when filling an unfamiliar PDF,' and justifies it with a concrete failure mode of the alternative — 'pdf_fill rejects unknown field names and over-length values.' This names the alternative, the triggering condition, and the rationale, leaving nothing to inference.

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

Deploy Server

Other Tools