Skip to main content
Glama

pdf_check_text

Check whether a PDF has a text layer, looks scanned, or needs OCR before extracting text. Returns a verdict and per-page evidence.

Instructions

Check whether a PDF has a text layer, looks scanned, or needs OCR.

Answers "can I read this, or is it a picture of a document?". Worth running before extracting text from a file you have not seen.

verdict is "text", "scanned", "mixed", or "no_text" — the last meaning nothing readable but nothing scan-like either, so blank, vector-only, or illustrated pages that OCR cannot help. needs_ocr follows from it, summary is a sentence worth quoting, and the per page evidence behind the verdict comes back alongside, including each page's image_coverage (the largest image's share of the page area).

Samples up to 10 pages spread across the document, so a true sampled means the answer is an estimate for the pages in between. It does not return the text (use pdf_extract_text) and it does not run OCR.

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.8/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 burden and does so well: it enumerates the verdict values and their meaning, explains that no_text implies OCR cannot help, describes the sampling behavior (up to 10 pages spread, so 'sampled' means an estimate for in-between pages), and the side-effect boundaries (no text returned, no OCR run). This is exactly the behavioral context an agent needs.

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?

Front-loads the core purpose and the verdict taxonomy before the caveats, and every sentence carries information. It runs a bit long across several paragraphs, but there is very little filler for the amount of behavioral detail conveyed.

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?

Output schema exists, yet the description still gives an adequate orientation to the return values (verdict, needs_ocr, summary, per-page image_coverage). Combined with the sampling caveat and the explicit non-behaviors, an agent has everything needed to call and interpret this tool.

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

Parameters4/5

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

Schema coverage is 0% and the only param is documented solely as an untyped string, but the description compensates by defining ref as 'PDF file path, or a workspace artifact id' — a meaningful disambiguation the schema lacks. It does not elaborate on path/artifact-id precedence, so not a 5.

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?

States a specific verb and resource (check a PDF for a text layer / scanned / OCR need) and immediately frames the user-level question it answers ('can I read this, or is it a picture of a document?'). It also distinguishes itself from text extraction and OCR, so an agent can place it relative to alternatives without opening a 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?

Explicitly says when to run it ('before extracting text from a file you have not seen') and names what it is not for, routing text extraction to pdf_extract_text and noting it does not run OCR. The conditional trigger plus the two exclusions give clear when/when-not guidance.

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