Skip to main content
Glama
iftahs
by iftahs

pixel_math

pixel_math
Destructive

Apply math expressions to a PixInsight view using $T or other view IDs, with rescale, truncate, RGB channels, and optional new-image output. Checkpoints before in-place edits preserve originals.

Instructions

PixelMath expression on a view ($T = target; other view ids usable). new_id creates a new image instead of replacing. Checkpoints first when in place.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
new_idNo
rescaleNo
truncateNo
checkpointNoWrite an .xisf checkpoint before running (default true)
expressionYes
expression_bNo
expression_gNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior4/5

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

The description supplements the destructiveHint=true annotation by explaining that the tool replaces the view in place unless new_id is supplied, and mentions checkpointing for in-place runs. This adds useful behavioral context beyond the annotations, though it doesn't fully spell out overwrite consequences or expression channel handling.

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 concise and front-loaded with the core function, then adds key behavioral details in short sentences. The phrase 'Checkpoints first when in place' is slightly awkward and ambiguous, which prevents a perfect score.

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

Completeness2/5

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

For a destructive tool with 8 parameters, no output schema, and low schema coverage, this description is insufficient for fully informed invocation. It captures the main operation and safety-related behavior, but omits meaning for several parameters and any indication of return or side effects.

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

Parameters2/5

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

With only 13% schema description coverage, the description carries a heavy burden for explaining parameters. It clarifies id via $T and other view ids, new_id via replacement behavior, and checkpoint, but leaves expression, expression_b, expression_g, rescale, and truncate effectively unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states that the tool applies a PixelMath expression to a view, identifies $T as the target, and allows other view ids. This is specific enough to distinguish it from image-processing siblings like pixelmath_mask, though 'PixelMath expression' could be slightly more explicit about what it does to pixels.

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 the tool is for applying PixelMath expressions to views and gives the new_id vs in-place distinction. However, it does not explicitly state when to prefer this tool over alternatives such as apply_process or pixelmath_mask, and the 'Checkpoints first when in place' line is more instruction-like than a clear usage policy.

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