Skip to main content
Glama

pdf_check_text

Check if a PDF has a readable text layer or is a scanned image. Returns a verdict and per-page evidence so you know whether OCR is needed before extracting text.

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

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it does so exceptionally. It discloses the sampling behavior (up to 10 pages), what a 'sampled' verdict means, the meaning of each verdict value, and that it returns per-page evidence such as image_coverage.

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 purpose consuming no fluff. Every sentence adds meaningful detail — verdicts, sampling, output evidence, and exclusions — while staying compact and scannable.

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 the decision this tool answers, the important caveat about sampling, the shape of the result, and the clear boundary against text extraction and OCR. An agent has everything it needs to select and invoke this tool correctly, and the output schema covers the remaining return details.

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 coverage is 0%, but the description fully compensates by defining `ref` as 'PDF file path, or a workspace artifact id.' For a single-parameter tool, this is sufficient and adds exactly the semantic meaning the schema lacks.

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: 'Check whether a PDF has a text layer, looks scanned, or needs OCR.' It clearly distinguishes itself from siblings like pdf_extract_text and pdf_ocr by stating what it does not do.

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?

It explicitly says when to run the tool: 'Worth running before extracting text from a file you have not seen.' It also names the alternative for text extraction (pdf_extract_text) and states that it does not run OCR, giving clear routing guidance.

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