list_nodes
Discover available ComfyUI nodes for workflow building by filtering nodes by name or category to identify components needed for automation tasks.
Instructions
List available ComfyUI nodes.
Args:
filter: Optional string to match node names (case-insensitive)
category: Optional category filter (exact match)
Returns a sorted list of node class names.
Use this to discover available nodes for workflow building.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_nodes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter by name (e.g., 'fal', 'image') | |
| category | No | Filter by category |
Implementation Reference
- Core implementation of the list_nodes MCP tool. Filters and returns sorted list of available ComfyUI node names using cached data.
@mcp.tool() def list_nodes( filter: str = Field(default=None, description="Filter by name (e.g., 'fal', 'image')"), category: str = Field(default=None, description="Filter by category"), ctx: Context = None, ) -> list: """List available ComfyUI nodes. Args: filter: Optional string to match node names (case-insensitive) category: Optional category filter (exact match) Returns a sorted list of node class names. Use this to discover available nodes for workflow building. """ if ctx: ctx.info(f"Listing nodes{' matching: ' + filter if filter else ''}...") try: nodes = get_cached_nodes() result = [] for name, info in nodes.items(): if filter and filter.lower() not in name.lower(): continue if category and info.get("category", "").lower() != category.lower(): continue result.append(name) return sorted(result) except Exception as e: return [f"Error: {e}"] - Input schema defined using Pydantic Field for the filter (optional name filter) and category (optional exact category match) parameters.
filter: str = Field(default=None, description="Filter by name (e.g., 'fal', 'image')"), category: str = Field(default=None, description="Filter by category"), ctx: Context = None, - src/comfy_mcp_server/tools/__init__.py:26-26 (registration)Registers the discovery tools (including list_nodes) by calling register_discovery_tools during overall tool registration.
register_discovery_tools(mcp) - src/comfy_mcp_server/__init__.py:92-92 (registration)Top-level registration of all MCP tools, which chains to list_nodes registration.
register_all_tools(mcp) - Uses get_cached_nodes() helper from api.py to fetch node data efficiently.
nodes = get_cached_nodes()