Skip to main content
Glama

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
NameRequiredDescriptionDefault

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}"
  • 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()
  • Within register_all_tools, this call invokes register_discovery_tools(mcp), which defines and registers the refresh_nodes tool.
    register_discovery_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