download_sketchfab_model
Download and import a Sketchfab model into Blender using its unique identifier (UID). Ensure the model is downloadable and proper access rights are granted for successful operation.
Instructions
Download and import a Sketchfab model by its UID.
Parameters:
uid: The unique identifier of the Sketchfab model
Returns a message indicating success or failure. The model must be downloadable and you must have proper access rights.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes |
Implementation Reference
- src/blender_mcp/server.py:680-723 (handler)The handler function for the MCP tool 'download_sketchfab_model', decorated with @telemetry_tool and @mcp.tool(). It accepts a 'uid' parameter, sends a 'download_sketchfab_model' command to the Blender addon via socket connection, and returns success message with imported objects or error.@telemetry_tool("download_sketchfab_model") @mcp.tool() def download_sketchfab_model( ctx: Context, uid: str ) -> str: """ Download and import a Sketchfab model by its UID. Parameters: - uid: The unique identifier of the Sketchfab model Returns a message indicating success or failure. The model must be downloadable and you must have proper access rights. """ try: blender = get_blender_connection() logger.info(f"Attempting to download Sketchfab model with UID: {uid}") result = blender.send_command("download_sketchfab_model", { "uid": uid }) if result is None: logger.error("Received None result from Sketchfab download") return "Error: Received no response from Sketchfab download request" if "error" in result: logger.error(f"Error from Sketchfab download: {result['error']}") return f"Error: {result['error']}" if result.get("success"): imported_objects = result.get("imported_objects", []) object_names = ", ".join(imported_objects) if imported_objects else "none" return f"Successfully imported model. Created objects: {object_names}" else: return f"Failed to download model: {result.get('message', 'Unknown error')}" except Exception as e: logger.error(f"Error downloading Sketchfab model: {str(e)}") import traceback logger.error(traceback.format_exc()) return f"Error downloading Sketchfab model: {str(e)}"
- src/blender_mcp/server.py:681-681 (registration)The @mcp.tool() decorator registers the download_sketchfab_model function as an MCP tool.@mcp.tool()
- src/blender_mcp/server.py:1035-1035 (helper)Documentation in the asset_creation_strategy prompt explaining usage of download_sketchfab_model after searching Sketchfab models.- Then download specific models using download_sketchfab_model() with the UID
- src/blender_mcp/server.py:686-694 (schema)Docstring defining the tool's input parameter 'uid: str' and usage instructions for schema inference.""" Download and import a Sketchfab model by its UID. Parameters: - uid: The unique identifier of the Sketchfab model Returns a message indicating success or failure. The model must be downloadable and you must have proper access rights. """