Skip to main content
Glama

Old manuals, patents and data sheets are often scans: pictures of pages with no text in them. OCR Lab reads them. A page with a text layer is read from it. A page without one is rendered and read by Tesseract. Every line and word comes back with its box on the page, in PDF points from the top left, and with Tesseract's confidence from 0 to 100. A number can then be found next to its label and checked on the page picture.

OCR misreads. It read "lb" as "1b" and "folded" as "felded" on a 1970s army scan. Check every number you keep on the page itself.

Install

  1. Install Tesseract 5: on Windows the UB Mannheim build, on macOS brew install tesseract, on Linux apt install tesseract-ocr. OCR Lab finds it on the PATH, in the usual install folders, or at OCRLAB_TESSERACT.

  2. pip install ocrlab-mcp

  3. Add it to your MCP client: claude mcp add ocrlab -- ocrlab-mcp

OCR Lab writes only to OCRLAB_OUT (default ~/.ocrlab): its cache of read pages.

Related MCP server: MCP PDF Reader Server

Tools

Tool

What it does

pdf_info

The page count, which pages have a text layer and which need OCR, and where Tesseract is.

read_page

One page's text and lines, with boxes and confidence; words adds every word.

read_pages

Several pages read and cached, with each page's source and mean confidence.

find

Every line matching a regular expression, with its page, box and the lines round it.

words_in

The words inside a box on a page: one column of a table read on its own.

read_image

An image file read by Tesseract.

Command line

ocrlab info manual.pdf
ocrlab page manual.pdf 5
ocrlab find manual.pdf "overall length|weight" 1-12

Licence

MIT. Tesseract is Apache 2.0 and installed on its own.

Available Tools

6 tools
findC

Every line matching the pattern, with its page, box, confidence and the lines round it.

ParametersJSON Schema
NameRequiredDescriptionDefault
dpiNo
pathYes
limitNo
pagesNo
regexNo
contextNo
patternYesa regular expression, case ignored
force_ocrNo

TDQS

C2.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the shape of results (matching lines plus page, box coordinates, OCR confidence, and surrounding context lines), which is genuinely useful for a tool with no output schema. It omits operational behavior however: whether the call is read-only, how `limit` paginates results, that `regex` defaults to a case-insensitive regex vs literal match, and when OCR is triggered or forced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single waste-free sentence with the result content front-loaded. But for an 8-parameter search tool the brevity tips into under-specification rather than economy — the sentence is short because it omits necessary information, not because it is well-packed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters, 13% schema coverage, no annotations, and no output schema, the description should shoulder much more. It partially compensates by describing the return fields, but leaves the search semantics (regex vs literal, page selection syntax, OCR forcing, result limiting) unexplained, so it is not complete enough for reliable invocation.

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

Parameters2/5

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

Schema description coverage is only 13% — just the `pattern` parameter (a case-ignored regular expression) — across 8 parameters. The phrase 'the lines round it' loosely maps to the `context` parameter and 'confidence' hints at OCR behavior, but `dpi`, `limit`, `pages`, `regex`, and `force_ocr` are undocumented in both schema and description, leaving the agent to guess at values and trade-offs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description conveys that this is a pattern-matching search that returns matching lines with page, box, confidence and surrounding lines, which is more than a restatement of the name. However, it never names the resource being searched (a PDF at `path`) and gives no differentiation from the sibling `words_in`, which plausibly also searches text in the same document. An agent can guess the purpose but must infer the target object and its relationship to siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance at all: nothing says when to pick `find` over `words_in`, `read_page`, or `read_pages`, and no prerequisites (e.g., that the file must be OCR-able or that `force_ocr` may be needed) are stated. The only hint is implicit in the returned fields.

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

pdf_infoB

A PDF's page count, which pages have a text layer and which need OCR, and where Tesseract is.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

B3/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It usefully reveals that Tesseract availability is probed and that OCR need is reported, but says nothing about whether the PDF is parsed in full (cost), what happens if Tesseract is absent, or error behavior on a non-PDF path. Read-only-ness is only implicit in the nature of the tool.

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?

A single sentence with no padding, front-loaded with the primary output (page count) before the secondary details. The grammar is a fragment rather than a sentence, which costs it the top score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must convey return values, and it does enumerate them. However, for a tool whose whole value is pre-flight inspection, it omits the workflow context (when to use it, what to do with the OCR flags) and any error/edge-case behavior, leaving the definition only marginally complete.

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

