Skip to main content
Glama

stretch_stars

Stretch a linear star image by subtracting background median and applying repeated midtones adjustments to enhance visibility. Reports pedestal, final median, maximum, and high_fraction.

Instructions

Stretch a linear star image in place with a pedestal subtraction and a repeated midtones transfer function. When the image median is above 1e-5 it is subtracted as a pedestal and the rest rescaled, max(0, (x − median)/(1 − median)); then the midtones transfer function MTF(m, x) = (1 − m)·x / ((1 − 2m)·x + m) is applied iterations times with m = midtone. Results are truncated to [0,1]. The result reports the pedestal, the final median and maximum, and high_fraction: among pixels sampled every 16 pixels whose value (the channel maximum) exceeds 0.005 before the stretch, the fraction above 0.5.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
midtoneYesMTF midtones balance m, strictly between 0 and 1 (m < 0.5 brightens)
view_idYesStar image view ID
iterationsYesNumber of times the MTF is applied (>= 1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the pedestal threshold (median > 1e-5), the exact formula, truncation, and the output metrics. It clearly states the operation is a stretch and modifies the image in place. No contradictions.

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 moderately long but every sentence adds detail: algorithm steps, threshold, exact formula, and output metrics. It is front-loaded with the main purpose and then explains mechanics. No fluff, but could be slightly tightened.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (two-step algorithm, iterations, pedestal handling) and lack of annotations or output schema, the description covers all essential behavior and return metrics. Minor gaps: no mention of required image state (e.g., must be linear) and no performance notes, but sufficient for calling.

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 coverage is 100% (all 3 parameters are documented in the schema, including types and brief meanings). The description adds the m < 0.5 brightens note and clarifies the MTF application, but essentially repeats parameter meanings. Baseline of 3 is appropriate.

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 specific verb ('stretch') and resource ('linear star image'), and details the exact two-step algorithm. It clearly differentiates from siblings like auto_stretch and robust_median_stretch by naming the specific transfer function and pedestal subtraction.

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?

Implies use for linear star images needing a specific midtones stretch, but does not explicitly state when to use this versus auto_stretch or robust_median_stretch. No alternatives are named or excluded.

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