Skip to main content
Glama

detect_text_blocks

Read-onlyIdempotent

Find text-like blocks in an image revision and report if the text stays legible after preview downscale, with recommended crop bands for readable previews.

Instructions

Find the text-like blocks (headline, paragraphs, table, caption) of a revision with a binarize + run-length smearing + connected-components pass, and report whether the text will survive a preview downscale. Read-only: it never modifies the image. Blocks come back in reading order (top to bottom, then left to right) in post-EXIF-orientation pixel coordinates, each with its line_count, median_line_height_px and ink_ratio. legibility.line_height_at_1568_px is the median line height once the whole image is shrunk to long edge 1568 (below ~16 the text is usually unreadable), and legibility.recommended_bands splits the image into crops that clear that bar - each entry is already a crop operation, so paste one into a recipe before render_preview long_edge: 1568 and read them in order. legibility.strategy says how it split: "whole" (no split needed), "bands" (full-width horizontal bands) or "blocks" (per-block crops, used when the image is too wide for full-width bands to help). Optional max_blocks (1..=128, default 32) and min_block_area_ratio (0.0..=1.0, default 0.00005) bound how many and how small the blocks may be. No block found means the image has no text-like structure, not an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_blocksNo返すブロック数の上限(1..=128)。省略時は 32。
revision_idYes対象 revision ID("rev_...")。
min_block_area_ratioNo作業画像面積に対する 1 ブロックの最小面積比(0.0..=1.0)。 これ未満の成分はノイズとして捨てる。省略時は 0.00005。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
detectionYes検出結果。ブロックが無ければ `blocks` は空で `warnings` に理由が入る。
revision_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.4

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description reinforces this plus adds behavior annotations do not cover: output ordering (reading order, post-EXIF pixel coordinates), the ~16px legibility threshold, the three splitting strategies, and the important guarantee that 'no block found' is not an error. Missing only things like performance or image-size limits.

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?

Purpose and the read-only guarantee are front-loaded, and each dense sentence carries information. There is mild redundancy: the read-only statement repeats the annotation, and the enumeration of returned fields partially duplicates the available output schema.

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 read-only analysis tool with full annotations and an output schema, the description supplies the missing pieces an agent needs: orientation/coordinate conventions, legibility semantics, and how to chain the recommended_bands into render_preview. Spending text on individual return fields is somewhat redundant given the output schema, but nothing essential is absent.

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% and both optional params are already documented in the schema, so the baseline is 3; the description earns an extra point by stating the intent behind them ('bound how many and how small the blocks may be') rather than only restating ranges.

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 the text-like blocks ... of a revision') and even names the algorithm (binarize + run-length smearing + connected components), which cleanly separates it from sibling detectors like detect_document and detect_tilt. An agent can identify the tool's job from the first clause alone.

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?

The description gives concrete workflow context: use it to check whether text survives a preview downscale, then paste an entry from legibility.recommended_bands into a recipe before render_preview with long_edge: 1568. It does not, however, state when NOT to use it versus detect_document/detect_tilt, so it stops short of explicit alternatives.

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