Skip to main content
Glama

set_pie_widget_focus

DestructiveIdempotent

Set keyboard or gamepad focus on a live UMG widget in a PIE session so navigation keys work. Resolves the widget by name and calls SetKeyboardFocus.

Instructions

Give keyboard/gamepad FOCUS to a live UMG widget in the running PIE session, so navigation has somewhere to start from. Menus routinely open with nothing focused, and then every navigation key does nothing -- which reads exactly like broken navigation and sends you to debug rules that were fine. Resolves the widget the same way click_pie_widget does (widget_name, optionally drilling in with child_name, nested Widget Blueprints included), then calls UWidget::SetKeyboardFocus. Verify with get_pie_focused_widget and drive from there with inject_key_input route="slate".

Returns: { focused: bool, widget_name: string, widget_class: string, has_keyboard_focus: bool } -- has_keyboard_focus is RE-READ off the widget after the call, so it is evidence and not an echo: false means Slate refused the focus, and the usual cause is that the widget is not focusable (check IsFocusable and its Visibility -- a HitTestInvisible widget cannot take focus).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
worldNoOptional world selector, same rules as read_pie_widgets: absent/'pie' | 'server' | 'client' | 'pie:N'.
child_nameNoOptional: after resolving widget_name, drill into this descendant by name (nested Widget Blueprints included).
widget_nameYesName of a live UserWidget added to the viewport, or of a widget inside one.
player_indexNoOptional local player index whose viewport widgets are searched (default 0).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the widget-resolution path, the failure mode (Slate refuses focus when a widget is not focusable, e.g. HitTestInvisible), and that has_keyboard_focus is re-read off the widget rather than echoed. It does not, however, reconcile the surprising destructiveHint=true annotation with what is framed as a benign focus setup call, leaving a small behavioral gap.

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 purpose and mechanics, then return-value semantics and failure diagnosis; each block carries information. The middle rationale about menus reading like broken navigation is slightly narrative, but it justifies the tool's existence and aids selection.

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?

With no output schema, the description supplies the return shape, the meaning of a false has_keyboard_focus, the likely root cause, and the verification/follow-up path. An agent has everything needed to call it, interpret the result, and recover from failure.

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 four parameters, and the description's gloss on widget_name/child_name (nested Widget Blueprints included) largely restates it. It adds cross-tool consistency ('resolves the same way click_pie_widget does') but says nothing about world or player_index, so the baseline 3 applies.

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 precise verb + resource: give keyboard/gamepad focus to a live UMG widget in a running PIE session, and names the exact engine call (UWidget::SetKeyboardFocus). It also positions itself against siblings: it reuses click_pie_widget's resolution semantics and is verified via get_pie_focused_widget, so an agent can distinguish it from read-only inspection tools without opening schemas.

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 defines the triggering situation ('menus routinely open with nothing focused, and then every navigation key does nothing') and the follow-up workflow: verify with get_pie_focused_widget, then drive with inject_key_input route="slate". Alternatives and sequencing are named rather than 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