Skip to main content
Glama

ocr_image

Extract text from local images and PDFs with Apple Vision OCR, returning plain text or structured blocks with bounding boxes. Works offline on macOS.

Instructions

Extract text from a local image or PDF file using Apple Vision OCR (offline, no API key needed).

USE WHEN: The user provides a local file path to an image, screenshot, scanned document, or PDF and wants to extract the text from it. DO NOT USE for: images hosted on URLs (download first), non-macOS systems, or when the user wants face/barcode detection (use the dedicated tools).

Supported formats: jpg, jpeg, png, heic, heif, tiff, bmp, pdf

Parameters: path — absolute or relative path to the image/PDF file format — "text" returns a single plain-text string (default) "blocks" returns JSON { pages: [{ page, paragraphs, textBlocks }] } with reading-order paragraphs and per-block bounding boxes. Each textBlock carries lineId, paragraphId, confidence, and page-local bbox (0–1). PDFs return one entry per page. start_page — PDFs only — 1-based index of the first page to OCR (default 1). Ignored for images. start_page past the end returns an empty result. max_pages — PDFs only — maximum number of pages to OCR from start_page (default: all). Ignored for images.

Returns: extracted text as a string (format="text") or a JSON document with per-page paragraphs and text blocks (format="blocks").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the image or PDF file
formatNo"text" for plain string output, "blocks" for per-page paragraphs and text blockstext
start_pageNoPDFs only — 1-based first page to OCR. Ignored for images.
max_pagesNoPDFs only — maximum number of pages to OCR. Ignored for images.
Behavior5/5

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

Despite no annotations, the description fully discloses behavioral traits: offline operation, no API key required, supported file formats, the effect of each parameter (including PDF-only and edge cases like 'start_page past the end returns an empty result'), and the structure of the output for format='blocks'.

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?

The description is well-structured with clear sections (purpose, usage, supported formats, parameters, returns). It is front-loaded with the core purpose. While comprehensive, it is slightly long, but every sentence contributes value given the tool's complexity.

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?

Given the tool has 4 parameters, no output schema, and no annotations, the description is complete: it covers input, behavior, output examples, edge cases, and distinguishes from siblings. Nothing essential is missing.

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 100%, but the description significantly adds meaning beyond the schema: it describes the JSON structure for format='blocks' with field details (pages, paragraphs, textBlocks, bounding boxes, confidence) and explains PDF-specific behavior for start_page and max_pages, including an edge case.

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 begins with a specific verb and resource: 'Extract text from a local image or PDF file using Apple Vision OCR (offline, no API key needed).' It clearly distinguishes from sibling tools like detect_faces and detect_barcodes by stating what not to use for, and it lists supported formats.

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 provides explicit 'USE WHEN' and 'DO NOT USE for' sections, giving clear context for when this tool is appropriate and when alternatives (download first, other tools) should be used. It also references sibling tools like detect_faces and detect_barcodes.

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/woladi/macos-vision-mcp'

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