unreal_execute_python
Execute arbitrary Python code inside the Unreal Editor to perform custom operations, access the full Unreal Python API, and handle tasks not covered by dedicated tools.
Instructions
Run arbitrary Python inside the running Unreal Editor.
This is the general-purpose escape hatch for anything the dedicated tools do not cover. Prefer a specific tool when one exists, because those return structured data while this returns raw console output.
The code runs in the editor's own interpreter with full access to the
unreal module, so it can modify or delete project content. It is not
sandboxed.
Args: params (ExecuteInput): Validated input containing: - code (str): Python source to run - evaluate (bool): True for single-expression evaluation (default False)
Returns: str: JSON with the following schema: { "success": bool, # False if Unreal reported the command as failed "result": str, # Value for evaluate=True, else Unreal's status string "output": str # Everything the script printed / logged } On failure: "Error: "
Examples: - Use when: "how many static meshes are in /Game/Props?" -> code that counts them and prints the number - Use when: calling an unreal API no other tool exposes - Don't use when: listing actors or assets (use unreal_list_actors / unreal_list_assets, which paginate and return structured fields)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |