Skip to main content
Glama

PDF info

pdf_info
Read-onlyIdempotent

Check a PDF’s path, file size, and page count as JSON before using page tools; encrypted files return no page count until unlocked.

Instructions

Read-only check of a PDF: returns its path, file size in bytes and page count as JSON. Call it before page tools to learn how many pages there are. Nothing is written. An encrypted PDF returns no page count (with a note) until its password is known; a file that is not a PDF returns an error.

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": {
      "file": "<file>"
    },
    "name": "pdf_info"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the file (absolute, or relative to the working directory).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, yet the description adds genuinely new behavioral detail: an encrypted PDF yields no page count plus a note until unlocked, and a non-PDF returns an error. 'Nothing is written' mildly restates readOnlyHint, which keeps this from a 5, but the failure-mode disclosure is the kind of context annotations cannot carry.

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?

Four short sentences, front-loaded with the return contract and then the usage rule, with no filler. The one marginally redundant sentence is the 'Nothing is written' reassurance already implied by readOnlyHint.

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 no output schema, the description carries the return contract itself and does so fully: three named fields in JSON plus the degraded encrypted case and the error case. For a single-parameter read-only info tool, nothing an agent needs before calling 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?

Only one parameter and schema coverage is 100%, so the schema already explains that 'file' is an absolute or working-directory-relative path. The description adds nothing about the parameter beyond implying the target is a PDF; baseline 3 applies.

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 ('Read-only check of a PDF') and enumerates exactly what comes back: path, file size in bytes, page count as JSON. The phrase 'Call it before page tools' separates it from the page-manipulation siblings like extract_pdf_pages or split_pdf without opening any 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?

Gives an explicit trigger — call before page tools to learn the page count — which is a real, actionable when-to-use rule tied to sibling workflows. It stops short of stating when-not to use it, but the encrypted and non-PDF caveats effectively cover the cases where the call is unproductive.

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