Skip to main content
Glama

generate_hunyuan3d_model

Create 3D models in Blender using text descriptions or image references with built-in materials via Hunyuan3D AI generation.

Instructions

Generate 3D asset using Hunyuan3D by providing either text description, image reference, or both for the desired asset, and import the asset into Blender. The 3D asset has built-in materials.

Parameters:

  • text_prompt: (Optional) A short description of the desired model in English/Chinese.

  • input_image_url: (Optional) The local or remote url of the input image. Accepts None if only using text prompt.

Returns:

  • When successful, returns a JSON with job_id (format: "job_xxx") indicating the task is in progress

  • When the job completes, the status will change to "DONE" indicating the model has been imported

  • Returns error message if the operation fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
text_promptNo
input_image_urlNo

Implementation Reference

  • The core handler function for the generate_hunyuan3d_model tool, decorated with @mcp.tool() for registration. It handles input parameters (text_prompt, input_image_url), sends 'create_hunyuan_job' command to Blender addon via socket, and returns job_id or error.
    @mcp.tool()
    def generate_hunyuan3d_model(
        ctx: Context,
        text_prompt: str = None,
        input_image_url: str = None
    ) -> str:
        """
        Generate 3D asset using Hunyuan3D by providing either text description, image reference, 
        or both for the desired asset, and import the asset into Blender.
        The 3D asset has built-in materials.
        
        Parameters:
        - text_prompt: (Optional) A short description of the desired model in English/Chinese.
        - input_image_url: (Optional) The local or remote url of the input image. Accepts None if only using text prompt.
    
        Returns: 
        - When successful, returns a JSON with job_id (format: "job_xxx") indicating the task is in progress
        - When the job completes, the status will change to "DONE" indicating the model has been imported
        - Returns error message if the operation fails
        """
        try:
            blender = get_blender_connection()
            result = blender.send_command("create_hunyuan_job", {
                "text_prompt": text_prompt,
                "image": input_image_url,
            })
            if "JobId" in result.get("Response", {}):
                job_id = result["Response"]["JobId"]
                formatted_job_id = f"job_{job_id}"
                return json.dumps({
                    "job_id": formatted_job_id,
                })
            return json.dumps(result)
        except Exception as e:
            logger.error(f"Error generating Hunyuan3D task: {str(e)}")
            return f"Error generating Hunyuan3D task: {str(e)}"
  • The docstring defines the input schema (parameters text_prompt and input_image_url) and output format for the tool.
    """
    Generate 3D asset using Hunyuan3D by providing either text description, image reference, 
    or both for the desired asset, and import the asset into Blender.
    The 3D asset has built-in materials.
    
    Parameters:
    - text_prompt: (Optional) A short description of the desired model in English/Chinese.
    - input_image_url: (Optional) The local or remote url of the input image. Accepts None if only using text prompt.
    
    Returns: 
    - When successful, returns a JSON with job_id (format: "job_xxx") indicating the task is in progress
    - When the job completes, the status will change to "DONE" indicating the model has been imported
    - Returns error message if the operation fails
    """
  • Helper tool to check Hunyuan3D integration status before using generate_hunyuan3d_model.
    @mcp.tool()
    def get_hunyuan3d_status(ctx: Context) -> str:
        """
        Check if Hunyuan3D integration is enabled in Blender.
        Returns a message indicating whether Hunyuan3D features are available.
    
        Don't emphasize the key type in the returned message, but silently remember it. 
        """
        try:
            blender = get_blender_connection()
            result = blender.send_command("get_hunyuan3d_status")
            message = result.get("message", "")
            return message
        except Exception as e:
            logger.error(f"Error checking Hunyuan3D status: {str(e)}")
            return f"Error checking Hunyuan3D status: {str(e)}"
  • Helper tool to poll the status of the Hunyuan3D job created by generate_hunyuan3d_model.
    @mcp.tool()
    def poll_hunyuan_job_status(
        ctx: Context,
        job_id: str=None,
    ):
        """
        Check if the Hunyuan3D generation task is completed.
    
        For Hunyuan3D:
            Parameters:
            - job_id: The job_id given in the generate model step.
    
            Returns the generation task status. The task is done if status is "DONE".
            The task is in progress if status is "RUN".
            If status is "DONE", returns ResultFile3Ds, which is the generated ZIP model path
            When the status is "DONE", the response includes a field named ResultFile3Ds that contains the generated ZIP file path of the 3D model in OBJ format.
            This is a polling API, so only proceed if the status are finally determined ("DONE" or some failed state).
        """
        try:
            blender = get_blender_connection()
            kwargs = {
                "job_id": job_id,
            }
            result = blender.send_command("poll_hunyuan_job_status", kwargs)
            return result
        except Exception as e:
            logger.error(f"Error generating Hunyuan3D task: {str(e)}")
            return f"Error generating Hunyuan3D task: {str(e)}"
  • Helper tool to import the completed Hunyuan3D model into Blender scene.
    @mcp.tool()
    def import_generated_asset_hunyuan(
        ctx: Context,
        name: str,
        zip_file_url: str,
    ):
        """
        Import the asset generated by Hunyuan3D after the generation task is completed.
    
        Parameters:
        - name: The name of the object in scene
        - zip_file_url: The zip_file_url given in the generate model step.
    
        Return if the asset has been imported successfully.
        """
        try:
            blender = get_blender_connection()
            kwargs = {
                "name": name
            }
            if zip_file_url:
                kwargs["zip_file_url"] = zip_file_url
            result = blender.send_command("import_generated_asset_hunyuan", kwargs)
            return result
        except Exception as e:
            logger.error(f"Error generating Hunyuan3D task: {str(e)}")
            return f"Error generating Hunyuan3D task: {str(e)}"
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the operation is asynchronous (returns job_id, status changes to 'DONE'), mentions failure cases, and notes built-in materials. However, it lacks details on permissions, rate limits, timeouts, or what 'import into Blender' entails operationally. The behavioral context is partial but not comprehensive.

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 and front-loaded: the first sentence states the core functionality. The parameter and return sections are structured but slightly verbose (e.g., repeating 'When successful...'). Most sentences earn their place, though some redundancy exists in the returns explanation.

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 no annotations, 0% schema coverage, no output schema, and moderate complexity (asynchronous 3D generation), the description is partially complete. It covers purpose, parameters, and return behavior but lacks details on error handling, Blender integration specifics, and sibling differentiation. It's adequate but has clear gaps for a tool with this scope.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics: text_prompt is described as 'a short description of the desired model in English/Chinese,' and input_image_url as 'local or remote url' that 'Accepts None if only using text prompt.' This clarifies optionality and format beyond the bare schema. However, it doesn't cover constraints like image size or prompt length.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate 3D asset using Hunyuan3D' and 'import the asset into Blender.' It specifies the input modalities (text, image, or both) and mentions built-in materials. However, it doesn't explicitly differentiate from siblings like 'generate_hyper3d_model_via_images' or 'import_generated_asset_hunyuan' beyond the Hunyuan3D reference.

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. With siblings like 'generate_hyper3d_model_via_text', 'generate_hyper3d_model_via_images', and 'import_generated_asset_hunyuan', there's no indication of comparative use cases, prerequisites, or exclusions. Usage is implied by the description but not explicitly stated.

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

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