refresh_nodes
Update the node cache to detect newly installed custom nodes in ComfyUI workflows after installation.
Instructions
Refresh the node cache.
Call this after installing new custom nodes to see them in list_nodes().
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function for the 'refresh_nodes' tool. It logs the action if context provided, clears the existing node cache using clear_node_cache(), refreshes by calling get_cached_nodes(), and returns a success message with the number of available nodes or an error message.def refresh_nodes(ctx: Context = None) -> str: """Refresh the node cache. Call this after installing new custom nodes to see them in list_nodes(). """ if ctx: ctx.info("Refreshing node cache...") clear_node_cache() try: nodes = get_cached_nodes() return f"Cache refreshed. {len(nodes)} nodes available." except Exception as e: return f"Error refreshing cache: {e}"
- src/comfy_mcp_server/tools/discovery.py:160-160 (registration)The @mcp.tool() decorator directly above the handler registers the refresh_nodes function as an MCP tool within the register_discovery_tools function.@mcp.tool()
- src/comfy_mcp_server/tools/__init__.py:26-26 (registration)Within register_all_tools, this call invokes register_discovery_tools(mcp), which defines and registers the refresh_nodes tool.register_discovery_tools(mcp)