Skip to main content
Glama

shell_detail_enhance

Enhance image detail at two scales while protecting bright highlights from over-boosting. Optionally apply through a mask or adaptive zone mask, with texture metrics reported.

Instructions

Protected high-pass detail enhancement at two scales, in place. For each scale, detail = image - Gaussian blur of sigma _sigma (locally zero-mean), and result = image + _amount x detail x protection, where protection = exp(-protect_softness x max(0, L - protect_knee) / max(1 - protect_knee, 0.01)) and L is Rec.709 luminance, so the boost attenuates above protect_knee. A scale with amount 0 is skipped. Output is truncated to [0, 1]. It does not hold the peak fixed: the added detail can raise the image maximum (the result reports the image maximum before and after, from full image statistics). With mask_id the enhancement runs through that mask; with auto_zone and no mask_id it builds the adaptive shell zone mask (as create_adaptive_zone_masks with its default core_bias), uses it and closes it, and fails without changing the view if that mask cannot be built; with neither it runs unmasked. Reports before/after texture metrics over pixels between median + 5 x 1.4826 x MAD and 0.98, sampled every 8 pixels: mean squared Sobel gradient, median local standard deviation of 16-pixel blocks that are at least 30% such pixels, and the share of them where protection is below 0.5.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mask_idNoMask view to enhance through (optional)
view_idYesView to enhance (modified in place)
auto_zoneNoWith no mask_id: build the adaptive shell zone mask and enhance through it. If it cannot be built the call fails and the view is not modified
large_sigmaYesGaussian sigma of the large-scale blur, in pixels
large_amountYesLarge-scale detail multiplier (0 skips the scale)
medium_sigmaYesGaussian sigma of the medium-scale blur, in pixels
protect_kneeYesLuminance above which the boost attenuates
medium_amountYesMedium-scale detail multiplier (0 skips the scale)
protect_softnessYesAttenuation rate above protect_knee (>= 0; higher = steeper)

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 the full burden and covers side effects in detail: in-place modification, truncation to [0,1], failure behavior for mask building, peak not held fixed, and the exact protection formula. This is unusually transparent for a mutating image-processing tool.

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 run-on, but nearly every sentence carries needed behavioral information and it opens with the core purpose. Minor structural formatting would help readability, but content is well-earned.

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 9-parameter mutating tool with no annotations and no output schema, this description is remarkably complete: it covers masking modes, failure semantics, luminance math, output bounds, and the exact metrics returned. Nothing essential is left unspecified.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds substantial meaning: the formula linking protect_softness, protect_knee, and luminance; the rule that amount 0 skips a scale; and how auto_zone affects mask_id. This goes well beyond the baseline supplied by the schema.

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 line 'Protected high-pass detail enhancement at two scales, in place' uses a specific verb and resource and clearly identifies the operation. It distinguishes this from siblings like multi_scale_enhance by emphasizing two-scale, protected, and in-place behavior.

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 description states exactly how the tool behaves under mask_id, auto_zone, and neither, from which an agent can infer appropriate use cases. It does not explicitly say when to prefer this over sibling tools or when not to use it, so guidance remains implied rather than explicit.

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