Skip to main content
Glama

measure_highlight_texture

Measure texture in bright image regions, returning local contrast, tonal span, and gradient energy. Optionally compare against a reference view to compute retention ratios.

Instructions

Measure the texture of the bright subject zone. Subject pixels have luminance above median + 5 x (median |luminance - median| on a 32 px grid). The ROI is a circle around the luminance-weighted centroid of compact subject pixels (8 px grid, at least 2 of 4 neighbours 3 px away also subject), radius = their 90th-percentile distance held to [50 px, 0.45 x min(width, height)]. The shell zone is the P20..P92 band of the subject pixels in the ROI (every 4th pixel). local_stddev = median luminance stddev of 16 px blocks in the ROI whose samples are at least 40% shell; tonal_span = P90 - P10 of the shell pixels; gradient_energy = mean Sobel energy on shell pixels. With reference_id, the reference is measured over the same ROI and retention is current / reference for each value (null where the reference value is at most 0.0001, or 0.001 for tonal_span). Returns JSON: current, reference, retention, shell_zone, roi, shell_pixel_count, block_count. Fewer than 100 subject pixels in the ROI of either view is an error. luminance is 0.2126R + 0.7152G + 0.0722B.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
view_idYesView to measure
reference_idNoOptional second view measured over the same ROI, for the retention ratios

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A3.8/5.0
Behavior5/5

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

With no annotations present, the description fully discloses the operation: subject-pixel criteria, ROI construction, shell-zone definition, metric formulas, reference-handling behavior, error thresholds, and the luminance formula. This goes well beyond a simple 'measure texture' statement and leaves little hidden behavior.

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 purpose is front-loaded in the first sentence, and every subsequent sentence provides a necessary computational detail. The description is long, but the algorithmic complexity justifies its length; there is no filler or repetition.

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?

Despite lacking an output schema, the description lists the returned JSON keys, explains the reference/retention semantics, and states the error condition. Some minor ambiguity remains about how 'current' maps to the three metrics, but the description is sufficient for an agent to invoke the 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?

The schema already documents both parameters completely, so the baseline is 3. The description adds material meaning for reference_id by specifying that the reference is measured over the same ROI and that retention ratios are computed with null-rules, and it also clarifies the error condition involving either view. This exceeds the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action and target: 'Measure the texture of the bright subject zone.' It then enumerates exact metrics and a precise subject-pixel definition, so an agent can tell what resource is being measured. However, it does not explicitly differentiate this from sibling measurement tools such as measure_subject_detail or measure_sharpness.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternative measurement tools, nor are there exclusions or prerequisites. The algorithmic detail implies a bright-zone texture context, but there is no explicit selection heuristic for an agent to follow.

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