Skip to main content
Glama

search_nodes

Find ComfyUI workflow nodes by searching names, categories, or descriptions to quickly locate specific functionality for automation tasks.

Instructions

Search for nodes by name, category, or description.

Args: query: Search string (searches name, category, description) Returns matching nodes sorted by relevance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • The core handler implementation for the 'search_nodes' tool. It searches through cached ComfyUI nodes, scoring matches in name (10pts), category (5pts), and description (3pts), sorts by score descending, and returns up to 50 top matches.
    @mcp.tool() def search_nodes( query: str = Field(description="Search query"), ctx: Context = None, ) -> list: """Search for nodes by name, category, or description. Args: query: Search string (searches name, category, description) Returns matching nodes sorted by relevance. """ if ctx: ctx.info(f"Searching for: {query}") try: nodes = get_cached_nodes() query_lower = query.lower() results = [] for name, info in nodes.items(): score = 0 # Name match (highest priority) if query_lower in name.lower(): score += 10 # Category match if query_lower in info.get("category", "").lower(): score += 5 # Description match if query_lower in info.get("description", "").lower(): score += 3 if score > 0: results.append((name, score)) # Sort by score descending results.sort(key=lambda x: x[1], reverse=True) return [name for name, _ in results[:50]] # Limit to 50 results except Exception as e:
  • Within register_all_tools, calls register_discovery_tools(mcp), which defines and registers the search_nodes tool via @mcp.tool() decorator.
    register_discovery_tools(mcp)
  • Top-level registration call to register_all_tools(mcp), which transitively registers the search_nodes tool.
    register_all_tools(mcp)

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/IO-AtelierTech/comfyui-mcp'

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