Parameters2/5

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

Schema description coverage is 0% and the single required parameter 'path' has only the title 'Path'. The description never mentions the parameter; only the phrase 'A PDF's' weakly implies it is a PDF file path. It does not compensate for the coverage gap by specifying path form (local file, absolute vs relative).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource (a PDF) and enumerates exactly what it reports: page count, pages with a text layer, pages needing OCR, and the Tesseract location. That is enough to distinguish it from read_page/read_pages/words_in, which return content rather than an inventory. It lacks an explicit verb, but the informational purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to call this versus the sibling readers, and no prerequisites (e.g. 'call before read_pages to decide which pages need OCR'). The enumerated outputs only weakly imply a planning use, leaving the agent to infer the workflow.

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

read_imageC

An image file read by Tesseract: its lines (boxes in pixels) and their confidence.

ParametersJSON Schema
NameRequiredDescriptionDefault
psmNo
langNoeng
pathYes

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses that output includes line boxes in pixels and confidence, which is useful, but says nothing about dependencies (Tesseract engine requirement), error behavior on unreadable images, or whether it is a pure read operation. Significant gaps remain for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single compact sentence with no padding, which is good, but it is front-loaded with an awkward construction rather than a clear imperative statement of what the tool does, reducing scannability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description needs to explain returns and behavior. It partially covers returns (lines, pixel boxes, confidence) but leaves all parameters and operational context unexplained, which is inadequate for a 3-parameter OCR tool.

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

Parameters2/5

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

Three parameters with 0% schema description coverage, and the description never mentions them. 'path' is self-evident, but 'psm' (page segmentation mode) and 'lang' are entirely undocumented in both schema and description, so an agent cannot know their meaning or valid values. The Tesseract reference only faintly hints at their relevance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description does state a verb and resource (reading an image file via Tesseract) and even hints at the return shape (lines, boxes in pixels, confidence). However, the phrasing is awkward and quasi-tautological ('An image file read by Tesseract'), and it makes no attempt to distinguish itself from siblings like read_page or words_in, which likely also perform OCR-like extraction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use read_image versus read_page, read_pages, words_in, or find. An agent must infer from the name alone that this is for standalone image files rather than PDF pages. No preconditions or exclusions are given.

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

read_pageB

One page's text and lines (boxes in PDF points, OCR confidence); with words, every word too.

ParametersJSON Schema
NameRequiredDescriptionDefault
dpiNorender resolution for OCR
psmNoTesseract layout: 3 a page, 4 a column, 6 a block, 11 sparse
langNoeng
pageYesfrom 1
pathYes
wordsNo
force_ocrNo

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose non-obvious return details (boxes in PDF points, OCR confidence). However, it says nothing about when OCR is triggered, what force_ocr changes, or failure behavior for out-of-range pages.

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?

A single sentence with no filler, and the page scope is front-loaded. The stacked parenthetical ('boxes in PDF points, OCR confidence') is dense and slightly cryptic but does not waste words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter read tool with no annotations and no output schema, the description does cover the returned content (text, lines, optional words), but omits OCR-trigger conditions, error behavior, and the meaning of several parameters, so it is only minimally 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?

