get_polyhaven_status
Check if PolyHaven integration is enabled in Blender to determine availability of PolyHaven features for 3D asset generation.
Instructions
Check if PolyHaven integration is enabled in Blender. Returns a message indicating whether PolyHaven features are available.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:675-691 (handler)The primary handler for the 'get_polyhaven_status' MCP tool. Decorated with @mcp.tool() for registration. It queries the Blender addon socket connection to retrieve the PolyHaven integration status and returns the corresponding message.@mcp.tool() def get_polyhaven_status(ctx: Context) -> str: """ Check if PolyHaven integration is enabled in Blender. Returns a message indicating whether PolyHaven features are available. """ try: blender = get_blender_connection() result = blender.send_command("get_polyhaven_status") enabled = result.get("enabled", False) message = result.get("message", "") return message except Exception as e: logger.error(f"Error checking PolyHaven status: {str(e)}") return f"Error checking PolyHaven status: {str(e)}"
- src/server.py:694-716 (helper)The asset_creation_strategy prompt template that instructs usage of get_polyhaven_status() as the first step to check PolyHaven availability before proceeding with asset creation tools.def asset_creation_strategy() -> str: """Defines the preferred strategy for creating assets in Blender""" return """When creating 3D content in Blender, always start by checking if PolyHaven is available: 0. Before anything, always check the scene from get_scene_info() 1. First use get_polyhaven_status() to verify if PolyHaven integration is enabled. 2. If PolyHaven is enabled: - For objects/models: Use download_polyhaven_asset() with asset_type="models" - For materials/textures: Use download_polyhaven_asset() with asset_type="textures" - For environment lighting: Use download_polyhaven_asset() with asset_type="hdris" 3. If PolyHaven is disabled or when falling back to basic tools: - create_object() for basic primitives (CUBE, SPHERE, CYLINDER, etc.) - set_material() for basic colors and materials Only fall back to basic creation tools when: - PolyHaven is disabled - A simple primitive is explicitly requested - No suitable PolyHaven asset exists - The task specifically requires a basic material/color """
- src/server.py:256-260 (helper)In get_blender_connection(), a call to Blender's get_polyhaven_status command (note: not the MCP tool) to update the global _polyhaven_enabled flag for internal use by other tools._tripo_apikey = result.get("api_key", "") result = _blender_connection.send_command("get_polyhaven_status") # Store the PolyHaven status globally _polyhaven_enabled = result.get("enabled", False)
- src/server.py:675-675 (registration)The @mcp.tool() decorator registers the get_polyhaven_status function as an MCP tool.@mcp.tool()