Skip to main content
Glama

list_models

List available checkpoints, LoRAs, samplers, schedulers, or upscalers from your ComfyUI instance to discover valid parameter values for other tools.

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

TableJSON Schema
NameRequiredDescriptionDefault
kindNoWhich category of resource to listcheckpoints

Implementation Reference

  • The handler function for the 'list_models' tool. It calls fetchList() with the kind argument, formats the results, and returns them as text content.
    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}`,
          },
        ],
      };
    },
  • Zod schema for the 'list_models' tool input: a 'kind' enum field (checkpoints, loras, samplers, schedulers, upscalers) with a default of 'checkpoints'.
    const listModelsSchema = {
      kind: z
        .enum(["checkpoints", "loras", "samplers", "schedulers", "upscalers"])
        .default("checkpoints")
        .describe("Which category of resource to list"),
    };
  • Registration of the 'list_models' tool via server.tool() in the registerModelTools function. Includes the tool name, description, schema, and handler.
    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/server.ts:40-52 (registration)
    Registration caller: registerModelTools is invoked at server build time (line 45) to register the 'list_models' tool on the MCP server.
      const buildServer = () => {
        const s = new McpServer({ name: "comfyui-mcp", version: "0.2.0" });
        registerGenerateTools(s, client);
        registerRefineTool(s, client);
        registerUpscaleTool(s, client);
        registerModelTools(s, client);
        registerImageTools(s, client);
        registerConditioningTools(s, client);
        registerTemplateTools(s, client, templateStore);
        return s;
      };
      return { client, buildServer };
    }
  • Helper function fetchList() that dispatches to the appropriate ComfyUIClient method based on the kind parameter: listCheckpoints, listLoras, listSamplers, listSchedulers, or listUpscaleModels.
    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();
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It describes the action as listing, implying a read operation, but does not explicitly state that it is non-destructive or has no side effects. It could be more transparent about permissions or rate limits, but the basic behavior is clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action, and contains no unnecessary words. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema is provided, and the description does not mention the return format (e.g., list of names). For a listing tool, this would be helpful. However, the behavior is straightforward, so the lack of output details is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers 100% of parameters with descriptions and enums. The description adds value by explaining the purpose of the 'kind' parameter in discovering valid values for other tools, which goes beyond the schema's enum list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists available models/samplers and explicitly mentions the resources (checkpoints, LoRAs, samplers). It also distinguishes from sibling list tools like list_workflows by specifying its domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit context: 'Use this to discover valid values for the ''checkpoint'' parameter of other tools'. This tells the agent when to use it. It does not explicitly mention when not to use or alternatives, but the context is sufficient for a simple listing tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/miller-joe/comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server