Skip to main content
Glama

editor_delete_object

Remove objects or actors from the Unreal Engine world. Specify actor names to delete and receive confirmation with deletion details.

Instructions

Delete an object/actor from the world

Example output: {'success': true, 'message': 'Successfully deleted actor: MyCube', 'deleted_actor': {'actor_name': 'StaticMeshActor_1', 'actor_label': 'MyCube', 'class': 'StaticMeshActor', 'location': {'x': 100.0, 'y': 200.0, 'z': 0.0}}}

Returns deletion confirmation with details of the deleted actor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actor_namesYes

Implementation Reference

  • Core handler implementation in Python that finds actors by name or label in the current world and deletes them using Unreal EditorActorSubsystem. Supports single or multiple actors.
    from typing import Dict, Any, List
    import unreal
    import json
    
    
    def delete_object(actor_name: str) -> Dict[str, Any]:
        try:
            world = unreal.get_editor_subsystem(
                unreal.UnrealEditorSubsystem
            ).get_editor_world()
            if not world:
                return {"error": "No world loaded"}
    
            all_actors = unreal.get_editor_subsystem(
                unreal.EditorActorSubsystem
            ).get_all_level_actors()
            target_actor = None
    
            for actor in all_actors:
                if actor.get_name() == actor_name or actor.get_actor_label() == actor_name:
                    target_actor = actor
                    break
    
            if not target_actor:
                return {"error": f"Actor not found: {actor_name}"}
    
            actor_info = {
                "actor_name": target_actor.get_name(),
                "actor_label": target_actor.get_actor_label(),
                "class": target_actor.get_class().get_name(),
                "location": {
                    "x": target_actor.get_actor_location().x,
                    "y": target_actor.get_actor_location().y,
                    "z": target_actor.get_actor_location().z,
                },
            }
    
            success = unreal.get_editor_subsystem(
                unreal.EditorActorSubsystem
            ).destroy_actor(target_actor)
    
            if success:
                return {
                    "success": True,
                    "message": f"Successfully deleted actor: {actor_name}",
                    "deleted_actor": actor_info,
                }
            else:
                return {"error": f"Failed to delete actor: {actor_name}"}
    
        except Exception as e:
            return {"error": f"Failed to delete object: {str(e)}"}
    
    
    def delete_multiple_objects(actor_names: List[str]) -> Dict[str, Any]:
        try:
            results = []
            for actor_name in actor_names:
                result = delete_object(actor_name)
                results.append(result)
    
            return {
                "success": True,
                "total_requested": len(actor_names),
                "results": results,
            }
    
        except Exception as e:
            return {"error": f"Failed to delete multiple objects: {str(e)}"}
    
    
    def main():
        actor_names_input = "${actor_names}"
    
        try:
            import ast
    
            actor_names = ast.literal_eval(actor_names_input)
            if isinstance(actor_names, list):
                result = delete_multiple_objects(actor_names)
            else:
                result = delete_object(str(actor_names))
        except Exception:
            result = delete_object(actor_names_input)
    
        print(json.dumps(result, indent=2))
    
    
    if __name__ == "__main__":
        main()
  • MCP tool registration for 'editor_delete_object', including schema (actor_names: z.string()) and thin wrapper handler that executes the templated Python command.
    server.tool(
    	"editor_delete_object",
    	"Delete an object/actor from the world\n\nExample output: {'success': true, 'message': 'Successfully deleted actor: MyCube', 'deleted_actor': {'actor_name': 'StaticMeshActor_1', 'actor_label': 'MyCube', 'class': 'StaticMeshActor', 'location': {'x': 100.0, 'y': 200.0, 'z': 0.0}}}\n\nReturns deletion confirmation with details of the deleted actor.",
    	{
    		actor_names: z.string(),
    	},
    	async ({ actor_names }) => {
    		const result = await tryRunCommand(editorTools.UEDeleteObject(actor_names))
    		return {
    			content: [
    				{
    					type: "text",
    					text: result,
    				},
    			],
    		}
    	},
    )
  • Helper that loads and templates the ue_delete_object.py script with the actor_names parameter for execution.
    export const UEDeleteObject = (actor_names: string) =>
    	Template(read("./scripts/ue_delete_object.py"), {
    		actor_names,
    	})
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a destructive operation ('Delete'), which is essential. It also describes the output format with an example, adding valuable context. However, it lacks details on permissions, error conditions, or side effects (e.g., whether deletion is permanent or reversible).

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 appropriately sized with two sentences: one stating the purpose and one detailing the output. The example output is included but could be more concise. It's front-loaded with the core action, though the output details might be better summarized rather than fully quoted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (destructive operation with 1 parameter, no annotations, no output schema), the description is moderately complete. It covers the basic action and output format but misses key details like parameter semantics, error handling, and usage context. For a deletion tool, this leaves significant gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate. It mentions 'actor_names' implicitly in the example output but doesn't explain what this parameter expects (e.g., a single actor name vs. multiple, format requirements). The description adds minimal semantic value beyond what's inferred from the tool name and example.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Delete') and resource ('an object/actor from the world'), making it immediately understandable. It distinguishes from siblings like 'editor_create_object' and 'editor_update_object' by specifying deletion rather than creation or modification. However, it doesn't explicitly differentiate from potential destructive siblings beyond the obvious verb contrast.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing actor), exclusions (e.g., what cannot be deleted), or comparisons to other destructive operations among siblings. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/runreal/unreal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server