Skip to main content
Glama

ue_exec_transact

Run a Python snippet inside a single undoable Unreal Editor transaction, consolidating multiple edits into one undo step and rolling back all changes if the script fails.

Instructions

Run a Python snippet inside a named ScopedEditorTransaction.

Wraps the code in an Unreal transaction so that the entire operation appears as ONE undo step in the UE5 editor. If the code raises an exception, the transaction is cancelled and the editor state is rolled back to its pre-transaction position.

This is the PREFERRED way to run any mutating Unreal Python:

  • Blueprint modifications

  • Asset property changes

  • Component additions

  • Material edits

Your code should populate _result{}, _warnings[], _errors[] as needed (same contract as ue_exec_safe).

Args: code: Python snippet to execute inside the transaction transaction_name: Name shown in the UE5 Edit menu under Undo History

Returns: JSON string with StructuredResult.

KB: see knowledge_base/32_AGENT_PLAYABLE_SLICE_RECIPE.md#overview Example: ue_exec_transact(code="Example")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
transaction_nameNoMCP Operation

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It explains transaction semantics clearly: the operation appears as one undo step, exceptions cancel the transaction and roll back editor state, and the code should populate _result{}, _warnings[], and _errors[]. This is substantial, though it stops short of discussing permissions, limitations, or side-effect warnings.

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?

The description is organized into clear sections: summary, behavior, preferred usage, args, returns, KB reference, and example. It is slightly long but each section serves a purpose, and the key transaction behavior is front-loaded.

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?

For a tool that executes arbitrary Python in a transaction, the description covers the critical aspects: what the transaction does, rollback behavior, expected output contract, parameter semantics, and a KB pointer. It does not fully detail the StructuredResult shape, but the presence of an output schema reduces that burden.

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 0%, so the description must compensate, and it does. Both parameters are described in the Args section: 'code' is the Python snippet and 'transaction_name' is the name shown in the UE5 Edit menu Undo History. The description also adds the result contract, giving meaning beyond the bare 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?

The description opens with a specific verb and resource: 'Run a Python snippet inside a named ScopedEditorTransaction.' It clearly explains that code is wrapped in an Unreal transaction and also differentiates the tool from siblings by stating it is the preferred way to run mutating Unreal Python.

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?

The description gives explicit when-to-use guidance: it is the preferred tool for any mutating Unreal Python, with concrete examples like Blueprint modifications and asset property changes. It does not explicitly name when-not-to-use or point to ue_exec_safe as the non-transactional alternative, but the context is strong.

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