Skip to main content
Glama

run_pixelmath

Execute custom PixelMath expressions on a PixInsight view for pixel-level calculations and image transformations.

Instructions

Run an arbitrary PixelMath expression in place on a view. RULES: (1) NO pow() — use exp(exponent*ln(base)). (2) Channel access is $T[0] for R, $T[1] for G, $T[2] for B — NOT $T.R or $T.B. (3) For other images use viewId[0], viewId[1], viewId[2].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolsNoSymbol declarations (comma-separated)
view_idYesView ID to process
expressionYesPixelMath expression using $T for current pixel value
single_expressionNoApply the same expression to all channels (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.2/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 of disclosing behavior. It explicitly says the operation is performed 'in place on a view,' which signals mutation of the existing image, and it warns about syntax constraints that could produce incorrect results. It does not describe failure behavior or return values, but for an in-place mutation tool the key behavioral trait is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the purpose appears in the first sentence, followed by three short, essential rules. There is no filler or repeated schema information, and every sentence earns its place.

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?

For a complex, mutation-style tool with no annotations and no output schema, the description covers the tool's purpose, target view, and the syntax pitfalls most likely to cause incorrect invocations. The main gap is the absence of usage guidance relative to the many sibling image-processing tools, but nothing needed to construct a valid call 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 description coverage is 100%, so the baseline is 3. The description adds critical semantic detail beyond the schema by defining the valid expression syntax for channel access ($T[0], $T[1], $T[2]), forbidding pow(), and showing how to reference other images via viewId[index]. This is exactly the kind of parameter-level guidance an agent needs.

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 clearly states a specific action ('Run an arbitrary PixelMath expression') and a specific resource ('in place on a view'), so an agent can tell this is a PixelMath mutation tool rather than a general process or curve tool. 'In place on a view' also distinguishes it from sibling pixelmath_new_image, which creates a new image.

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 provides strong operational rules: no pow(), correct $T[index] channel syntax, and viewId[index] for other images. However, it never explicitly says when to choose this over run_process, run_curves, or pixelmath_new_image, and it gives no exclusions or alternative routing.

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