Skip to main content
Glama

download_model

Downloads a model file into the correct ComfyUI models subdirectory, validating the filename and extension and using atomic writes to prevent corrupt partial downloads.

Instructions

Download a model file into the right ComfyUI models subdirectory.

The contract is deliberately tight, because this writes into the user's model tree:

  • filename must be a bare name -- no path separators, no ...

  • The extension must be plausible for the model type, so a stray .sh cannot be dropped into models/.

  • Only http/https URLs are fetched, and redirects are not followed to non-HTTP schemes.

  • The write is atomic: a partial download lands on a .part file and is renamed only on success, so an interrupted transfer can never leave a corrupt .safetensors that ComfyUI will later try to load.

api_token is sent as a bearer header for gated hosts and is never logged. It may also be supplied via COMFYUI_DOWNLOAD_TOKEN so it does not have to travel through a tool argument.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>",
      "filename": "<filename>",
      "model_type": "<model_type>"
    },
    "name": "download_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
filenameYes
api_tokenNo
model_typeYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does so well: it discloses atomic write semantics via a '.part' rename, redirect restrictions, secret handling for api_token (bearer header, never logged, env-var alternative), and the rationale that a corrupt .safetensors must never land in the tree. The notable omission is what happens when the target file already exists — overwrite, error, or skip is unstated for a destructive-adjacent write.

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?

Front-loaded one-line purpose followed by a bulleted contract; each bullet adds a distinct, actionable constraint and the preamble explains why the constraints exist. No sentence is filler.

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

Completeness4/5

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

An output schema exists, so return values need not be described, and the security/validation contract is unusually thorough. Remaining gaps are the valid model_type values and existing-file/overwrite behavior, both of which an agent needs to call this safely.

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?

Schema description coverage is 0% across four parameters, yet the prose gives meaning to each: filename (bare name, no separators or '..'), url (http/https only), api_token (bearer header, env-var fallback), and model_type (drives subdirectory choice and must have a plausible extension). It stops short of enumerating valid model_type values, which matters given zero enums in the schema.

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

Purpose4/5

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

States a specific verb and resource ('Download a model file') plus the destination scope ('the right ComfyUI models subdirectory'), so the agent knows this is a fetch-and-place operation. It does not name a sibling or contrast itself with any of them (e.g. list_models), but no sibling appears to download, so confusion risk is low.

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

Usage Guidelines3/5

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

The description is rich in acceptance constraints (bare filename, plausible extension, http/https only, no non-HTTP redirects) but never says when to reach for this tool versus alternatives, nor any prerequisite such as checking list_models first or whether an existing file is overwritten. Usage is implied by the contract rather than stated as guidance.

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