Skip to main content
Glama

list_models

Retrieve available models from ComfyUI server folders to select checkpoints, LoRAs, VAEs, embeddings, ControlNet, upscaling models, or CLIP vision encoders for workflow configuration.

Instructions

List available models in a folder.

Args: folder: Model folder name. Options: - checkpoints: Full model checkpoints - loras: LoRA fine-tuning files - vae: VAE decoders - embeddings: Text embeddings - controlnet: ControlNet models - upscale_models: Upscaling models - clip_vision: CLIP vision encoders Returns list of model filenames in the folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoModel folder: checkpoints, loras, vae, embeddingscheckpoints

Implementation Reference

  • The handler function implementing the list_models MCP tool. It lists models from a specified ComfyUI folder by calling the /models/{folder} API endpoint.
    @mcp.tool() def list_models( folder: str = Field( default="checkpoints", description="Model folder: checkpoints, loras, vae, embeddings", ), ctx: Context = None, ) -> list: """List available models in a folder. Args: folder: Model folder name. Options: - checkpoints: Full model checkpoints - loras: LoRA fine-tuning files - vae: VAE decoders - embeddings: Text embeddings - controlnet: ControlNet models - upscale_models: Upscaling models - clip_vision: CLIP vision encoders Returns list of model filenames in the folder. """ if ctx: ctx.info(f"Listing models in: {folder}") try: return comfy_get(f"/models/{folder}") except HTTPError as e: if e.code == 404: return [] return [f"Error: {e}"] except Exception as e: return [f"Error: {e}"]
  • Registration call to register_discovery_tools(mcp), which defines and registers the list_models tool (along with other discovery tools).
    register_discovery_tools(mcp)
  • Top-level registration call to register_all_tools(mcp), which chains to registering the discovery tools including list_models.
    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