Skip to main content
Glama

Generate Segmentation Mask

sdnext_mask

Generate a segmentation mask for an image, automatically creating one when none is provided. Specify mask type and model to return the desired mask.

Instructions

Generate a segmentation mask for an image (SD.Next /sdapi/v1/mask). Auto-masks when no mask is given. Mask models/types from sdnext_list_masking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maskNoOptional existing mask image (base64); omitted = auto-masking.
typeYesMask type to return (e.g. "original", "mask", "colormap").
imageYesBase64-encoded image (raw base64, data: URL, or "upload:<id>" ref).
modelNoSegmentation model name (from sdnext_list_masking).
paramsNoMasking settings (colormap, thresholds, ...).
Behavior3/5

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

The description mentions auto-masking behavior when no mask is provided, which is a useful behavioral detail. Yet it does not describe side effects, output format, or failure modes, leaving some uncertainty about the tool's full behavior.

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 concise, consisting of two short sentences with no redundant information. It efficiently conveys the core purpose and a key behavioral feature.

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?

The description provides sufficient context for a generation tool: it specifies the action, the input (image), the optional mask, and references to obtain models/types. While it lacks details on the exact output format, it is still reasonably complete for a tool of this complexity.

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?

All parameters are described in the schema (e.g., 'image' as base64, 'mask' optional, 'type' as mask type, 'model' as model name, 'params' as settings). The description does not add extra insight but the schema descriptions are clear enough for parameter understanding.

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 the tool's primary function: 'Generate a segmentation mask for an image.' It also specifies the resource path and distinguishes it from related tools like sdnext_list_masking by mentioning auto-masking and referencing that list tool explicitly.

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 when to use this tool (when a mask is needed) and references sdnext_list_masking for obtaining model/type options, providing some usage context. However, it does not explicitly state scenarios where this tool would be preferred over other generation tools or mention any exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Congenital/sdnext_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server