Skip to main content
Glama

get_scene_info

Retrieve detailed information about the current Blender scene, including objects, materials, and settings for AI-assisted 3D modeling workflows.

Instructions

Get detailed information about the current Blender scene

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'get_scene_info' MCP tool. It is decorated with @mcp.tool() for registration, uses get_blender_connection() to communicate with Blender via send_command('get_scene_info'), and returns the scene information as formatted JSON or an error message. The docstring provides the tool description serving as schema.
    @mcp.tool() def get_scene_info(ctx: Context) -> str: """Get detailed information about the current Blender scene""" try: blender = get_blender_connection() result = blender.send_command("get_scene_info") # Just return the JSON representation of what Blender sent us return json.dumps(result, indent=2) except Exception as e: logger.error(f"Error getting scene info from Blender: {str(e)}") return f"Error getting scene info: {str(e)}"
  • Usage instruction in the asset_creation_strategy prompt that recommends calling get_scene_info() first to check the current scene state.
    0. Before anything, always check the scene from get_scene_info()
  • Helper function get_blender_connection() used by the tool handler to obtain a connection to the Blender server.
    def get_blender_connection(): """Get or create a persistent Blender connection""" global _blender_connection, _polyhaven_enabled # Add _polyhaven_enabled to globals # If we have an existing connection, check if it's still valid if _blender_connection is not None: try: # First check if PolyHaven is enabled by sending a ping command result = _blender_connection.send_command("get_polyhaven_status") # Store the PolyHaven status globally _polyhaven_enabled = result.get("enabled", False) return _blender_connection except Exception as e: # Connection is dead, close it and create a new one logger.warning(f"Existing connection is no longer valid: {str(e)}") try: _blender_connection.disconnect() except: pass _blender_connection = None # Create a new connection if needed if _blender_connection is None: host = os.getenv("BLENDER_HOST", DEFAULT_HOST) port = int(os.getenv("BLENDER_PORT", DEFAULT_PORT)) _blender_connection = BlenderConnection(host=host, port=port) if not _blender_connection.connect(): logger.error("Failed to connect to Blender") _blender_connection = None raise Exception("Could not connect to Blender. Make sure the Blender addon is running.") logger.info("Created new persistent connection to Blender")

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/drrodingo-del/BlenderMCP'

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