Skip to main content
Glama

editor_get_map_info

Retrieve detailed information about the current Unreal Engine map, including actor counts, lighting data, and level structure for development analysis.

Instructions

Get detailed information about the current map/level

Example output: {'map_name': 'TestMap', 'map_path': '/Game/Maps/TestMap', 'total_actors': 45, 'actor_types': {'StaticMeshActor': 20, 'DirectionalLight': 1, 'PlayerStart': 1}, 'lighting': {'has_lightmass_importance_volume': false, 'directional_lights': 1, 'point_lights': 3, 'spot_lights': 0}, 'streaming_levels': 0, 'streaming_level_names': []}

Returns current level information with actor counts and lighting details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The Python script implementing the core tool logic: retrieves current map info including name, path, actor counts by type, lighting details, and streaming levels using Unreal Engine Python API, outputs JSON.
    from typing import Dict, Any
    import unreal
    import json
    
    
    def get_map_info() -> Dict[str, Any]:
        world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()
        if not world:
            return {"error": "No world loaded"}
    
        map_info = {}
        map_info["map_name"] = world.get_name()
        map_info["map_path"] = world.get_path_name()
    
        all_actors = unreal.get_editor_subsystem(
            unreal.EditorActorSubsystem
        ).get_all_level_actors()
        map_info["total_actors"] = len(all_actors)
    
        actor_types = {}
        for actor in all_actors:
            actor_class = actor.get_class().get_name()
            actor_types[actor_class] = actor_types.get(actor_class, 0) + 1
    
        map_info["actor_types"] = dict(
            sorted(actor_types.items(), key=lambda x: x[1], reverse=True)[:15]
        )
    
        lighting_info = {}
        lighting_info["has_lightmass_importance_volume"] = any(
            actor.get_class().get_name() == "LightmassImportanceVolume"
            for actor in all_actors
        )
        lighting_info["directional_lights"] = sum(
            1 for actor in all_actors if actor.get_class().get_name() == "DirectionalLight"
        )
        lighting_info["point_lights"] = sum(
            1 for actor in all_actors if actor.get_class().get_name() == "PointLight"
        )
        lighting_info["spot_lights"] = sum(
            1 for actor in all_actors if actor.get_class().get_name() == "SpotLight"
        )
    
        map_info["lighting"] = lighting_info
    
        try:
            streaming_levels = unreal.EditorLevelLibrary.get_all_level_actors_of_class(
                unreal.LevelStreamingDynamic
            )
            map_info["streaming_levels"] = len(streaming_levels)
            map_info["streaming_level_names"] = [
                level.get_name() for level in streaming_levels
            ]
        except Exception:
            map_info["streaming_levels"] = 0
            map_info["streaming_level_names"] = []
    
        return map_info
    
    
    def main():
        map_data = get_map_info()
        print(json.dumps(map_data, indent=2))
    
    
    if __name__ == "__main__":
        main()
  • Registers the 'editor_get_map_info' tool with the MCP server: defines name, description, empty input schema, and thin handler that executes the generated Python command via tryRunCommand.
    server.tool(
    	"editor_get_map_info",
    	"Get detailed information about the current map/level\n\nExample output: {'map_name': 'TestMap', 'map_path': '/Game/Maps/TestMap', 'total_actors': 45, 'actor_types': {'StaticMeshActor': 20, 'DirectionalLight': 1, 'PlayerStart': 1}, 'lighting': {'has_lightmass_importance_volume': false, 'directional_lights': 1, 'point_lights': 3, 'spot_lights': 0}, 'streaming_levels': 0, 'streaming_level_names': []}\n\nReturns current level information with actor counts and lighting details.",
    	{},
    	async () => {
    		const result = await tryRunCommand(editorTools.UEGetMapInfo())
    		return {
    			content: [
    				{
    					type: "text",
    					text: result,
    				},
    			],
    		}
    	},
    )
  • Helper function that reads and templates the ue_get_map_info.py script (no params needed), generating the Python code string to be executed by the handler.
    export const UEGetMapInfo = () => Template(read("./scripts/ue_get_map_info.py"))
  • Input schema: empty object, no parameters required.
    "Get detailed information about the current map/level\n\nExample output: {'map_name': 'TestMap', 'map_path': '/Game/Maps/TestMap', 'total_actors': 45, 'actor_types': {'StaticMeshActor': 20, 'DirectionalLight': 1, 'PlayerStart': 1}, 'lighting': {'has_lightmass_importance_volume': false, 'directional_lights': 1, 'point_lights': 3, 'spot_lights': 0}, 'streaming_levels': 0, 'streaming_level_names': []}\n\nReturns current level information with actor counts and lighting details.",
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool returns current level information with actor counts and lighting details, which is useful behavioral context. However, it lacks details on potential side effects, error conditions, or performance characteristics (e.g., if it's read-only or has any limitations). The description does not contradict any annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded, starting with the core purpose followed by an example output and a summary sentence. Every sentence adds value: the first defines the tool, the example illustrates output format, and the last reinforces key details. There is no wasted text.

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?

Given the tool's complexity (simple read operation with no parameters), no annotations, and no output schema, the description is reasonably complete. It explains what information is returned (map name, actor counts, lighting details) and provides an example output. However, it could be more complete by explicitly stating it's a read-only operation or mentioning any dependencies, but the lack of output schema is mitigated by the detailed example.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the output. This meets the baseline for tools with no parameters, as it avoids unnecessary repetition.

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 clearly states the tool's purpose with a specific verb ('Get detailed information') and resource ('about the current map/level'), and distinguishes it from siblings like editor_get_asset_info or editor_get_world_outliner by focusing on map-level details such as actor counts and lighting. The example output reinforces this specificity.

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

Usage Guidelines3/5

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

The description implies usage when map information is needed, but does not explicitly state when to use this tool versus alternatives like editor_get_world_outliner (which might list actors) or editor_project_info (which provides project-level details). No exclusions or prerequisites are mentioned, leaving usage context somewhat open-ended.

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