Skip to main content
Glama

Masked edit: replace, remove, change material (Magic Wand AI)

luw_magic_wand

Edit only a masked image area by adding or replacing content with a prompt, erasing it, or applying a material texture; white mask marks the targeted region.

Instructions

Luw.ai Magic Wand AI: change only a masked area of an image. Give a prompt to add/replace what's there, remove=true to erase it, or material_image to re-surface it (e.g. new flooring or wall tiles). The mask is a black-and-white image the same size as the input; white marks the area to change. Get masks from luw_segment. 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>",
      "mask_image": "<mask_image>"
    },
    "name": "luw_magic_wand"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesImage to edit (public https:// link or data: URI; the local npx server also accepts a file path).
engineNoLuw.ai model: aria (default) or symphony (Symphony-3).
promptNoWhat to put in the masked area.
removeNoRemove whatever is in the masked area.
mask_imageYesBlack/white mask, white = area to change (public https:// link or data: URI; the local npx server also accepts a file path).
enhance_promptNoLet Luw.ai's prompt enhancer expand a short prompt.
keep_structureNoPreserve the masked area's geometry/lines while changing its look (structure-guided fill).
material_imageNoMaterial/texture to apply to the masked area (public https:// link or data: URI; the local npx server also accepts a file path); luw_list_options kind="materials" has a ready-made catalog.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.3.18
    • removedInput schema / properties / format
      Removed value: -{
      -  "description": "Output image format.",
      -  "enum": [
      -    "jpg",
      -    "png",
      -    "webp"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / properties / image / description
      Previous value: -"Image to edit (https:// URL, local file path, or data: URI)."New value: +"Image to edit (public https:// link or data: URI; the local npx server also accepts a file path)."
    • changedInput schema / properties / mask_image / description
      Previous value: -"Black/white mask, white = area to change (https:// URL, local file path, or data: URI)."New value: +"Black/white mask, white = area to change (public https:// link or data: URI; the local npx server also accepts a file path)."
    • changedInput schema / properties / material_image / description
      Previous value: -"Material/texture to apply to the masked area (https:// URL, local file path, or data: URI); luw_list_options kind=\"materials\" has a ready-made catalog."New value: +"Material/texture to apply to the masked area (public https:// link or data: URI; the local npx server also accepts a file path); luw_list_options kind=\"materials\" has a ready-made catalog."
    • removedInput schema / properties / seed
      Removed value: -{
      -  "description": "Fix for reproducible results.",
      -  "maximum": 9007199254740991,
      -  "minimum": 0,
      -  "type": "integer"
      -}
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the basic annotations, the description discloses crucial behavioral traits such as the operational cost of 1 credit and a detailed explanation of the masking mechanic (white = change area). This adds vital execution context for the agent.

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 definition is highly concise and structurally sound. It leads with the core capability and then efficiently details the operational modes and prerequisites in a logical progression without unnecessary jargon.

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?

The definition is highly complete for a sophisticated image manipulation tool. It explains the core mechanism (mask dependency), the specific methods of change (prompt/remove/material), and the cost, giving the agent all necessary context for successful invocation.

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?

Although the schema is 100% covered, the description provides significant semantic value by explicitly defining the function of the primary actions: 'remove=true to erase it' and 'material_image to re-surface it.' It also clarifies acceptable input types for the images/masks.

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 identifies the tool's function: performing masked edits on an image using Luw.ai Magic Wand AI. It distinguishes its purpose from general image generation tools by focusing specifically on modifying a designated area.

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 provides clear operational guidance by outlining three distinct use cases: using a text prompt, setting the `remove` flag to true, or supplying a `material_image` for resurfacing. This helps the agent choose the correct input parameters.

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