Skip to main content
Glama

segment_cells_2d

Segment cells in 2D microscopy images with adjustable parameters for model type, diameter, and thresholds. Provide an image path to get cell counts and mask output.

Instructions

Segment cells in a 2D microscopy image using Cellpose.

Args: image_path: Path to input image file (TIFF, PNG, etc.) model_type: Cellpose model type (cyto, cyto2, cyto3, nuclei, etc.) diameter: Expected cell diameter in pixels (0 = model default) channels: Channel specification [cyto, nuclei] or None for grayscale flow_threshold: Flow error threshold (lower = more masks, may be worse quality) cellprob_threshold: Cell probability threshold (higher = fewer masks) min_size: Minimum cell size in pixels gpu: Whether to use GPU acceleration augment: Use test-time augmentation (flip/rotate) normalize: Normalize image intensities invert: Invert image intensities (for bright background) output_path: Optional path to save masks (default: image_path with _masks suffix)

Returns

Dictionary with segmentation results including cells_detected, output_path, diameter, mask_shape

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gpuNo
invertNo
augmentNo
channelsNo
diameterNo
min_sizeNo
normalizeNo
image_pathYes
model_typeNocyto3
output_pathNo
flow_thresholdNo
cellprob_thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It does disclose the return dictionary shape and the output_path default side effect ('image_path with _masks suffix'), which shows the tool writes files. However, it omits runtime behaviors an agent would need to anticipate, such as first-use model download, GPU memory requirements, or failure modes for unsupported image formats. Partial but meaningful disclosure.

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?

Well structured with an opening sentence, an Args block, and a Returns block. Though long, every line documents a parameter that is otherwise undocumented in the schema, so no content is wasted. The purpose statement is front-loaded before the parameter list. Appropriate length for a 12-parameter tool.

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 12-parameter segmentation tool with 0% schema coverage, the description thoroughly covers all parameters and their semantics. An output schema exists, so return-value details need not be repeated. The main gap is the missing usage guidance relative to siblings, which is a separate dimension. Parameter and behavioral coverage is otherwise complete.

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%, and the description fully compensates by documenting all 12 parameters with semantic context. It explains tuning-direction effects ('flow_threshold: lower = more masks, may be worse quality'), defaults ('diameter: 0 = model default'), and channel semantics ('[cyto, nuclei] or None for grayscale'). This exceeds what the bare schema names and defaults could convey.

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?

Opens with a specific verb+resource statement: 'Segment cells in a 2D microscopy image using Cellpose.' The '2D' qualifier distinguishes it from sibling segment_cells_3d, and the single-image framing differentiates it from segment_cells_batch. Purpose is unambiguous.

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 no explicit when-to-use guidance or alternative routing. Sibling tools like segment_cells_3d, segment_cells_batch, and restore_and_segment are never mentioned, so an agent must infer scope from the name. The parameter hints (e.g., 'Expected cell diameter in pixels') subtly reference related tools but never say 'use estimate_cell_diameter first' or 'use segment_cells_batch for multiple images.'

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