Skip to main content
Glama

search_polyhaven_assets

Find and filter 3D assets from Polyhaven for use in Blender projects, including HDRIs, textures, and models with category-based search.

Instructions

Search for assets on Polyhaven with optional filtering.

Parameters:

  • asset_type: Type of assets to search for (hdris, textures, models, all)

  • categories: Optional comma-separated list of categories to filter by

Returns a list of matching assets with basic information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_typeNoall
categoriesNo

Implementation Reference

  • The handler function for the 'search_polyhaven_assets' tool. It proxies the request to the Blender addon via socket communication, processes the response, sorts assets by download count, and returns a formatted string listing the assets with details like name, type, categories, and download count.
    @mcp.tool() def search_polyhaven_assets( ctx: Context, asset_type: str = "all", categories: str = None ) -> str: """ Search for assets on Polyhaven with optional filtering. Parameters: - asset_type: Type of assets to search for (hdris, textures, models, all) - categories: Optional comma-separated list of categories to filter by Returns a list of matching assets with basic information. """ try: blender = get_blender_connection() result = blender.send_command("search_polyhaven_assets", { "asset_type": asset_type, "categories": categories }) if "error" in result: return f"Error: {result['error']}" # Format the assets in a more readable way assets = result["assets"] total_count = result["total_count"] returned_count = result["returned_count"] formatted_output = f"Found {total_count} assets" if categories: formatted_output += f" in categories: {categories}" formatted_output += f"\nShowing {returned_count} assets:\n\n" # Sort assets by download count (popularity) sorted_assets = sorted(assets.items(), key=lambda x: x[1].get("download_count", 0), reverse=True) for asset_id, asset_data in sorted_assets: formatted_output += f"- {asset_data.get('name', asset_id)} (ID: {asset_id})\n" formatted_output += f" Type: {['HDRI', 'Texture', 'Model'][asset_data.get('type', 0)]}\n" formatted_output += f" Categories: {', '.join(asset_data.get('categories', []))}\n" formatted_output += f" Downloads: {asset_data.get('download_count', 'Unknown')}\n\n" return formatted_output except Exception as e: logger.error(f"Error searching Polyhaven assets: {str(e)}") return f"Error searching Polyhaven assets: {str(e)}"
  • Registration of the tool using the FastMCP @mcp.tool() decorator, which handles schema inference from the function signature and docstring.
    @mcp.tool()
  • Input schema defined by function parameters and docstring: asset_type (str, default 'all'), categories (str, optional). Output is a formatted string.
    def search_polyhaven_assets( ctx: Context, asset_type: str = "all", categories: str = None ) -> str: """ Search for assets on Polyhaven with optional filtering. Parameters: - asset_type: Type of assets to search for (hdris, textures, models, all) - categories: Optional comma-separated list of categories to filter by Returns a list of matching assets with basic information. """

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/spranjal3301/final-year-project'

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