Skip to main content
Glama

Classify a PDF

pdf_classify

Classify a local PDF as text-based, scanned, image-based, or mixed, returning confidence and exact pages needing OCR, without extracting text.

Instructions

Triage a local PDF without extracting its text (typically 10-50ms). Returns whether the document is text-based, scanned, image-based or mixed, a confidence score, and the exact 1-indexed pages that need OCR. ALWAYS call this before pdf_extract on an unfamiliar or large document: it is cheap, and it tells you whether local extraction is worth attempting at all. If it reports scanned, image_based, or encoding issues, do not extract — route the document to an OCR service instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path, or path relative to an allowed root, of a .pdf file
Behavior4/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 well by stating it does not extract text, returns specific categories and a confidence score, and is fast (10-50ms). It conveys that the tool performs triage without side effects, though it does not explicitly state 'read-only' or discuss error behavior. The decision guidance about OCR routing adds context beyond basic 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 yet comprehensive, front-loading the primary purpose, then specifying return values, and finally providing actionable usage guidance. Every sentence adds value, and the entire description fits in three sentences without redundancy. It is well-structured with an imperative usage directive that is easy to follow.

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?

Since there is no output schema, the description fully explains return values: document type, confidence score, and exact 1-indexed pages needing OCR. It also covers when to use the tool, what the outcome implies, and next steps. For a simple single-parameter tool with rich behavioral guidance, the description is complete and self-sufficient.

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?

The schema provides 100% coverage with a detailed description of the 'path' parameter ('Absolute path, or path relative to an allowed root, of a .pdf file'). The tool description adds no additional parameter semantics, so a baseline score of 3 is appropriate. There is no further information about path handling beyond what the schema already states.

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's function: 'Triage a local PDF without extracting its text' with specific outputs (classification, confidence, pages needing OCR). It distinguishes itself from siblings by emphasizing it does not extract text, unlike pdf_extract, and by specifying its classification purpose. The verb 'triage' precisely conveys the lightweight, pre-extraction role.

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?

Explicit usage guidance is provided: 'ALWAYS call this before pdf_extract on an unfamiliar or large document' and conditional routing: 'If it reports scanned, image_based, or encoding issues, do not extract — route the document to an OCR service instead.' This clearly indicates when to use the tool and when to avoid extraction, including alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vishalmeena2211/pdf-triage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server