Skip to main content
Glama

save_preview

Save a JPEG preview of a PixInsight view and return its file path, optionally cropping, downsampling, or baking an STF display stretch without changing the original view.

Instructions

Save a JPEG preview of a view and return the file path. Optionally a crop region, a downsample factor, and an STF (display stretch) baked into the pixels: the STF of a view (stf_from) or a linked one given as stf_m and stf_c0. Without an STF the JPEG holds the view's pixel values as they are. The view itself is not changed.

Input Schema

NameRequiredDescriptionDefault
cropNoRegion [x0, y0, x1, y1] of the view in pixels (x1, y1 exclusive); the whole view when omitted
labelYesShort label for this preview (e.g. "after_stretch", "final")
stf_mNoBake a linked STF with this midtones balance (0 < m < 1) into the JPEG; needs stf_c0
stf_c0NoShadows clipping point of the linked STF given with stf_m (0 <= c0 < 1)
view_idYesPixInsight view ID
stf_fromNoBake this view's STF (its display stretch) into the JPEG; the view may be view_id itself. Several previews given the same stf_from are stretched identically
downsampleNoDivide width and height by this factor (>= 1). Omitted: the preview is scaled down to at most 2048 px on its longer side

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.4.1
    • addedInput schema / properties / crop
      Added value: +{
      +  "description": "Region [x0, y0, x1, y1] of the view in pixels (x1, y1 exclusive); the whole view when omitted",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 4,
      +  "minItems": 4,
      +  "type": "array"
      +}
    • addedInput schema / properties / downsample
      Added value: +{
      +  "description": "Divide width and height by this factor (>= 1). Omitted: the preview is scaled down to at most 2048 px on its longer side",
      +  "type": "number"
      +}
    • addedInput schema / properties / stf_c0
      Added value: +{
      +  "description": "Shadows clipping point of the linked STF given with stf_m (0 <= c0 < 1)",
      +  "type": "number"
      +}
    • addedInput schema / properties / stf_from
      Added value: +{
      +  "description": "Bake this view's STF (its display stretch) into the JPEG; the view may be view_id itself. Several previews given the same stf_from are stretched identically",
      +  "type": "string"
      +}
    • addedInput schema / properties / stf_m
      Added value: +{
      +  "description": "Bake a linked STF with this midtones balance (0 < m < 1) into the JPEG; needs stf_c0",
      +  "type": "number"
      +}
  2. First observedv2.1.0

TDQS

A3.7/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 and does meaningfully: it states the return value (file path), the non-destructive guarantee ('The view itself is not changed'), and the default behavior absent an STF ('the JPEG holds the view's pixel values as they are'). It omits details like where the file lands or overwrite behavior, so it is not exhaustive.

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?

Four economical sentences that are front-loaded with the primary action and outcome before detailing optional behavior. No filler, though the STF sentence is slightly dense.

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

Completeness3/5

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

For a 7-parameter write-to-disk tool with no annotations and no output schema, the description covers the return value and non-mutation well but leaves gaps on destination path, file naming/overwrite behavior, and error conditions. Adequate but not fully complete.

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, and the description adds real semantic value by explaining the STF concept (stf_from vs. the linked stf_m/stf_c0 pair) and what baking an STF does to the pixels. This goes beyond restating field names.

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 opens with a specific verb+resource: 'Save a JPEG preview of a view and return the file path.' An agent immediately knows the output artifact and location. However, it never distinguishes itself from close siblings like save_and_show_preview or export_image, so differentiation is left to inference.

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?

Usage is implied (previews, optional STF/downsample) but there is no explicit when-to-use statement and no named alternative for the many sibling preview/export tools. The 'Optionally...' phrasing guides parameter choices, but not tool selection.

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