Skip to main content
Glama

pdf_page_count

Count the pages in a PDF to find out how many pages it contains. Reads only the page tree, so the count stays light on large files.

Instructions

Count the pages in a PDF. Answers "how many pages is this?".

Reads only the document's page tree, so it stays cheap on large files. It does not read page text, page sizes, or document properties.

Args: ref: PDF file path, or a workspace artifact id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that it reads only the page tree, stays cheap on large files, and lists what it does not read. It does not mention error conditions or explicitly state read-only behavior, but the phrasing implies no side effects. This is adequate for a simple count operation.

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?

The description is concise, with a clear first sentence stating the purpose, followed by a brief explanation of scope and the parameter. No redundant or filler content.

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?

For a simple tool with one parameter and an output schema, the description covers the core behavior and scope. It could mention potential errors (e.g., invalid file path) or the exact return format, but the output schema likely handles return details. Overall, it is sufficiently complete for an agent to call it correctly.

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

Parameters5/5

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

The schema provides only the parameter name 'ref' with no description, and schema coverage is 0%. The description compensates fully by explaining that 'ref' is a PDF file path or a workspace artifact ID, adding essential meaning beyond the schema.

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 clearly states the tool counts pages in a PDF and explicitly distinguishes it from siblings by noting it reads only the page tree, not text, sizes, or properties. This makes the purpose unambiguous and separates it from pdf_metadata, pdf_extract_text, and pdf_page_layout.

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 description gives clear context on what the tool does and does not do ('does not read page text, page sizes, or document properties'), which implies when not to use it. However, it does not name specific alternative tools like pdf_metadata or pdf_extract_text, so the guidance is implicit rather than explicit.

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