Skip to main content
Glama
books-as-data
by kintopp

sgbr_inspect_image

sgbr_inspect_image
Read-onlyIdempotent

Fetch a scanned book page image for visual inspection; crop specific regions to examine maps, plates, music notation, or verify OCR accuracy, then share the page viewer link.

Instructions

Fetch one page image and inspect it yourself for the user. Returns image bytes for your own visual analysis. The client may also show the image to the user; that is expected, so neither avoid the call nor try to hide or comment on the image for that reason. To link the user to the page itself, give the result's viewer_url when present. Best for inherently visual material (e.g. maps, plates, music notation) or to sanity-check unreliable OCR from sgbr_get_fulltext. Identify the page by record id or scan_id plus a page; if the user pastes a viewer link .../detail/{id}?page={n}, extract {id} and {n}. Pass region_pct to crop to part of the page (e.g. a page-number corner or one figure of a plate) at a fraction of the payload — those region_pct values can come straight from sgbr_get_page_ocr's or sgbr_locate_text's layout regions. A crop is delivered at its own scanned resolution, so a word-sized region arrives small and cheap; when you need more detail, widen region_pct rather than raising max_long_edge — only a larger region carries more pixels. A non-error result is the page image itself (the pixels are included; see byte_size): describe what you see in it. A fetch failure arrives as an explicit error result, never as an empty image.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sgbr_inspect_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoRecord id from an sgbr_search result. The tool resolves its scan id automatically. Provide this OR scan_id.
pageNoScanned-image page to fetch, 1-based (the same axis as the viewer's `?page=N` deep link). Defaults to 1 — except a foldout/Falttafel record addressed by `id`, whose own plate page is resolved automatically (override by passing `page`). Note the thumbnail page shown by sgbr_get_record is often a different, editorially-chosen "representative page" — request the page you actually want.
scan_idNoScan id from sgbr_get_record (`digital.scan_id`, e.g. "UBBS-00190048"). Use it to skip the id→scan lookup. Provide this OR id.
region_pctNoOptional sub-region crop as percentages of the full page: [x, y, width, height], top-left origin. E.g. [0, 85, 30, 15] = the bottom-left corner (good for reading a printed page number cheaply), [25, 25, 50, 50] = the centre. Omit for the whole page. The crop is delivered at its own scanned resolution, never enlarged, so a small region arrives small and cheap — prefer a crop over a full page whenever you only need part of it.
max_long_edgeNoUpper bound on the image's longest edge in pixels (400-1988, default 1988 = the largest that reaches you undownscaled). This is a ceiling, not a target: the image is also capped at the region's own scanned resolution, so a small crop arrives small (and cheap) no matter what you pass here. Request smaller only for frugality; to see more detail, change region_pct, not this.

Output Schema

NameRequiredDescriptionDefault
idYes
pageYes
scan_idYes
warningsNo
byte_sizeYes
long_edgeYes
mime_typeYes
region_pctYes
source_urlYes
viewer_urlYes
visual_tokensYes
delivered_widthYes
delivered_heightYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.30.2

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, openWorld) and an output schema exists, yet the description adds real behavior: the client may display the image, crops are never upscaled, and "a fetch failure arrives as an explicit error result, never as an empty image." The remaining minor gap is that pagination/multi-page retrieval and any rate or size limits beyond max_long_edge are not discussed, though the byte_size note partly covers cost.

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?

Front-loaded with purpose and behavior, then moves to identification, cropping strategy, and result handling in a sensible order; nearly every sentence carries distinct information. The one redundancy is the crop-resolution/max_long_edge explanation, which restates at length what max_long_edge's own schema description already says.

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?

Given five optional parameters, a full output schema, and high schema coverage, the description covers everything an agent needs: how to identify the page, how to keep payload small, how to interpret a success versus an error, and how to hand the user a viewer_url. No obvious unanswered question remains before invoking it.

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

Parameters5/5

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

Schema coverage is 100%, so baseline would be 3, but the description adds meaning the schema cannot: it explains how to derive `id` and `page` from a pasted viewer link, and that region_pct values can come straight from sgbr_get_page_ocr or sgbr_locate_text layout regions. It also resolves the interaction between region_pct and max_long_edge (widen the region rather than raise the ceiling), which is cross-parameter reasoning absent from the schema.

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?

"Fetch one page image and inspect it yourself for the user. Returns image bytes for your own visual analysis." states a specific verb (fetch) and resource (page image) plus the unusual agent-side action (visual analysis). It is clearly separable from sgbr_get_fulltext and sgbr_get_page_ocr, which it names as text/OCR 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?

It gives explicit when-to-use criteria ("Best for inherently visual material (e.g. maps, plates, music notation)") and an explicit alternative trigger ("to sanity-check unreliable OCR from sgbr_get_fulltext"). It also preempts a likely agent hesitation with "neither avoid the call nor try to hide or comment on the image", which is genuine routing guidance.

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