list_models
List available models, samplers, schedulers, upscalers, or LoRAs from a ComfyUI instance. Use to find valid values for checkpoint parameters or see installed resources.
Instructions
List available models or samplers on the ComfyUI instance. Use this to discover valid values for the 'checkpoint' parameter of other tools, or to see what LoRAs and samplers are installed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Which category of resource to list | checkpoints |
Implementation Reference
- src/tools/models.ts:17-36 (handler)The 'list_models' tool handler registered via server.tool(). It calls fetchList() with the kind argument and returns a formatted text response listing the available models/samplers.
server.tool( "list_models", "List available models or samplers on the ComfyUI instance. Use this to discover valid values for the 'checkpoint' parameter of other tools, or to see what LoRAs and samplers are installed.", listModelsSchema, async (args) => { const list = await fetchList(client, args.kind); const body = list.length > 0 ? list.map((n, i) => ` ${i + 1}. ${n}`).join("\n") : " (none found)"; return { content: [ { type: "text" as const, text: `${args.kind} (${list.length}):\n${body}`, }, ], }; }, ); - src/tools/models.ts:6-11 (schema)Zod schema defining the 'kind' parameter for list_models: enum of 'checkpoints', 'loras', 'samplers', 'schedulers', 'upscalers' with default 'checkpoints'.
const listModelsSchema = { kind: z .enum(["checkpoints", "loras", "samplers", "schedulers", "upscalers"]) .default("checkpoints") .describe("Which category of resource to list"), }; - src/server.ts:45-45 (registration)Registration call that wires registerModelTools (which contains the list_models tool) into the MCP server during initialization.
registerModelTools(s, client); - src/tools/models.ts:58-74 (helper)fetchList() helper function that dispatches to the appropriate ComfyUIClient method based on the kind parameter.
async function fetchList( client: ComfyUIClient, kind: "checkpoints" | "loras" | "samplers" | "schedulers" | "upscalers", ): Promise<string[]> { switch (kind) { case "checkpoints": return client.listCheckpoints(); case "loras": return client.listLoras(); case "samplers": return client.listSamplers(); case "schedulers": return client.listSchedulers(); case "upscalers": return client.listUpscaleModels(); } } - src/comfyui/client.ts:175-184 (helper)listNodeOptions() private helper that fetches object info for a node class and extracts available options for a given field name. Used by listCheckpoints, listLoras, listSamplers, listSchedulers, listUpscaleModels.
private async listNodeOptions( nodeClass: string, fieldName: string, ): Promise<string[]> { const info = await this.getObjectInfo(nodeClass); const node = info[nodeClass]; const field = node?.input?.required?.[fieldName]; if (!Array.isArray(field) || !Array.isArray(field[0])) return []; return field[0] as string[]; }