Skip to main content
Glama

duplicate_widget

Clone a leaf widget under a target parent panel, copy matching slot properties, and reject panels with children to prevent broken aliased clones.

Instructions

Duplicate a widget (DuplicateObject outered to the WidgetTree) and add the clone under a target parent panel, copying the source's slot property values onto the new slot when the slot classes match. Refuses (clear error, no partial/broken result) to duplicate a panel widget that currently has children -- UE's object duplication would leave the clone's slots aliasing the SAME original child widgets rather than deep-copying them (see FDuplicateDataWriter); duplicate leaf widgets, or rebuild the panel's children individually with add_widget_extended. Name collisions on new_name are a clear error (not a silent alias of the pre-existing widget at that name).

Returns: { widget_bp_path: string, source_widget_name: string, new_widget_name: string, widget_class: string, target_parent_name: string, slot_class: string, slot_class_matched_source: bool, slot_properties_copied: int, duplicated: bool, saved: bool, save_error: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoOptional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk.
new_nameYesunique name for the duplicate
widget_nameYesname of the widget to duplicate (must not be a panel widget with children)
blueprint_nameNoAlias of `widget_bp_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `widget_bp_path`.
widget_bp_pathNo/Game path of the Widget Blueprint asset
target_parent_nameNoOptional name of the panel widget to host the duplicate; defaults to the source widget's own current parent (sibling placement).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare the write/safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false) but the description goes well beyond them: it explains that refusals are clean (no partial/broken result), why duplicating a panel with children is refused (slots would alias the SAME original child widgets rather than deep-copying), that name collisions error rather than silently aliasing the existing widget, and enumerates the return fields. This is the behavioral context the annotations cannot carry.

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?

Front-loaded with the core action and scope, then failure modes and the alternative, then the return shape. Information density is high, though the parenthetical engine internals (DuplicateObject<UWidget>, FDuplicateDataWriter) add some bulk without changing agent behavior; the multi-clause sentences could be tightened slightly.

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?

A mutation tool with no output schema and 6 parameters would normally leave gaps, but the description compensates by enumerating the full return object and disclosing all refusal conditions, the non-atomicity guarantee, and the PIE hazard. An agent can call it correctly and interpret the result without additional sources.

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 schema already documents all 6 parameters including the panel-with-children constraint on widget_name, the default-parent behavior of target_parent_name, and the blueprint_name alias. The prose narrative reinforces the slot-copy semantics but adds no new per-parameter syntax or format detail. Baseline 3 is appropriate when the schema does the heavy lifting.

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 the specific verb (Duplicate), the resource (a widget / UWidget) and the exact scope: the clone is outered to the WidgetTree and placed under a target parent panel, with slot property values copied when slot classes match. An agent can distinguish this from add_widget_extended, reparent_widget and rename_widget without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when the tool refuses to run (panel widget with live children, name collisions) and names the alternative path (duplicate leaf widgets, or rebuild the panel's children individually with add_widget_extended). The force parameter documents the PIE precondition and the safe action (stop PIE and retry). Nothing about when-to-use vs. alternatives is left to inference.

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