create_ui_element
Create UI elements: Button, Text, Image, Panel, InputField, Slider, Toggle, Dropdown
Category: UI
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
element_type |
string | yes | Type of UI element to create. One of: button, text, image, panel, input_field, slider, toggle, dropdown, scroll_view, raw_image |
|
name |
string | yes | Name of the UI element | |
parent |
string | Parent object name (must be under a Canvas, or leave empty to create on root Canvas) | ||
text |
string | Text content for Button, Text, or InputField placeholder | ||
position |
object | Anchored position (x, y) | ||
size |
object | Size delta (width, height) | ||
color |
string | Color in hex format (e.g., #FF0000) | ||
font_size |
integer | 14 |
Font size for text elements | |
sprite_path |
string | Asset path to sprite for Image element | ||
use_tmp |
boolean | false |
Use TextMeshPro instead of legacy Text (requires TMP package) |
Example call
Section titled “Example call”The arguments below are the required ones; add the optional ones you need.
{ "name": "create_ui_element", "arguments": { "element_type": "button", "name": "…" }}In SuperSave mode
Section titled “In SuperSave mode”When Unity runs with NANORA_MCP_SUPERSAVE=1, call it through the execute meta tool: {"tool": "create_ui_element", "args": { … }}. See SuperSave mode.
Source
Section titled “Source”Generated from Assets/NanoraUnityMCP/Editor/Tools/UITools.cs (version 1.2.1). The client receives the same schema from tools/list.