Skip to main content
Glama
Eminemminem

BlenderMCP

by Eminemminem

get_viewport_screenshot

Capture screenshots from Blender's 3D viewport to document progress, share visual feedback, or create reference images for 3D modeling workflows.

Instructions

Capture a screenshot of the current Blender 3D viewport.

Parameters:

  • max_size: Maximum size in pixels for the largest dimension (default: 800)

Returns the screenshot as an Image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_sizeNo

Implementation Reference

  • The primary handler for the 'get_viewport_screenshot' tool. It uses the @mcp.tool() decorator for automatic registration in FastMCP. The function sends a command to the Blender addon via socket to capture the viewport screenshot, saves it to a temporary PNG file, reads the bytes, cleans up the file, and returns an MCP Image object. The input schema is defined by the function signature (ctx: Context, max_size: int = 800) and docstring.
    @mcp.tool()
    def get_viewport_screenshot(ctx: Context, max_size: int = 800) -> Image:
        """
        Capture a screenshot of the current Blender 3D viewport.
        
        Parameters:
        - max_size: Maximum size in pixels for the largest dimension (default: 800)
        
        Returns the screenshot as an Image.
        """
        try:
            blender = get_blender_connection()
            
            # Create temp file path
            temp_dir = tempfile.gettempdir()
            temp_path = os.path.join(temp_dir, f"blender_screenshot_{os.getpid()}.png")
            
            result = blender.send_command("get_viewport_screenshot", {
                "max_size": max_size,
                "filepath": temp_path,
                "format": "png"
            })
            
            if "error" in result:
                raise Exception(result["error"])
            
            if not os.path.exists(temp_path):
                raise Exception("Screenshot file was not created")
            
            # Read the file
            with open(temp_path, 'rb') as f:
                image_bytes = f.read()
            
            # Delete the temp file
            os.remove(temp_path)
            
            return Image(data=image_bytes, format="png")
            
        except Exception as e:
            logger.error(f"Error capturing screenshot: {str(e)}")
            raise Exception(f"Screenshot failed: {str(e)}")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool captures a screenshot and returns it as an Image, but doesn't mention permissions needed, whether it's read-only/destructive, rate limits, error conditions, or what happens if viewport is empty/invalid. For a tool with zero annotation coverage, this is insufficient.

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 front-loaded with the core purpose, followed by a clear parameter section and return statement. Every sentence earns its place with no wasted words, making it efficient and well-structured.

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 tool's moderate complexity (capturing a screenshot with one parameter), no annotations, and no output schema, the description is minimally adequate but has gaps. It explains what the tool does and the parameter, but lacks behavioral context, error handling, and detailed return format beyond 'Image'.

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 description adds meaningful context for the single parameter 'max_size' by explaining it's 'Maximum size in pixels for the largest dimension' and providing the default value (800), which compensates for the 0% schema description coverage. However, it doesn't specify valid ranges or units beyond 'pixels'.

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 ('Capture a screenshot') and target resource ('current Blender 3D viewport'), distinguishing it from all sibling tools which involve downloading assets, executing code, getting status/info, or importing/setting assets. No tautology or vagueness present.

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, prerequisites, or exclusions. It doesn't mention if this requires a specific Blender context or viewport state, nor does it differentiate from potential similar screenshot tools (though none appear in siblings).

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/Eminemminem/blender-mcp'

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