Skip to main content
Glama

render_widget_preview

Destructive

Render a Widget Blueprint to a PNG on disk without running the game, giving a design-time UMG preview to check styling before PIE.

Instructions

Render a Widget Blueprint to a PNG on disk WITHOUT running the game: builds the widget with the editor's own designer flags, draws it through FWidgetRenderer into a render target and writes the file. This is what turns "does this style look right?" from a PIE session someone has to watch into a static read plus one image to LOOK at. HONEST SCOPE: it is a DESIGN preview, the same thing the UMG Designer shows -- not the live HUD. Anything that only exists while the game runs (text filled in NativeConstruct, property bindings, ViewModel data, anything behind an IsDesignTime() guard) renders at its default/empty value. Use read_pie_widgets or capture_pie_screenshot for the running session. Returns rendered:false with a reason (never a blank image) when the editor has no RHI (-nullrhi/headless), because FWidgetRenderer cannot draw there.

Returns: { widget_bp_path: string, rendered: bool, file_path: string, width: int, height: int, scale: number, drew_at_desired_size: bool, byte_size: int, designer_flags: string, preview_note: string, error?: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scaleNoOptional draw scale applied by the renderer (default 1.0), the equivalent of DPI scaling in the Designer.
widthNoOptional render width in pixels. Omit BOTH width and height to render at the widget's own desired size (a Slate prepass measures it).
heightNoOptional render height in pixels. Omit BOTH width and height to render at the widget's own desired size.
output_pathNoOptional output file. A bare name lands under <ProjectSaved>/MCP/WidgetPreviews/, an absolute path is used verbatim, and .png is appended when missing. Defaults to the asset's name.
blueprint_nameNoAlias of `widget_bp_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `widget_bp_path`.
widget_bp_pathNo/Game path of the Widget Blueprint asset to render
opaque_backgroundNoOptional (default false). Force every pixel's alpha to 255 so the PNG is not transparent where the widget did not paint -- the same trick capture_viewport uses. Leave false to keep real transparency.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare the mutation/safety profile (readOnly false, destructive true, not idempotent). The description adds genuinely non-obvious behavior: the design-time scope limitation, the specific things that render empty (NativeConstruct text, property bindings, ViewModel data, IsDesignTime guards), and the headless -nullrhi failure mode returning rendered:false with a reason rather than a blank image.

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?

Purpose and mechanism are front-loaded, and the Returns block is warranted because there is no output schema. It runs slightly long with rhetorical framing ('This is what turns ... into a static read plus one image to LOOK at'), but every sentence still carries actionable information.

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 full return shape and the failure contract, covers the editor-RHI prerequisite, and scopes the tool correctly against runtime preview siblings. Nothing an agent needs to select or 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 description coverage is 100%, so all seven parameters including the width/height desired-size behavior and output_path rules are already documented in the schema. The description adds no parameter-level syntax beyond what the schema provides, 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?

The description states a specific verb and resource (render a Widget Blueprint to a PNG on disk), explains the mechanism (designer flags, FWidgetRenderer, render target), and explicitly distinguishes it from running the game. The added contrast with 'the live HUD' and named siblings read_pie_widgets / capture_pie_screenshot makes it clearly separable from neighbors.

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?

It gives explicit when-to-use ('does this style look right?' as a static read plus one image), explicit when-not (not the live HUD; anything that only exists at runtime renders at default), and names the alternatives for the running session. The alternative routing is unambiguous.

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