Skip to main content
Glama

Read PDF metadata

pdf_metadata
Read-onlyIdempotent

Read a PDF's page count, dimensions, rotation, document info and form fields before splitting, rotating or filling it. Read-only; never modifies the file.

Instructions

Read a PDF's document info: page_count, per-page width/height (points) and rotation, title, author, subject, keywords, creator, producer, creation_date, modification_date (ISO 8601, null when absent), whether it was encrypted, and has_form / form_field_count. Call this to learn a document's size and shape before splitting, rotating or filling. Read-only: the PDF is fetched or read but never modified.

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_metadata"
  }
}

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

Output Schema

NameRequiredDescriptionDefault
pagesYes
titleYes
authorYes
creatorYes
subjectYes
has_formYes
keywordsYes
producerYes
encryptedYes
page_countYes
creation_dateYes
form_field_countYes
modification_dateYes
form_field_count_cappedNoTrue when the form-field count stopped at the 2,000 cap, so the real number may be higher

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is largely pre-supplied. The description does add real context beyond them, notably that absent dates come back as null and that the file is fetched or read but never modified, but that overlaps heavily with what the annotations already assert.

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, each front-loaded with the essential clause and no filler. The long field enumeration is dense but every listed field is a return value an agent may need, and the closing read-only sentence is the only partially redundant element given the annotations.

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?

An output schema exists, so return values need not be re-explained and the description rightly spends its words on scope and pre-condition use instead. Combined with schema-documented password and source handling, an agent has enough to call it correctly; only sibling disambiguation 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% and the schema already explains both pdf_path sources (local path, https URL, data URI) and the user-password case, so the description adds nothing about parameters. The baseline of 3 applies when the schema carries the parameter burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Read') and resource ('a PDF's document info') and enumerates exactly what comes back, so an agent knows the payload without opening the output schema. It stops short of distinguishing itself from the overlapping sibling pdf_inspect, which the description never mentions.

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?

Explicitly says when to call it: 'to learn a document's size and shape before splitting, rotating or filling,' which maps the tool to concrete downstream siblings. It gives no when-not guidance, so an agent cannot tell from this text alone whether pdf_inspect is a substitute or a complement.

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