Schema coverage is only 43%, so the description must compensate; it usefully expands the bare 'words' boolean into 'returns every word too'. But lang, path, and force_ocr remain undocumented in both schema and description, leaving four of seven parameters without semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The fragment names the exact resource and scope ('One page's text and lines'), and the parenthetical clarifies what those lines carry (PDF-point boxes, OCR confidence). An agent can distinguish it from read_pages by scope, though it never explicitly names that sibling as the alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance; the agent must infer from the singular name that read_pages covers multiple pages. No preconditions (valid page range, OCR vs embedded text) are given.

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

read_pagesC

Several pages read and cached; each page's source, line count and mean confidence (read_page gives the text).

ParametersJSON Schema
NameRequiredDescriptionDefault
dpiNo
langNoeng
pathYes
pagesYes'3', '1-5', '1,4,9-12' or 'all'
force_ocrNo

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the key trait that results are cached and that output is metadata (source, line count, mean confidence) rather than text, which is genuinely useful. But it says nothing about whether OCR is invoked, permission/auth needs, or what happens on a missing/invalid page range, so large gaps remain for a 5-param read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single short sentence with no filler, and the differentiating fact is front-loaded. However, the sentence is grammatically clipped ('Several pages read and cached'), which slightly impairs parsing rather than maximizing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no annotations, and no output schema, the agent still lacks guidance on dpi/lang/force_ocr behavior and on what 'cached' implies for the return payload format. The one sentence covers purpose and one differentiating detail but leaves the call-shaping decisions unresolved.

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

Parameters2/5

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

Schema coverage is only 20% – just the pages range syntax ('3', '1-5', 'all') is documented. dpi, lang, force_ocr and path have no schema descriptions, and the tool description adds no meaning for them (e.g., that force_ocr bypasses embedded text, or that lang affects OCR). With low coverage, the description is expected to compensate and does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The verb+resource (read pages, plural/cached) is identifiable and the parenthetical explicitly distinguishes it from the sibling read_page by saying which one returns text. The phrasing 'Several pages read and cached' is a fragment, but the intent is recoverable. No confusion with pdf_info, find, or words_in.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The contrast with read_page implies 'use this when you need multiple pages worth of metadata rather than text', but the selection rule is only implied. No explicit when-not conditions, no mention of cost/perf tradeoff versus looping read_page, and no prerequisites.

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

words_inC

The words inside a box on a page, in reading order: one column of a table read on its own.

ParametersJSON Schema
NameRequiredDescriptionDefault
boxYes[x0, y0, x1, y1] in PDF points from the top left
dpiNo
pageYes
pathYes
force_ocrNo

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden. It does contribute one behavioral trait ('in reading order'), but says nothing about whether words carry coordinates, what happens for an empty/invalid box, whether OCR is triggered, or what the response shape is. For a 5-parameter extraction tool with zero annotation coverage this is a substantial gap.

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?

A single tight sentence with no filler, and the scope-defining element ('inside a box') is front-loaded. It is a sentence fragment that reads slightly cryptically ('words_in' as 'The words inside...'), which keeps it from a 5, but nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 5 parameters, no annotations, no output schema, and 20% schema description coverage, the description is too thin to fully specify the tool. It establishes scope but omits return format, coordinate semantics, and the role of dpi/force_ocr, leaving real gaps an agent must guess at.

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

Parameters2/5

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

Schema description coverage is only 20% — just the box array is documented as '[x0, y0, x1, y1] in PDF points from the top left'; path, page, dpi, and force_ocr have no schema descriptions. The description mentions 'box' and 'page' only indirectly and never explains dpi or force_ocr, so it fails to compensate for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource and scope: 'the words inside a box on a page, in reading order.' That is a clear, verifiable action (extract words from a region) and implicitly separates it from siblings that read whole pages or search. It does not name any sibling or explain how it differs from read_page/find, so it stays below a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied through the phrase 'one column of a table read on its own,' which signals the region/column-extraction use case. There is no explicit when-to-use guidance versus read_page, read_pages, or find, and no stated prerequisites. Adequate but leaves the routing decision to inference.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedfind
    • First observedpdf_info
    • First observedread_image
    • First observedread_page
    • First observedread_pages
    • First observedwords_in

TDQS

B3/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a fairly distinct role: pdf_info for metadata, read_page/read_pages for extraction, find for pattern search, words_in for box-scoped word retrieval, read_image for images. The only real overlap is read_page vs read_pages, but the descriptions explicitly clarify that read_pages returns metadata while read_page gives the actual text.

Naming Consistency3/5

There is a partial read_* convention (read_page, read_pages, read_image) but the remaining tools (pdf_info, find, words_in) break it, mixing noun-phrases and bare verbs. Names are readable and descriptive, but no single predictable pattern holds across the set.

Tool Count5/5

Six tools is a well-scoped set for a PDF/image OCR library, with no redundant or filler entries. Each tool maps to a clear capability without bloat.

Completeness4/5

Coverage spans metadata, single/multi-page reading, image OCR, pattern search, and box-level word extraction, which handles most OCR workflows. Minor gaps exist, such as no explicit export/save output or a tool to force/refresh OCR on a text-less page.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers