Skip to main content
Glama

download_polyhaven_asset

Download Polyhaven assets like HDRIs, textures, or 3D models directly into Blender for use in 3D projects.

Instructions

Download and import a Polyhaven asset into Blender.

Parameters:
- asset_id: The ID of the asset to download
- asset_type: The type of asset (hdris, textures, models)
- resolution: The resolution to download (e.g., 1k, 2k, 4k)
- file_format: Optional file format (e.g., hdr, exr for HDRIs; jpg, png for textures; gltf, fbx for models)

Returns a message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_idYes
asset_typeYes
resolutionNo1k
file_formatNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'download_polyhaven_asset' tool. Decorated with @mcp.tool(), it defines the input schema via parameters, proxies the request to Blender's internal command, and formats the response with type-specific messages.
    @mcp.tool()
    def download_polyhaven_asset(
        ctx: Context,
        asset_id: str,
        asset_type: str,
        resolution: str = "1k",
        file_format: str = None,
    ) -> str:
        """
        Download and import a Polyhaven asset into Blender.
    
        Parameters:
        - asset_id: The ID of the asset to download
        - asset_type: The type of asset (hdris, textures, models)
        - resolution: The resolution to download (e.g., 1k, 2k, 4k)
        - file_format: Optional file format (e.g., hdr, exr for HDRIs; jpg, png for textures; gltf, fbx for models)
    
        Returns a message indicating success or failure.
        """
        try:
            blender = get_blender_connection()
            result = blender.send_command(
                "download_polyhaven_asset",
                {
                    "asset_id": asset_id,
                    "asset_type": asset_type,
                    "resolution": resolution,
                    "file_format": file_format,
                },
            )
    
            if "error" in result:
                return f"Error: {result['error']}"
    
            if result.get("success"):
                message = result.get(
                    "message", "Asset downloaded and imported successfully"
                )
    
                # Add additional information based on asset type
                if asset_type == "hdris":
                    return f"{message}. The HDRI has been set as the world environment."
                elif asset_type == "textures":
                    material_name = result.get("material", "")
                    maps = ", ".join(result.get("maps", []))
                    return (
                        f"{message}. Created material '{material_name}' with maps: {maps}."
                    )
                elif asset_type == "models":
                    return f"{message}. The model has been imported into the current scene."
                else:
                    return message
            else:
                return f"Failed to download asset: {result.get('message', 'Unknown error')}"
        except Exception as e:
            logger.error(f"Error downloading Polyhaven asset: {str(e)}")
            return f"Error downloading Polyhaven asset: {str(e)}"
  • Input schema defined by the function parameters: asset_id (str), asset_type (str), resolution (str, default '1k'), file_format (str, optional).
    def download_polyhaven_asset(
        ctx: Context,
        asset_id: str,
        asset_type: str,
        resolution: str = "1k",
        file_format: str = None,
    ) -> str:
  • src/server.py:560-560 (registration)
    The @mcp.tool() decorator registers the function as an MCP tool, using the function name as the tool name.
    @mcp.tool()
  • A prompt template that guides the AI on when and how to use the download_polyhaven_asset tool for different asset types.
    @mcp.prompt()
    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
        """
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 mentions the operation (download and import) and return value (success/failure message), but doesn't cover important behavioral aspects like whether this requires internet connectivity, what happens if the asset already exists, potential file size implications, or any rate limits. For a tool with no annotation coverage, this leaves significant gaps.

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 perfectly structured and concise. It starts with a clear purpose statement, then provides a bulleted list of parameters with helpful explanations, and ends with return value information. Every sentence earns its place with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 4 parameters with excellent description coverage, and no annotations, the description is quite complete. It explains what the tool does, all parameters meaningfully, and mentions the return type. The main gap is insufficient behavioral context for a download/import operation with no annotation coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides excellent parameter semantics beyond the 0% schema description coverage. It clearly explains each parameter's purpose: asset_id identifies the specific asset, asset_type categorizes it, resolution specifies download quality, and file_format offers format options with examples for each asset type. This fully compensates for the lack of schema descriptions.

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 ('Download and import'), the target resource ('Polyhaven asset'), and the destination environment ('into Blender'). It distinguishes this tool from siblings like search_polyhaven_assets or import_tripo_glb_model by specifying the download+import operation for Polyhaven assets specifically.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to obtain Polyhaven assets for Blender, but doesn't explicitly state when to use this versus alternatives like import_tripo_glb_model or when not to use it (e.g., for non-Polyhaven assets). It provides some context but lacks explicit guidance on alternatives or prerequisites.

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/VAST-AI-Research/tripo-mcp'

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