Skip to main content
Glama

pdf_page_layout

Measure PDF page sizes, orientation, and rotation to identify mismatched or sideways pages. Returns grouped page shapes with page ranges for quick analysis of long documents.

Instructions

Measure a PDF's page sizes, orientation and rotation.

Answers "what size is this, is it all the same, and why does one page come out sideways?". Reads page geometry only, so it stays cheap on long documents.

sizes groups the pages by shape, most pages first, each carrying the page numbers it covers as a range like "1-16,18", so a 300 page document answers in one entry instead of 300 rows. Sizes are the page as a reader sees it: CropBox clipped to MediaBox with /Rotate applied, so a landscape box rotated 90 degrees reports as portrait. Pages within 3pt of a known paper are grouped and named together, since real A4 varies by a millimetre.

Pass pages for per page rows carrying the raw boxes: "1-20", "3", "1,5,9-12" or "all", capped at 100 rows.

It does not look at page content; for whether the pages hold readable text use pdf_check_text.

Args: ref: PDF file path, or a workspace artifact id. pages: Optional page range for per page detail. Omit for groups only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes
pagesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden, and it does so thoroughly. It explains that only page geometry is read, that pages are grouped by shape with page-range notation, that sizes are computed by clipping CropBox to MediaBox and applying /Rotate, and that a 3pt tolerance is used for grouping. It also discloses that per-page output is capped at 100 rows.

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 front-loaded with the core purpose and then delivers dense, useful details about behavior, grouping, parameter formats, and alternatives. Each sentence contributes necessary information, and the final Args block cleanly summarizes the two parameters without redundancy.

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?

The description covers what the tool returns conceptually, how it handles real-world page size variance, how rotation affects reported sizes, how to request per-page details, and what to use instead for text content. Since an output schema is present, the absence of exhaustive return-field documentation is not a gap.

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?

Schema description coverage is 0%, so the description must compensate, and it does. It explains that 'ref' accepts either a PDF file path or a workspace artifact id, and it defines 'pages' with concrete range formats like '1-20', '3', '1,5,9-12', or 'all', plus the 100-row cap.

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 opens with a specific verb and resource: 'Measure a PDF's page sizes, orientation and rotation.' It also frames the tool around concrete questions, which makes its purpose unmistakable. It further distinguishes itself from text-related siblings by explicitly stating it does not look at page content and points to pdf_check_text for that.

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 description clearly states when to use this tool: for page geometry and understanding inconsistent sizes or rotation, while noting it stays cheap on long documents. It also gives a direct alternative, pdf_check_text, for readable-text questions, which is an explicit when-not-to-use condition.

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