Skip to main content
Glama
etreby
by etreby

screen_to_text

Convert screenshots to compact structured text with bounding boxes, reducing vision model token usage. Ideal for native desktop apps, remote desktops, and surfaces without an accessibility tree.

Instructions

Read a screenshot as compact structured text instead of sending an image.

A screenshot costs a vision model roughly 1,600 to 4,800 image tokens. This returns the same screen as a few hundred tokens of text in reading order, with a bounding box per line, so you can see what is on screen and where to click without spending them. Omit image_path to capture the current monitor.

detail is "lines" (default: text plus one box per line), "text" (cheapest, reading order only), or "words" (a box per word — on a dense screen this can cost MORE tokens than the screenshot did, and the reply says so when it has).

Read these limits before relying on it. The text comes from Tesseract OCR, so it is a best-effort transcription and not a user-interface tree: it cannot report widget types, enabled or checked state, focus, scroll position, or anything off-screen, and it misreads small or low-contrast text. If the target is a web page, use Playwright's accessibility tree instead — that is already structured text, it is exact, it includes content scrolled out of view, and it costs no model tokens to produce. This tool is for surfaces with no such tree: native desktop applications, remote desktops, canvas and WebGL, video frames, and scanned documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailNolines
image_pathNo
min_confidenceNo
Behavior5/5

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

With no annotations provided, the description carries full responsibility and delivers thoroughly. It discloses that output is from Tesseract OCR (best-effort, not a UI tree), lists specific limitations (cannot report widget types, enabled/checked state, focus, scroll position, off-screen content, misreads small/low-contrast text), and warns that the 'words' detail can cost more tokens than a screenshot. This goes well beyond the minimum.

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 appropriately sized given the tool's complexity. It front-loads the core purpose in the first sentence, then efficiently covers cost motivation, parameter details, limitations, and alternatives in a well-structured flow. Every paragraph earns its place, and there is no fluff or redundancy.

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 no annotations or output schema, the description covers purpose, usage, limitations, return format (reading order text with bounding boxes), and parameter semantics for most parameters. The only gap is min_confidence, which is left unspecified. Despite this, the description is largely complete for an agent to use the tool safely and effectively.

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?

The schema has no descriptions (coverage 0%), so the description must compensate. It does for two of three parameters: detail (explains 'lines', 'text', 'words' with trade-offs) and image_path (explains omission captures the monitor). However, min_confidence is never mentioned, so the agent is left guessing what it controls. This slight omission prevents a perfect score.

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 clear, specific action: 'Read a screenshot as compact structured text instead of sending an image.' It specifies the resource (screenshot/image) and the output (structured text with bounding boxes). It also distinguishes itself from sibling tools like ocr_image and ocr_current_monitor by framing it as a token-saving alternative and contrasting with Playwright's accessibility tree.

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?

Explicitly states when to use this tool: for surfaces without an accessibility tree (native desktop apps, remote desktops, canvas/WebGL, video frames, scanned documents). It gives a clear alternative: 'If the target is a web page, use Playwright's accessibility tree instead' and explains why. It also provides operational guidance on omitting image_path to capture the current monitor and how to choose the detail level.

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/etreby/intel-npu-tools'

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