Skip to main content
Glama

img2text

Convert an image from a local path, URL, data URL, or base64 into a plain-text description. This lets text-only language models understand visual content when they cannot view the image directly.

Instructions

读取图片并把内容转换为文字描述。接受本地文件路径、http(s) URL、data URL 或 base64。由外部视觉模型(VISION_PROVIDERS 配置的一组 OpenAI 兼容模型,自动 fallback)完成识别,返回纯文本,供本身不支持图片输入的模型理解图片。使用时机:① 你能直接查看图片时(原生多模态输入),无需调用本工具;② 用户提供图片路径/URL/图片附件引用(形如 "[图片附件:名称] 图片文件:<绝对路径>")且你无法直接看到图片内容时,立即调用本工具读取并转述内容,不要回复"无法查看图片";③ 用户要求分析/读取某张图片时。prompt 参数:用户有具体问题时传用户的问题;没有问题时不要传(server 使用默认提示词)。转述时保持简洁:先一句话概括图片是什么,再列关键信息(主要文字、重点元素),不要输出大段分析。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes图片来源:本地绝对路径 / http(s) URL / data URL / base64 字符串;图片附件引用中的 "图片文件:" 后即为绝对路径
promptNo可选分析指令。用户有具体问题时传用户的问题;没有问题时不要传此参数(server 使用默认提示词)
max_tokensNo可选,覆盖视觉模型最大输出 token 数

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden and substantially meets it: it reveals the external vision-model dependency (VISION_PROVIDERS OpenAI-compatible models with automatic fallback), the plain-text return type, and its purpose for non-multimodal models. It also prescribes output style behavior (one-sentence summary, then key details, no lengthy analysis). It does not cover error behavior or latency, but the fallback mechanism and non-mutating nature are clearly conveyed.

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?

Dense but well-structured: purpose, input formats, mechanism, numbered usage conditions (①②③), prompt guidance, and output-style instructions each get focused coverage with no fluff. The numbered lists make the routing logic easily scannable. Minor redundancy with schema text (image formats and max_tokens restated) keeps it just short of a 5.

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?

For a 3-parameter tool with no annotations, no siblings, and no output schema, the description covers everything needed to invoke it correctly: accepted input formats, when to call, what the prompt parameter should contain, and how to relay the result. The only omitted aspect is explicit error handling, which the automatic-fallback note partially addresses.

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 description coverage is 100%, so the baseline is 3; the description adds genuine value for 'prompt' by specifying exactly when to pass the user question versus omitting it to use the server default. The 'image' parameter gains an operational hint that '图片文件:' in attachment references marks the absolute path. 'max_tokens' adds nothing beyond the schema, but overall the description exceeds the baseline.

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 specific verb-object pair ('读取图片并把内容转换为文字描述' — read an image and convert to text description), enumerates accepted input formats (local path, http(s) URL, data URL, base64), and clarifies the tool exists for models that lack native image input. It also differentiates from native multimodal viewing ('你能直接查看图片时...无需调用本工具'), so an agent can distinguish this path from alternatives.

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?

Three numbered conditions give explicit when-to-call guidance: call immediately when a user supplies an image path/URL/attachment reference the model cannot see (explicitly instructing not to reply '无法查看图片'), skip the tool when the model can already view the image, and call when the user asks for image analysis. The prompt parameter also receives explicit passing rules ('用户有具体问题时传用户的问题;没有问题时不要传'). This is exemplary usage routing with exclusions and 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