Skip to main content
Glama

create_adaptive_zone_masks

Creates core, shell, and outer masks from image luminance percentiles to isolate a bright subject from background, enabling targeted adjustments.

Instructions

Create three masks from percentiles of the image's own luminance. Subject pixels are those brighter than the background median + 5 MAD, sampled inside a circle of radius 0.35 * min(width, height) around their brightness-weighted centroid. Core = above the subject percentile 85 + 10 * core_bias; shell = a triangular ramp between the 25th percentile and the core level, peaking at their midpoint; outer = subject level up to the 25th percentile. Each is feathered over 20 px outside the circle and Gaussian-blurred with sigma 5, 10 and 20. Creates views azone_core, azone_shell and azone_outer, replacing views of those names; fewer than 50 sampled subject pixels is an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
view_idYesSource view the masks are computed from
core_biasNoPosition of the core threshold on its 0-1 scale: 0 = percentile 85, 1 = percentile 95 (default 0.5, the middle of the scale)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses the exact mathematical thresholds (median + 5 MAD, percentile 85 + 10 * core_bias), the sampling circle radius, feathering and blur parameters, the fact that it replaces existing views of those names, and the error condition (fewer than 50 sampled subject pixels). This is exemplary behavioral disclosure.

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 and information-rich, with every sentence contributing a specific algorithmic detail. It is front-loaded with the core purpose and then details the mask construction. It could be slightly more structured (e.g., separating the error condition), but it is appropriately sized for the complexity.

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 (three masks, multiple thresholds, blur, view replacement), the description is remarkably complete. It covers inputs, algorithm, outputs, side effects (replacing views), and error conditions. No output schema exists, but the description fully explains what the tool creates, so nothing critical is missing.

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 meaning beyond the schema by explaining how core_bias shifts the core threshold on the percentile scale (0 = percentile 85, 1 = percentile 95) and how view_id is the source for the masks. It doesn't restate the schema but enriches it with the algorithm's context.

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 ('Create') and resource ('three masks from percentiles of the image's own luminance'), and names the exact output views (azone_core, azone_shell, azone_outer). It clearly distinguishes itself from the sibling create_zone_masks by specifying the adaptive, luminance-based algorithm and the three named outputs.

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

Usage Guidelines4/5

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

The description implies when to use this tool: when you need adaptive zone masks based on the image's own luminance distribution. It does not explicitly state when not to use it or name alternatives like create_zone_masks, but the detailed algorithm and output names make the usage context clear. A brief exclusion note would push it to 5.

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