Skip to main content
Glama

measure_subject_detail

Measure subject brightness, detail, and contrast in an image by analyzing luminance blocks, returning metrics like subject_brightness, detail_score, contrast_ratio, and background_median.

Instructions

Measure subject brightness, detail and contrast. The image is split into 32 px blocks; a block is subject when its luminance median is above median + 8 x 1.4826 x MAD. subject_brightness = median of subject block medians; background_median = median of the other block medians; contrast_ratio = subject_brightness / background_median (0 when that is at most 0.001); detail_score = mean Sobel energy of luminance over every 4th pixel of up to 50 subject blocks; subject_count = subject blocks; subject_threshold = median + 3 x 1.4826 x MAD. Returns JSON: subject_brightness, detail_score, contrast_ratio, subject_count, background_median, subject_threshold. luminance is 0.2126R + 0.7152G + 0.0722B.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
view_idYesView to measure

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.2/5.0
Behavior5/5

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

No annotations exist, so the description carries the full behavioral burden and delivers extensively: the 32px block segmentation, the subject-selection threshold (median + 8 × 1.4826 × MAD), exact formulas for every metric, the contrast_ratio edge case (0 when at most 0.001), the returned JSON keys, and the Rec. 709 luminance weights. This is far beyond what annotations would typically provide.

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, followed by a methodical progression: algorithm, metric definitions, edge case, return format, luminance formula. Every sentence earns its place for a tool this complex, though the density of mathematical detail (constants, Sobel sampling, formula chains) pushes it near the upper bound of length.

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?

For a single-parameter tool with no annotations and no output schema, the description is complete: it defines the computation, handles edge cases, enumerates all six JSON return values, and gives the luminance formula needed to interpret results. An agent can invoke the tool and correctly interpret its output with nothing else.

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

Parameters3/5

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

Schema description coverage is 100% for the single view_id parameter, so the schema already documents what it is ("View to measure"). The description adds no additional per-parameter meaning, but with full coverage the baseline of 3 is appropriate — nothing critical is missing.

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 opening sentence "Measure subject brightness, detail and contrast" pairs a specific verb with a specific resource, and the algorithmic detail (subject vs. background blocks) makes it unmistakably distinct from sibling tools like measure_stars, measure_sharpness, and measure_uniformity. An agent can tell exactly what this tool quantifies and which siblings it does not overlap with.

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

Usage Guidelines3/5

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

Usage context is implied through the metric definitions — an agent can infer this tool is for subject/background analysis, not star measurement or sharpness measurement. However, with roughly ten measure_* siblings, the description never explicitly states when to choose this tool or names alternatives to exclude, leaving routing to inference rather than guidance.

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