Skip to main content
Glama

create_widget

Creates a runtime UUserWidget instance in PIE/editor and, when a local PlayerController exists, optionally adds it to the viewport.

Instructions

Create a runtime UUserWidget instance of a concrete UserWidget class in a running PIE world (the default while PIE runs) or the editor world, owned by that world's first local PlayerController when there is one, and optionally AddToViewport it. Nothing is saved, and an unreferenced widget is garbage-collected. In the editor world add_to_viewport never adds (no PlayerController): read added_to_viewport. A taken name gets a unique variant, reported in widget_name; a class that does not load, is abstract or is not a UserWidget is an error. To change the asset use add_widget_to_blueprint; remove_widget searches the same worlds.

Returns: { widget_name: string, widget_class_path: string, widget_class_name: string, target_world: string, added_to_viewport: bool, add_to_viewport_note?: string, widget_valid: bool, world_name: string|null, world_package: string|null, world_type: string|null, net_mode: string|null, pie_instance: number }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widget_nameYesName to assign to the created widget instance (a name another widget already has gets a unique variant, which widget_name in the response reports)
target_worldNoOptional: "editor" | "pie" | "server" (the PIE world with authority) | "client" | "pie:N" | "game" (alias of "pie"). Defaults to "pie" when a Play-In-Editor session is running, else "editor". IMPORTANT: "editor" NEVER has a PlayerController, because GEditor's world is not a game world, so add_to_viewport can never really add there -- that is reported honestly (added_to_viewport stays false), never simulated. "pie" resolves the running PIE world and its first local PlayerController, so add_to_viewport there performs a REAL AddToViewport().
add_to_viewportNoIf true, AddToViewport the widget (optional, default false). It only ever really adds when the target world has a local PlayerController -- check added_to_viewport in the response, and see target_world for when that is possible at all.
widget_class_pathYesFull path to widget class, e.g. '/Game/UI/MyWidget.MyWidget_C'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With annotations present, the description still adds substantial context beyond them: nothing is saved, an unreferenced widget is garbage-collected, editor world never really adds to viewport, a taken name yields a unique variant, and a non-loading/abstract/non-UserWidget class is an error. These are exactly the destructive/auth/edge behaviors an agent needs.

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 scoping, then returns and edge cases. It is dense but each clause carries meaning; only mild redundancy with the schema's target_world description keeps it from a 5.

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 complex runtime tool with no output schema, the description supplies the full return shape, world targeting rules, and error/edge semantics. Nothing an agent needs to invoke it correctly is missing.

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 coverage is 100%, so each parameter is already documented in the schema, including target_world's enum-like values and add_to_viewport behavior. The description largely restates those semantics, so baseline 3 is appropriate.

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: 'Create a runtime UUserWidget instance of a concrete UserWidget class.' It adds scope (PIE or editor world, optional AddToViewport) and explicitly names siblings (add_widget_to_blueprint for asset changes, remove_widget for the same worlds), so an agent can separate it from the other widget tools.

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 gives clear context: defaults to 'pie' when a PIE session runs, otherwise 'editor', and routes the agent to add_widget_to_blueprint to change the asset. It explains the editor-world limitation but doesn't spell out explicit when-not-to-use conditions or preconditions beyond that.

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