Skip to main content
Glama

star_protected_blend

Blend a stars-only image into a starless one, preserving star-core color while applying a screen blend elsewhere. Use adjustable thresholds to protect bright star cores from over-brightening and optionally restore original color ratios.

Instructions

Blend a stars-only image into a starless one in place, as a screen blend that turns colour-preserving in bright star cores. The mode follows, per pixel, the star layer's own luminance SL (the mean of its three channels). Below core_threshold_low: per-channel screen blend 1 - (1 - target) * (1 - stars * k). Above core_threshold_high: luminance-only screen blend, the target's colour scaled by the new over the old luminance and capped at max_value. Between them the two blend linearly. k = strength * prot, where prot falls linearly from 1 at core_threshold_low to min_strength_fraction at core_threshold_high. With pre_star_id, the bright-area colour ratios of that view are then restored over the same luminance ramp (see restore_star_color). Runs as 64-bit PixelMath truncated to [0,1]; reports the target's median and max before and after.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stars_idYesStars-only RGB view
strengthYesMultiplier k on the star layer in the screen blend, before protection
max_valueYesUpper cap on each channel of the colour-preserving blend, and of the colour restoration when pre_star_id is given
target_idYesStarless RGB view, modified in place
pre_star_idNoOptional: RGB view whose colour ratios are restored in bright areas after the blend; empty or absent = no restoration
core_threshold_lowYesStar luminance SL at and below which the pure screen blend applies and protection is 1
core_threshold_highYesStar luminance SL at and above which the pure colour-preserving blend applies and protection is min_strength_fraction; greater than core_threshold_low
min_strength_fractionYesProtection factor reached at core_threshold_high (strength is multiplied by it)

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?

No annotations are provided, so the description carries the full burden - and it excels. It fully discloses: in-place mutation, the exact blend formulas per luminance range, the strength/protection scaling, the optional colour restoration behavior, 64-bit PixelMath execution, truncation to [0,1], and reporting of median/max before and after. Nothing is hidden, and no contradiction exists with annotations since none are present.

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 technical but every sentence earns its place: the core operation is front-loaded, then the luminance-dependent behavior, formulas, strength scaling, optional restoration, and execution details follow in a logical order. It is long because the tool is genuinely complex, not because of padding. A half-point is lost for the heavy formula density that could be slightly better organized into bullets or an example.

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 an 8-parameter, formula-driven tool with no output schema, the description is remarkably complete. It covers the response behavior (median/max reporting), side effects (in-place modification), parameter interrelationships, edge cases (threshold ramps, capping), and optional behavior (pre_star_id). An agent has everything needed to invoke the tool correctly.

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 beyond the schema: it defines k as strength * prot, explains how prot ramps between thresholds, clarifies max_value's role as a cap in both the blend and colour restoration, and describes how pre_star_id interacts with the luminance ramp. This transforms a list of parameter names into an actionable mental model.

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?

States a precise verb ('Blend'), specific resources ('stars-only image into a starless one'), and the in-place mutation behavior. It also names the closely related restore_star_color, which helps an agent distinguish this from a sibling rather than confusing them.

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 implies when to use the tool: when you want to blend a stars-only image into a starless one while protecting bright star cores. However, it does not explicitly state when not to use it or name alternatives beyond a passing reference to restore_star_color. The usage context is clear but not contrasted with sibling tools.

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