Skip to main content
Glama

apply_widget_style_preset

Destructive

Apply one block of style properties to every widget in a Widget Blueprint matching a filter, in one compile and save.

Instructions

Apply ONE block of style properties to EVERY widget of a Widget Blueprint that matches a filter, in a single pass with ONE compile + ONE save -- the multi-widget companion to set_widget_property's multi-path form. Selection is target_widgets (explicit names, wins over everything) OR target_class (matched with IsA, so subclasses count) AND/OR name_pattern (wildcard). At least one selector is required: to hit every widget in the tree say so explicitly with name_pattern="*". Every value goes through the same honest applier, so the per-widget report distinguishes what landed from what was ignored; dry_run=true resolves the match and reports it WITHOUT writing, which is the cheap way to check a filter before it touches 40 widgets.

Returns: { widget_bp_path: string, selector_used: string, matched: [string], matched_count: int, dry_run: bool, results: [{widget_name, widget_class, applied, ignored, errors, failed_paths, applied_count, all_applied}], widgets_fully_applied: int, widgets_with_failures: int, saved: bool, save_error: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
saveNoCompile + save the Widget Blueprint when done (default true; a dry run never saves).
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.
presetNoDict of {"<property or dotted path>": <value>} applied to each matched widget, e.g. {"WidgetStyle.Normal.TintColor":"#1B1B1BFF"}. Optional when the source_* params are used; when both are given the inline values WIN, so you can say "the theme, but this one in red". A path that does not exist on a given matched widget lands in that widget's ignored[] instead of failing the whole call.
dry_runNoResolve the match and report it without writing anything (default false).
patternNoAlias of `name_pattern` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `name_pattern`.
name_patternNoWildcard on the widget's name (Btn_*, *_Title, or * for every widget). Combined with target_class as AND.
target_classNoClass filter matched with IsA: a curated name (Button, TextBlock), a native class path (/Script/UMG.Button) or a Widget Blueprint asset path. Subclasses match too.
source_bp_pathNoTHEME MODE: /Game path of a Widget Blueprint holding a REFERENCE widget to copy the style from, instead of writing the values inline. This is what makes one widget the single source of truth rather than scattering the same colour across 40 calls.
target_widgetsNoExplicit widget names. When present, target_class and name_pattern are IGNORED and only these are touched (reported in selector_used).
widget_bp_pathYes/Game path of the Widget Blueprint asset
source_widget_nameNoName of the reference widget inside source_bp_path. Required with source_bp_path.
source_property_pathsNoWhich paths to copy off the reference widget, e.g. ["WidgetStyle.Normal.TintColor","WidgetStyle.NormalPadding"]. A path that does not resolve on the REFERENCE is an error, not a silent skip: an incomplete theme that says nothing is worse than a refusal. Use audit_widget_style with the same reference + paths to find what has drifted before fixing it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare destructive=true and idempotent=false, so the safety profile is already carried; the description adds real context by noting the single compile + single save pass, that dry_run resolves the match without writing, and that unmatched paths land in each widget's ignored[] rather than failing the whole call. It does not itself restate the PIE-refusal/force risk (that lives in the schema), leaving a small 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 the core action, then selection, then write/dry-run semantics, then the return shape. It is dense and long, but for a 12-parameter tool most sentences earn their place; the trailing Returns block is justified because no output schema exists.

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, 12-param, nested-object, mutating tool with no output schema, the description covers selection, precedence, theme vs inline values, dry-run, save, and per-widget partial-failure reporting, and even enumerates the return object. Nothing essential to correct invocation is missing.

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 description coverage is 100%, so the baseline is 3, but the description genuinely adds meaning: selector precedence, IsA subclass matching for target_class, preset inline values winning over source_* (theme mode), and the reference-path-as-error behavior for source_property_paths. It goes beyond restating the schema.

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 with scope: 'Apply ONE block of style properties to EVERY widget of a Widget Blueprint that matches a filter.' It explicitly positions itself as the multi-widget companion to set_widget_property's multi-path form, letting an agent distinguish it from siblings without opening a 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?

Spells out selection precedence (target_widgets wins over everything, then target_class AND/OR name_pattern), the requirement that at least one selector be given, and the explicit '*' idiom for every widget. It also names the alternative workflow (audit_widget_style with the same reference + paths for finding drift) and the dry_run check-before-write path.

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