Skip to main content
Glama

render_preview

Idempotent

Render a recipe as a small JPEG preview to verify composition before applying the transform. Optionally overlay guide lines or a mask to inspect alignment and coverage.

Instructions

Render a recipe as a small JPEG preview (long edge <= 768 by default) and return it inline plus a file path, so the composition can be checked before committing to apply_transform. Takes either recipe or preset, exactly like apply_transform. Optional long_edge (256..=1568) sets the preview size: raise it to 1568 when the point of the preview is to READ text in the image; 768 is too small for that. Optional overlay ("grid" | "thirds" | "horizon") draws semi-transparent composition guide lines on the returned preview only (never on the apply_transform output). overlay="mask" instead visualises a mask: pass mask_revision_id (required for this overlay and rejected for the others) and the preview is tinted red where the mask weight exceeds 0.5 and dimmed elsewhere, so the coverage can be eyeballed. Note: if the recipe's encode format is png, webp, or avif, any ICC color profile on the source is dropped (embedding is only supported for jpeg output); this is reported as a warning, not an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presetNoビルトインプリセット名。`recipe` とは排他。
recipeNo変換レシピ。`{"operations": [...]}`。`preset` とはどちらか一方のみ指定する。
overlayNo構図確認用のガイド線。`"grid"`(1/8 刻みの格子)| `"thirds"`(三分割法)| `"horizon"`(1/12 刻みの水平線のみ、傾き目視用)| `"mask"`(マスクの被覆可視化。 `mask_revision_id` が必須)。省略時はオーバレイなし。
long_edgeNoプレビューの長辺(256..=1568)。省略時は 768。 文字を読む用途では 1568 まで上げる(DESIGN.md §9.12)。
revision_idYes入力 revision ID("rev_...")。
mask_revision_idNo`overlay: "mask"` で可視化するマスク画像 revision ID。 `overlay` が `"mask"` のときのみ指定でき、そのときは必須。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYes
heightYes
overlayNo適用した overlay。未指定なら null。
warningsYes
byte_sizeYes
mime_typeYes
recipe_hashYes
preview_pathYesプレビュー画像の絶対パス。
engine_versionYes
mask_revision_idNo`overlay: "mask"` で可視化したマスクの revision ID。それ以外では null。
source_revision_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.2

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: the preview is returned inline plus a file path, overlay lines are drawn only on the preview and never on apply_transform output, and the ICC color profile dropping behavior for non-jpeg encode formats is disclosed as a warning. This goes beyond the annotations and helps the agent anticipate side effects and edge cases.

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?

The description is dense but well-organized: it front-loads the core purpose and return behavior, then explains optional parameters and edge cases. Every sentence adds information. It is longer than a typical description, but the complexity of the tool (multiple overlays, conditional mask_revision_id, ICC profile caveat) justifies the length. Slight redundancy with the schema's parameter descriptions prevents 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?

Given the tool's complexity (6 parameters, conditional requirements, multiple overlay modes, output schema present), the description covers all essential behavioral aspects: what is returned, when to use it, how to choose long_edge, how overlays work, the mask_revision_id condition, and the ICC profile warning. The output schema exists, so return values need not be described in detail. Nothing critical is missing for an agent to call this tool correctly.

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 schema already documents all parameters. The description adds meaning beyond the schema by explaining the purpose of long_edge (768 is too small for reading text, raise to 1568), the exclusivity of recipe/preset, and the conditional requirement of mask_revision_id for overlay='mask'. It also clarifies that overlay lines never appear on apply_transform output. This is meaningful added value, though the schema already carries the basic semantics.

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 states a specific verb ('Render'), a specific resource ('a recipe as a small JPEG preview'), and the purpose ('so the composition can be checked before committing to apply_transform'). It clearly distinguishes itself from the sibling apply_transform by emphasizing it is a preview-only operation. The description also names the key alternatives (recipe or preset) and the optional overlay modes, making the tool's role unambiguous.

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?

The description explicitly says when to use this tool ('before committing to apply_transform') and names the sibling apply_transform as the alternative. It also gives concrete guidance for parameter choices: raise long_edge to 1568 when reading text, use overlay modes for composition guides, and use overlay='mask' with mask_revision_id for mask coverage. This is explicit, actionable usage guidance.

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