Skip to main content
Glama

get_polyhaven_categories

Retrieve available categories for Polyhaven assets to organize and filter 3D content in Blender. Specify asset type (HDRI, textures, models) to get relevant categories.

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

  • Registration of the get_polyhaven_categories tool using the @mcp.tool() decorator.
    @mcp.tool()
  • The main handler function that implements the tool logic: connects to Blender, checks PolyHaven status, sends the 'get_polyhaven_categories' command to the Blender addon, receives the result, formats it by sorting categories by asset count, and returns a readable string.
    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)}"
  • Type hints and docstring define the input schema (asset_type: str = 'hdris') and output (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) """

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/drrodingo-del/BlenderMCP'

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