Skip to main content
Glama

get_polyhaven_categories

Retrieve available categories for Poly Haven assets to filter and organize 3D resources in Blender, supporting HDRI, textures, and models.

Instructions

Get a list of categories for a specific asset type on Polyhaven.

Parameters:

  • asset_type: The type of asset to get categories for (hdris, textures, models, all)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_typeNohdris

Implementation Reference

  • The handler function for the 'get_polyhaven_categories' tool. It checks if PolyHaven is enabled, sends the command to the Blender addon via the connection, receives the result, formats the categories by sorting by count, and returns a readable string list.
    @mcp.tool()
    def get_polyhaven_categories(ctx: Context, asset_type: str = "hdris") -> str:
        """
        Get a list of categories for a specific asset type on Polyhaven.
        
        Parameters:
        - asset_type: The type of asset to get categories for (hdris, textures, models, all)
        """
        try:
            blender = get_blender_connection()
            if not _polyhaven_enabled:
                return "PolyHaven integration is disabled. Select it in the sidebar in BlenderMCP, then run it again."
            result = blender.send_command("get_polyhaven_categories", {"asset_type": asset_type})
            
            if "error" in result:
                return f"Error: {result['error']}"
            
            # Format the categories in a more readable way
            categories = result["categories"]
            formatted_output = f"Categories for {asset_type}:\n\n"
            
            # Sort categories by count (descending)
            sorted_categories = sorted(categories.items(), key=lambda x: x[1], reverse=True)
            
            for category, count in sorted_categories:
                formatted_output += f"- {category}: {count} assets\n"
            
            return formatted_output
        except Exception as e:
            logger.error(f"Error getting Polyhaven categories: {str(e)}")
            return f"Error getting Polyhaven categories: {str(e)}"
  • The @mcp.tool() decorator registers the get_polyhaven_categories function as an MCP tool, using its signature and docstring for automatic schema generation.
    @mcp.tool()
  • The function signature and docstring define the input schema (asset_type parameter with default 'hdris') and output as str.
    def get_polyhaven_categories(ctx: Context, asset_type: str = "hdris") -> str:
        """
        Get a list of categories for a specific asset type on Polyhaven.
        
        Parameters:
        - asset_type: The type of asset to get categories for (hdris, textures, models, all)
        """
  • In get_blender_connection(), it calls get_polyhaven_status to set the global _polyhaven_enabled flag used by the tool.
    result = _blender_connection.send_command("get_polyhaven_status")
    # Store the PolyHaven status globally
    _polyhaven_enabled = result.get("enabled", False)
    return _blender_connection
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it 'gets a list' which implies a read operation, but doesn't disclose rate limits, authentication needs, error handling, or what the returned list structure looks like. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 brief with two sentences: one stating the purpose and one explaining the parameter. It's front-loaded with the core functionality. There's no wasted text, though it could be slightly more structured (e.g., bullet points aren't used consistently).

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 1 parameter with 0% schema coverage and no output schema, the description does an adequate job explaining the parameter but lacks completeness. It doesn't describe the return value format (list structure, categories examples), error conditions, or how 'all' differs from specific types. For a simple lookup tool, it's minimally viable but has clear gaps.

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?

The description adds meaningful context beyond the input schema. The schema only shows asset_type as a string with default 'hdris', but the description enumerates the valid options (hdris, textures, models, all) and clarifies it's for 'a specific asset type'. With 0% schema description coverage and 1 parameter, this compensates well by providing the enum values that aren't in the schema.

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 verb ('Get a list of categories') and resource ('for a specific asset type on Polyhaven'), making the purpose explicit. It distinguishes from some siblings like download_polyhaven_asset or search_polyhaven_assets by focusing on categories rather than assets themselves. However, it doesn't explicitly differentiate from all siblings (e.g., get_polyhaven_status might be related but different).

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. It doesn't mention prerequisites, when it's appropriate compared to other Polyhaven tools (like search_polyhaven_assets), or any context for selecting asset_type. Usage is implied only through the parameter description, with no explicit when/when-not statements.

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/johncarlo177/Python.BlenderMCP'

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