Skip to main content
Glama

resample_image

Modifies pixel dimensions via whole-factor binning or enlargement, proportional rescaling, or copying a reference view's width and height.

Instructions

Change an image's pixel dimensions. mode "integer": IntegerResample by a whole factor (factor 2 bins 2x2 into one pixel with the given downsampling combination; enlarge: true multiplies the size instead). mode "scale": Resample by a relative factor (0.5 halves each side). mode "to_reference": Resample to exactly the width and height of reference_id. Runs in place, or on a copy named output_id that carries the keywords, astrometric solution and view properties. FITS keywords are kept. PixInsight removes the astrometric solution in these processes; the result states whether a solution was present before and after. Runs without the geometry confirmation dialog (noGUIMessages).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesinteger (IntegerResample), scale (Resample by a factor) or to_reference (Resample to reference_id's size)
factorNointeger: whole bin/zoom factor >= 2. scale: relative size factor > 0
enlargeNointeger mode: multiply the size by factor instead of dividing it (default false)
view_idYesView to resample
output_idNoResample a copy with this view id instead of the view itself
downsamplingNointeger mode: how binned pixels combine (default Average)
reference_idNoto_reference: the view whose width and height the result takes
interpolationNoscale / to_reference: Resample interpolation; omitted, PixInsight's default

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.1

TDQS

A4.3/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 behavioral burden and does so well: it discloses that it runs in place or on a copy (output_id) that carries keywords/solution/view properties, that FITS keywords are kept, that PixInsight removes the astrometric solution and reports its before/after presence, and that the geometry dialog is suppressed (noGUIMessages). This is rich, mutation-relevant detail.

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 core purpose and in-place/copy distinction are front-loaded, and every sentence carries information (mode semantics, side effects, astrometric behavior). It is a dense single block rather than cleanly sectioned, which keeps it just short of top marks.

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 an 8-parameter mutation tool with no output schema, the description covers modes, in-place vs copy behavior, preservation of keywords, astrometric-solution removal, and even what the result reports. Minor gaps remain (no pagination/return-structure concerns here, but interpolation choice reasoning against siblings is absent), so a 4.

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 coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema: 'factor 2 bins 2x2 into one pixel with the given downsampling combination' concretizes integer mode, and 'enlarge: true multiplies the size instead' clarifies direction semantics the schema only states tersely.

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?

Starts with a specific verb+resource ('Change an image's pixel dimensions') and names the three operating modes, each with a concrete behavior (2x2 binning, relative factor, match reference size). An agent can distinguish this from crop_image, reproject_to_reference, and align_to_reference from the description alone.

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 explains what each of the three modes does, which helps an agent pick a mode, but it never states when to prefer this tool over siblings like crop_image or reproject_to_reference, nor any prerequisites. Mode selection guidance is present; tool-vs-alternative guidance is not.

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