Skip to main content
Glama

cut_out

Extracts a product from its source photo as a transparent PNG using concept-guided segmentation, then provides mask overlay and review details to verify the selection.

Instructions

Cut the product out of its photo as a transparent PNG.

Args: image: The product photo — an asset handle (asset://), an http(s) URL, or a base64 data URI. It is ingested and normalized first. concept: Optional noun-phrase concept naming what to segment ("brown leather wallet"). When omitted, the identify planning step runs internally to produce the concept and alternates.

Calls SAM 3.1 with the concept phrase and decodes the returned mask (Meta's official parser, behind the sam_masks boundary). The mask is quality-checked — coverage sane (not empty, not ~the whole frame) and dominated by one connected region — and on a zero-match or a poor mask, all fixed identify phrases are evaluated and bounded phrase; every attempt is traced in the result. The foreground is the source pixels through the accepted mask, nothing regenerated. Storage is a lineage chain — mask parented to the source photo, foreground parented to the mask — so draw's fidelity receipt pins the exact mask asset the cut used. The input must be a source photo: handing cut_out a generated asset (a composite, a plate) is refused with NOT_A_SOURCE_PHOTO before any billing, because cutting generated pixels out would launder them into a protected foreground. Because a fidelity receipt can only vouch for the pixels a mask selected, the result also carries the selection's own review surface: mask_overlay_asset (the source photo with the mask's outline drawn on it) and mask_review (the mask's bounding box, fill, frame-edge contact, and any sanity warnings).

Failures return a structured error: NOT_CONFIGURED (no META_API_KEY; checked before billing, so no ledger write), NO_MATCH / POOR_MASK (no usable mask after the bounded attempts; the attempts' spend stays counted), BAD_MODEL_RESPONSE (SAM output unusable; spend counted). A planning failure inside the chain (concept omitted and identify failed) surfaces as that step's error code with plan_error attached.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "image": "<image>"
    },
    "name": "cut_out"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYes
conceptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden, and it does: mask quality gates (coverage sanity, single dominant region), fallback attempts across fixed identify phrases, cost/billing ordering (NOT_CONFIGURED checked before billing, spend counted on NO_MATCH/POOR_MASK/BAD_MODEL_RESPONSE), lineage parentage, and the refusal for generated inputs. It also discloses that pixels are the source through the accepted mask, 'nothing regenerated', which is a meaningful fidelity claim an agent could not infer.

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 outcome and the source-photo precondition are front-loaded, and the error taxonomy is dense but each code earns its place. Two costs: the docstring-style Args block duplicates schema fields, and one sentence is garbled ('all fixed identify phrases are evaluated and bounded phrase'), which slightly muddies the retry semantics.

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 two-param tool with no annotations and no output schema, this is thorough: it describes the pipeline, the accepted-mask criterion, the failure modes with their billing consequences, and the review artifacts returned (mask_overlay_asset, mask_review with bbox/fill/frame-edge contact/warnings). An agent has enough to decide whether to call it and how to interpret both success and structured errors.

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 coverage is 0%, so the description must cover parameters, and it does: image is documented as accepting an asset handle (asset://<id>), an http(s) URL, or a base64 data URI, and that it is ingested and normalized first. concept is documented as an optional noun-phrase with a concrete example ('brown leather wallet') plus the behavioral consequence of omitting it. That is more meaning than the bare string/anyOf schema conveys.

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 first sentence gives a concrete verb, resource and output format: 'Cut the product out of its photo as a transparent PNG.' It implicitly separates itself from siblings by noting that 'the identify planning step runs internally' when concept is omitted, and by referencing 'draw's fidelity receipt', so an agent can tell it is the segmentation tool rather than the planning or compositing one. It stops short of an explicit sibling contrast, which keeps it at 4.

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?

It tells the agent that concept can be skipped because identify runs internally, and it states a hard precondition with an exclusion: 'The input must be a source photo: handing cut_out a generated asset (a composite, a plate) is refused with NOT_A_SOURCE_PHOTO.' That is real when-to-use and when-not-to-use guidance. It does not name an alternative tool to reach for when you do have a generated asset, so it is not a 5.

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

Deploy Server

Other Tools