Skip to main content
Glama

measure_sharpness

Assess image sharpness by computing the mean Sobel gradient energy of luminance in a custom region or the central half, returning a numeric score.

Instructions

Measure sharpness as the mean Sobel gradient energy (gx² + gy²) of luminance over every 4th pixel of a region. The region is roi_x/roi_y/roi_w/roi_h when all four are given (it must lie inside the image), else the central half of the image in each dimension. Returns JSON: sharpness, samples, roi {x, y, w, h}. luminance is 0.2126R + 0.7152G + 0.0722B.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roi_hNoRegion height in pixels
roi_wNoRegion width in pixels
roi_xNoRegion left edge in pixels (all four ROI values together, or none: the central half)
roi_yNoRegion top edge in pixels
view_idYesView to measure

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries full behavioral disclosure: it names the exact algorithm, the pixel sampling strategy, ROI fallback behavior, output JSON structure, and luminance weighting. This is far more transparent than typical tool descriptions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences deliver the formula, ROI behavior, and return format without redundancy. Critical information is front-loaded, and every clause earns its place.

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 measurement tool with no output schema and no annotations, the description is complete: algorithm, sampling, ROI semantics, constraints, and return fields are all specified. Nothing essential is missing for correct invocation and interpretation.

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%, so the baseline is 3. The description adds genuine meaning by explaining that ROI parameters must all be provided together or omitted for the central-half default, and that the region must lie inside the image.

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 and resource: 'Measure sharpness' via a precise formula (mean Sobel gradient energy). It also clarifies the region selection rules eliminating ambiguity against other measure_* sibling tools like measure_uniformity or measure_stars.

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?

The tool's purpose clearly implies when to use it: when sharpness of a region or central half is needed. However, it does not explicitly compare to sibling tools or state when not to use it, leaving alternatives to inference.

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