Skip to main content
Glama

ocr_by_path

Extract text from local image files with configurable OCR options. Choose output formats like plain, JSON, or Markdown, and apply enhancements like auto-rotate or binarization.

Instructions

对本地图像文件执行 OCR 识别。

Args:
    image_path: 图像文件的绝对路径或相对路径
    output_format: 输出格式 (plain/json/markdown/structured)
    auto_enhance: 自动增强图像对比度和锐度
    rotate: 自动旋转图像(基于 EXIF)
    binarize: 二值化图像

Returns:
    OCR 识别结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rotateNo
binarizeNo
image_pathYes
auto_enhanceNo
output_formatNojson
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It explains the operation on local files and details the preprocessing options (auto_enhance, rotate, binarize), but it does not mention error behavior, access requirements, or the nature of the return value beyond 'OCR 识别结果'. This is adequate but not comprehensive.

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 well-structured with a concise one-line purpose followed by a bulleted Args list and a Returns line. Every sentence earns its place, and there is no redundancy or fluff.

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?

The description covers the essential elements: purpose, all parameters, and the return value. With no output schema and no annotations, it handles complexity reasonably well. It could be improved by mentioning supported image formats or error handling, but the core usage is adequately specified.

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 description coverage is 0%, but the description fully compensates by explaining each parameter: image_path (absolute/relative path), output_format (plain/json/markdown/structured), auto_enhance (enhance contrast/sharpness), rotate (based on EXIF), and binarize. This adds significant meaning beyond the bare schema titles and defaults.

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: '对本地图像文件执行 OCR 识别' (perform OCR on local image files). This specifies both the verb (perform OCR) and the resource (local image files), and the 'local' qualifier effectively distinguishes it from sibling tools like ocr_by_url and ocr_by_content.

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?

The description clearly indicates the tool is for local image files, giving context for when to use it. However, it does not explicitly mention alternatives or state when NOT to use it, so it falls short of a 5.

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/bitfarer/rapidocr-mcp'

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