Skip to main content
Glama

ui

Build and modify Godot UI at runtime: create controls, arrange containers, set anchors, apply themes, draw recipes. Changes affect the current execution context only, not .tscn files.

Instructions

UI 操作。节点: ui_create_control, ui_container_add, ui_build_layout。布局: ui_set_layout, ui_get_layout, ui_anchor_preset。主题: ui_set_theme, theme_create, theme_set_property。绘图: ui_draw_recipe。运行时操作,仅影响当前执行上下文。如需持久化,请编辑 .tscn 文件。 专属参数(additionalProperties): ui_set_theme→theme_action/theme_path/params; theme_create→theme_create_action/source_node_path/save_path; theme_set_property→theme_node_path/item_type/prop_name/theme_type/value; ui_build_layout→tree({type,name,properties,anchor_preset,layout,flex,children}); ui_draw_recipe→ops([{kind,...}])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes操作类型
presetNoui_anchor_preset: 锚点预设名称
anchorsNoui_set_layout: 锚点 {left, right, top, bottom},值 0-1
offsetsNoui_set_layout: 边距 {left, right, top, bottom},像素值
min_sizeNoui_set_layout: 最小尺寸 {x, y}
node_nameNoui_create_control: 新节点名称
node_pathNo节点路径(ui_set_layout/ui_get_layout/ui_anchor_preset/ui_set_theme/ui_container_add/ui_draw_recipe)
node_typeNoui_create_control/ui_container_add: Control 子类类型
child_nameNoui_container_add: 子节点名称
child_typeNoui_container_add: 子节点 Control 类型
propertiesNoui_create_control: 可选属性(支持 string/number/bool/null)
scene_pathNo场景路径(相对项目路径)。ui_set_theme/theme_set_property 可选
parent_pathNoui_build_layout: 父节点路径
project_pathNoGodot 项目目录路径
grow_directionNoui_set_layout: 增长方向
load_autoloadsNo是否加载 Autoload 上下文(默认 true)
child_propertiesNoui_container_add: 子节点属性(支持 string/number/bool/null)
parent_node_pathNoui_create_control: 父节点路径(默认 root)
custom_minimum_sizeNoui_set_layout: 自定义最小尺寸 {x, y}
Behavior3/5

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

注解已给出 readOnlyHint=false、idempotentHint=false、destructiveHint=false,而描述补充了“运行时操作,仅影响当前执行上下文”这一关键行为特征,提供了超出注解的额外信息。它没有说明每个动作的具体副作用,但对于 10 个动作的调度器而言,这一层级的披露已足够。没有发现与注解矛盾之处。

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?

描述长度适中,按节点、布局、主题、绘图分类组织,先说明目的,再讲行为限制,最后提供参数映射,结构清晰。没有冗余句子,参数映射虽密集但紧凑,整体高效。

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?

对于有 19 个参数、10 个动作、无输出 schema 的工具,描述覆盖了动作分类、运行时作用域、持久化指引和动作-参数映射,提供了充分的上下文。缺少示例和每个动作的返回值说明,但考虑到复杂度,已相当完整。

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?

虽然输入 schema 已覆盖所有列出的参数并有描述,但描述中的“专属参数(additionalProperties)”部分为每个动作列出了特定的参数映射(如 ui_set_theme→theme_action/theme_path/params),这些信息不在 schema 中,显著帮助 agent 针对不同 action 选择正确参数,提供了超越 schema 的语义价值。

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

描述以“UI 操作”开头,并按类别详细列出了动作(节点、布局、主题、绘图),明确了工具是用于 UI 操作的调度器。虽然“UI 操作”较为宽泛,但动作列表提供了具体性,并区别于 sibling 工具(如 scene、editor)。

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?

描述明确说明“运行时操作,仅影响当前执行上下文”,并指出“如需持久化,请编辑 .tscn 文件”,给出了清晰的使用场景和排除条件。虽然没有指名替代工具,但足以指导 agent 在运行时修改 UI 时使用此工具,持久化时应改用其他方式。

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wgt19861219/godot-mcp-enhanced'

If you have feedback or need assistance with the MCP directory API, please join our Discord server