Skip to main content
Glama

图片文字提取

extract_text

Extract all text from images with OCR while preserving the original layout, including code, formulas, and multiple languages, from local files, URLs, or base64 sources.

Instructions

OCR:提取图片中的全部文字,按原始排版输出(支持代码、公式、多语言)。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>"
    },
    "name": "extract_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNo临时指定模型 id(默认 gpt-5-6;可用 VISION_MODEL 环境变量改全局默认)
sourceYes图片来源:本地文件路径、http(s) 图片 URL、data:image/...;base64,... 数据 URL,或裸 base64

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden, and it does add genuine behavioral value: output preserves original layout and handles code, formulas, and multiple languages. However, it says nothing about failure modes, limits on image size or format, whether it processes one or many images, or the shape of the result beyond 'layout-preserved text'.

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?

A single compact sentence with a parenthetical listing supported content types, front-loaded with the OCR keyword. Every clause earns its place and there is no redundant restatement of the tool name.

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?

For a simple two-parameter, fully documented, annotation-free extraction tool with no output schema, the description covers purpose plus the salient output characteristic (layout preservation, multilingual support). What it lacks is any note on constraints or expected return shape, which keeps it from a 5.

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 description coverage is 100%, so both the source formats (local path, URL, data URL, raw base64) and the model override are already fully documented in the schema. The description adds no further meaning about these parameters, so the baseline 3 applies.

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 pairs a specific verb (OCR/提取) with a concrete resource (图片中的全部文字), so an agent immediately understands this is a text-extraction tool rather than a general image analyzer. It does not name the siblings analyze_image or compare_images explicitly, so the differentiation is implicit from the narrow scope rather than stated.

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: the agent can infer it should call this when it needs the text content of an image. There is no explicit when-to-use, when-not-to-use, or routing advice relative to analyze_image and compare_images, which are the obvious alternatives.

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

Deploy Server

Other Tools