Skip to main content
Glama

图片文字识别

ocr_image

识别单张图片(png/jpg/webp,≤ 8MB)中的文字,返回 fullText 与分块(含置信度 conf/坐标 bbox)。计费工具(占 1 次当日 OCR 额度,失败不扣)。imageUrl 必须是公网可访问 URL;本地文件路径无法使用。mode=full 只出全文(blocks 为空),structured 只出带 conf/bbox 的分块(fullText 为空),auto 两者都出。结果取值:读 content[0](纯 JSON)或 structuredContent,不要把多个 content 块拼接。

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": {
      "imageUrl": "<imageUrl>"
    },
    "name": "ocr_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo默认 auto(两者都出);full 只全文;structured 只分块
imageUrlYes图片公网 URL,≤ 8MB

Output Schema

NameRequiredDescriptionDefault
modeNo
quotaNo
blocksNo分块结果;mode=full 时为空数组。每块含 text/conf/bbox
engineNo
fullTextNo整图拼接全文;mode=structured 时为空串
requestIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, openWorldHint=true, idempotent=false and destructive=false; the description adds material behavior the agent could not otherwise infer — this call consumes one daily OCR quota, failed calls are not charged, and it performs an open-world fetch of the supplied URL. It further specifies the mode contract (blocks empty under full, fullText empty under structured) and how to extract the result (content[0] or structuredContent, not concatenating content 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 text is front-loaded with purpose and return shape, then cost, then constraints, then output-reading instructions — no filler sentences. The only cost is partial duplication with the schema's own mode and imageUrl descriptions, plus a dense final instruction that packs two ideas into one sentence.

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?

Although an output schema exists and return fields need not be re-explained, the description adds the one thing the schema cannot convey: how the response is packaged (content[0] vs structuredContent) and that blocks must not be concatenated. Cost, quota impact, input reachability, and mode branching are all covered for a two-parameter tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns above that by spelling out the downstream consequences of each mode value (which fields become empty) rather than just restating the enum labels. It also reinforces the public-URL-only restriction, which the schema states more tersely.

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 opens with a precise verb+resource ('识别单张图片…中的文字') and immediately bounds the scope with supported formats (png/jpg/webp) and a size limit (≤ 8MB). It also names the return artifacts (fullText, blocks with conf/bbox), so an agent knows exactly which capability this is versus the audio-oriented siblings in the catalog.

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?

Usage context is clear (OCR on one image, not a batch or audio job) and it states a hard negative constraint: imageUrl must be publicly reachable, local file paths will not work. It does not, however, name an alternative tool or describe what to do when the image is local or exceeds 8MB, so it falls short of full when/when-not routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources