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
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Model folder: checkpoints, loras, vae, embeddings | checkpoints |
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}"]
- src/comfy_mcp_server/tools/__init__.py:26-26 (registration)Registration call to register_discovery_tools(mcp), which defines and registers the list_models tool (along with other discovery tools).register_discovery_tools(mcp)
- src/comfy_mcp_server/__init__.py:92-92 (registration)Top-level registration call to register_all_tools(mcp), which chains to registering the discovery tools including list_models.register_all_tools(mcp)