Skip to main content
Glama

locate

Read-onlyIdempotent

Find visible text in an image via OCR and return its [x1,y1,x2,y2] rectangle for screenshots or desktop captures without DOM or accessibility data.

Instructions

Find visible text on an image by OCR and return its rect, for images where you have no DOM or accessibility data (desktop captures, the user's screenshots). Rects are [x1,y1,x2,y2] in image px (spec scale 1), best match first; several equally good matches = ambiguous: ask the user, or pass nth (0-based, reading order) or within [x1,y1,x2,y2]. all=true also lists weaker matches. Runs on this machine (macOS Vision, Windows OCR or Tesseract); reads the image, writes nothing. If the text is not found, use grid + zoom. Returns matches with score and a preview outlining them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoAlso list weaker matches, not only the best ones.
nthNoPick one of several equal matches, 0-based in reading order.
langNoOCR language code, e.g. "en", "ro", "de". Omit for the default.
textYesVisible text to find: a word or short phrase as it appears on the image.
exactNoRequire the exact text (case and spacing), not a close match.
withinNoSearch only inside [x1, y1, x2, y2], image px.
backendNoOCR engine: "vision" (macOS), "winrt" (Windows), "tesseract", or omit for auto.
image_pathYesPath of a PNG, JPEG or WebP image on this machine (~ allowed).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.1.1
    • addedInput schema / properties / all / description
      Added value: +"Also list weaker matches, not only the best ones."
    • addedInput schema / properties / backend / description
      Added value: +"OCR engine: \"vision\" (macOS), \"winrt\" (Windows), \"tesseract\", or omit for auto."
    • addedInput schema / properties / exact / description
      Added value: +"Require the exact text (case and spacing), not a close match."
    • addedInput schema / properties / image_path / description
      Added value: +"Path of a PNG, JPEG or WebP image on this machine (~ allowed)."
    • addedInput schema / properties / lang / description
      Added value: +"OCR language code, e.g. \"en\", \"ro\", \"de\". Omit for the default."
    • addedInput schema / properties / nth / description
      Added value: +"Pick one of several equal matches, 0-based in reading order."
    • addedInput schema / properties / text / description
      Added value: +"Visible text to find: a word or short phrase as it appears on the image."
    • addedInput schema / properties / within / description
      Added value: +"Search only inside [x1, y1, x2, y2], image px."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real context beyond them: it runs locally on this machine (macOS Vision, Windows OCR, Tesseract), touches only the image, and defines result ordering (best match first) and ambiguity behavior. It does not discuss latency or engine-specific caveats, so not a full 5.

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?

A single front-loaded paragraph that leads with the purpose and then packs scope, coordinate format, ambiguity handling, backends, and failure fallback. Dense but each clause carries information; slightly overstuffed for one sentence-chunk.

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?

With 8 parameters and no output schema, the description still tells the agent the result shape (matches with score and a preview outlining them) and the failure path. Missing only minor operational detail such as whether multiple matches come back by default when all=false.

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, but the description adds meaning the schema lacks: rects are [x1,y1,x2,y2] in image px at spec scale 1, nth is 0-based in reading order, and all=true surfaces weaker matches. This meaningfully enriches interpretation of nth/within/all beyond their short schema blurbs.

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?

States a specific verb+resource ('Find visible text on an image by OCR and return its rect') and immediately scopes it to the cases where it applies (no DOM or accessibility data). It is clearly separable from siblings like grid, zoom, or capture_* tools, which are named as fallbacks.

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?

Names when to use it (desktop captures, user screenshots), the alternative path when it fails ('If the text is not found, use grid + zoom'), and the ambiguity policy (ask the user, or pass nth/within). Both the selection condition and the failure fallback are explicit.

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