Skip to main content
Glama

Segment objects into masks (Segment AI)

luw_segment

Detect objects in a photo and return black-and-white mask image URLs for all objects or only those named in a prompt, so you can edit exact areas in Luw design tools.

Instructions

Luw.ai Segment AI: detect objects in a photo and return black-and-white masks as image URLs — every object (wall, floor, sofa, …) or only what you describe in prompt. Feed a mask URL into luw_magic_wand or luw_landscape_design to edit exactly that area. Costs 1 credit.

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": "luw_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesPhoto to segment (public https:// link or data: URI; the local npx server also accepts a file path).
labelsNoKeep only masks whose label contains one of these words (e.g. ["floor", "wall"]).
promptNoWhat to segment, e.g. "walls", "the sofa", "lawn". Omit to segment everything.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.18
    • changedInput schema / properties / image / description
      Previous value: -"Photo to segment (https:// URL, local file path, or data: URI)."New value: +"Photo to segment (public https:// link or data: URI; the local npx server also accepts a file path)."
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only say non-read-only, non-destructive, open-world, non-idempotent; the description adds the crucial economics (1 credit per call) and the concrete return shape (black-and-white mask image URLs). It does not disclose whether results are cached or how long URLs persist, but the cost and output-format disclosures are real value beyond the annotations.

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?

Three tight sentences: capability, mode selection, downstream handoff, plus cost. The most decision-relevant framing (what you get back) comes first and nothing is padded.

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?

With no output schema, the description correctly supplies the return format and the credit cost, and the input schema fully documents the three parameters. Minor omission: it never explains the labels filter or what 'labels' mean for returned masks, but an agent has everything needed to invoke it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description reinforces the prompt behavior (omit = segment all) but never mentions the 'labels' filter parameter, so it adds little meaning the schema doesn't already carry.

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?

States a specific verb and resource: 'detect objects in a photo and return black-and-white masks as image URLs'. It also distinguishes the two operating modes (all objects vs. prompt-described objects) and names the sibling tools it feeds into, so an agent can place it in a workflow without opening a schema.

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?

Gives clear context for both modes: omit prompt to segment everything, supply prompt to segment only the described region, and explicitly says to feed the resulting mask URL into luw_magic_wand or luw_landscape_design. It does not contrast against other possible entry points (e.g., background removal or object removal tools), so the when-not guidance is only partial.

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