Skip to main content
Glama
pdf4me
by pdf4me

extract_text_from_image

Extract text from local image files using OCR. Converts image-based content into structured JSON and a text summary for downstream processing.

Instructions

Extract text from a local image using the PDF4me ImageExtractText API (POST /api/v2/ImageExtractText). Uses OCR; supports async processing with polling on 202. Returns the parsed JSON response in structured_content and a text summary when possible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesLocal path to the image file (e.g. JPG, PNG, TIFF, WEBP).
Behavior4/5

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

With no annotations, the description carries the transparency burden. It discloses OCR usage, async processing with polling on 202, and the return format (structured_content and text summary). This is useful behavioral context, though it doesn't cover error handling or limitations.

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 one sentence but packed with essential details: API endpoint, OCR, async processing, and return structure. It is efficient and front-loaded with the primary purpose.

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

Completeness4/5

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

Given a single parameter, no annotations, and no output schema, the description adequately explains the tool's behavior (async/polling) and return content. It could mention file format constraints but those are in the schema, so completeness is 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 single parameter file_path is fully described in the schema (100% coverage). The description adds only 'local' but not additional detail beyond the schema, so it meets the baseline without adding significant new meaning.

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 extracts text from a local image using OCR via the PDF4me API. It distinguishes from siblings like extract_text_from_word and read_barcodes_from_image by specifying the image input and OCR capability.

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

Usage Guidelines4/5

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

It specifies 'local image' and OCR, implying appropriate use for extracting text from image files. However, it doesn't explicitly state when not to use it or mention alternatives among the many sibling tools, missing an opportunity for clearer differentiation.

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/pdf4me/pdf4me-mcp'

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