Skip to main content
Glama

save_masks

Saves cell masks as tif, png, or npy, plus binary outlines and overlay images. Uses an existing mask file and optionally the original image for visualization.

Instructions

Save masks plus outlines and overlay visualizations.

Always writes three outputs: (1) masks in the chosen format, (2) outlines as a binary PNG, (3) overlay PNG (colored masks on image or black).

Args: mask_path: Path to existing mask file output_format: Output format for masks (tif, png, npy) output_path: Optional custom output path for the masks file image_path: Optional path to original image; if provided, overlay is drawn on it save_flows: Reserved for future use (flow fields not saved)

Returns

Dictionary with mask_path, outlines_path, overlay_path, and files_created

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mask_pathYes
image_pathNo
save_flowsNo
output_pathNo
output_formatNotif

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully discloses key behaviors: always writes three outputs, with each output type specified; explains the role of image_path (overlay drawn on it if provided); flags save_flows as reserved for future use; and describes the return dictionary. This is comprehensive and leaves little to inference.

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 well-structured with a clear purpose statement followed by an Args section and a Returns line. It is not overly verbose and front-loads the main functionality. Minor redundancy (e.g., restating 'three outputs' in the purpose and the list) is acceptable and does not hurt clarity.

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

Completeness5/5

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

For a save tool with 5 parameters and no schema coverage, the description is complete: it covers the purpose, all parameters, the return structure, and the side effects (always writes three files). It does not leave critical gaps that an agent would need to guess.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must explain all parameters. It does: each parameter is briefly described in the Args section, including the meaning of output_path, image_path, and save_flows. This adds significant meaning beyond the bare schema types and defaults.

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 states a specific verb ('save') and resource ('masks'), and explicitly lists the three outputs it produces (masks, outlines, overlay). This clearly differentiates it from sibling tools that segment, denoise, or restore images, so an agent can immediately identify its purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for saving masks after segmentation, but it does not explicitly state when to use it vs. alternatives or provide exclusion criteria. However, the sibling tool names make the context obvious, and the description clearly indicates this is the saving step. A clear conditional statement would improve it, but it is adequate.

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