Skip to main content
Glama

editor_take_screenshot

Capture the current Unreal Editor view as a base64-encoded PNG image for documentation or debugging purposes.

Instructions

Take a screenshot of the Unreal Editor

Example output: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

Returns a base64-encoded PNG image of the current editor view. IF THIS ERRORS OUT MAKE SURE THE UNREAL ENGINE WINDOW IS FOCUSED

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'editor_take_screenshot' MCP tool, including inline handler that executes a Python script via remote Unreal Engine execution, processes the screenshot file to base64 image, schema (empty input).
    server.tool(
    	"editor_take_screenshot",
    	"Take a screenshot of the Unreal Editor\n\nExample output: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\n\nReturns a base64-encoded PNG image of the current editor view. IF THIS ERRORS OUT MAKE SURE THE UNREAL ENGINE WINDOW IS FOCUSED",
    	{},
    	async () => {
    		const result = await tryRunCommand(editorTools.UETakeScreenshot())
    
    		const filePath = result.trim()
    		const fullPath = path.resolve(filePath)
    		await new Promise((resolve) => setTimeout(resolve, 3000))
    		if (fs.existsSync(fullPath)) {
    			const base64Data = fs.readFileSync(fullPath, { encoding: "base64" })
    			fs.unlinkSync(fullPath)
    			if (base64Data) {
    				return {
    					content: [
    						{
    							type: "image",
    							data: base64Data,
    							mimeType: "image/png",
    						},
    					],
    				}
    			}
    		}
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: result || "Failed to take screenshot. Is the Unreal Engine window focused?",
    				},
    			],
    		}
    	},
    )
  • Helper function that generates the Python command by reading and templating (no params) the ue_take_screenshot.py script.
    export const UETakeScreenshot = () => Template(read("./scripts/ue_take_screenshot.py"))
  • Python script executed in Unreal Editor: captures high-res screenshot (640x520) using AutomationLibrary, saves to temp PNG file, prints the file path for the TS handler to read.
    import unreal
    import os
    from pathlib import Path
    import tempfile
    
    
    def take_screenshot() -> str:
        try:
            with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_file:
                screenshot_path = temp_file.name
    
                unreal.AutomationLibrary.take_high_res_screenshot(640, 520, screenshot_path)
    
                return screenshot_path
    
            return ""
    
        except Exception:
            return ""
    
    
    def main():
        path = take_screenshot()
        if path:
            print(path)
        else:
            print("Failed to take screenshot")
    
    
    if __name__ == "__main__":
        main()
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 describes the return format (base64-encoded PNG) and mentions a specific error condition (window focus requirement), which adds useful context beyond basic functionality. However, it doesn't address other potential behavioral aspects like performance characteristics, memory usage, or what happens if the editor isn't running.

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 three sentences: one stating the purpose, one showing example output, and one providing error guidance. Each sentence adds value, though the example output could be slightly truncated for better readability. The structure is front-loaded with the core functionality.

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?

For a zero-parameter tool with no annotations and no output schema, the description provides adequate coverage of what the tool does and what it returns. However, it could be more complete by mentioning whether this captures the entire editor window or just the active viewport, and what resolution/quality settings apply.

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 tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on output format and error conditions.

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 specific action ('Take a screenshot') and target resource ('of the Unreal Editor'), distinguishing it from sibling tools that perform different operations like creating objects or running commands. The verb+resource combination is precise and unambiguous.

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. While it mentions a specific error scenario (ensuring the Unreal Engine window is focused), it doesn't explain when this tool is appropriate compared to other screenshot or visualization tools that might exist in the broader context.

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