Skip to main content
Glama

download_image

Download images from URLs and save them to specified file paths for use in ComfyUI workflows.

Instructions

Download an image from a URL and save it to a file.

Args:
    url: The URL of the image to download.
    save_path: The absolute path to save the image to. Must be an absolute path, otherwise the image will be saved relative to the server location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
save_pathYes

Implementation Reference

  • The handler function for the 'download_image' tool. It is registered via the @mcp.tool() decorator. Downloads an image from the provided URL and saves it to the specified path using urllib.request.urlretrieve, then returns a success indicator. The function signature and docstring define the input schema.
    @mcp.tool()
    async def download_image(url: str, save_path: str) -> Any:
        """Download an image from a URL and save it to a file.
        
        Args:
            url: The URL of the image to download.
            save_path: The absolute path to save the image to. Must be an absolute path, otherwise the image will be saved relative to the server location.
        """
        urllib.request.urlretrieve(url, save_path)
        return {"success": True}
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the save_path must be absolute, adding useful context about file handling. However, it lacks details on error handling, network behavior, file overwrites, or response format, leaving gaps in behavioral understanding.

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 front-loaded with the core purpose in the first sentence, followed by parameter details in a structured 'Args' section. Every sentence adds value without redundancy, making it efficient and well-organized for quick comprehension.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description covers the basic operation and parameters adequately. However, it lacks information on return values, error cases, or performance aspects, making it incomplete for full contextual understanding.

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%, so the description must compensate. It provides clear semantics for both parameters: 'url' as the source and 'save_path' as the destination with a constraint about absolute paths. This adds meaningful context beyond the bare schema, though it could specify URL formats or path examples.

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 the specific action ('download an image from a URL') and the outcome ('save it to a file'), using precise verbs and specifying the resource. It distinguishes itself from sibling tools like text_to_image (which generates rather than downloads) and workflow tools, making the purpose unambiguous.

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 implies usage when needing to download an image from a URL to a file, but it does not explicitly state when to use this tool versus alternatives or provide exclusions. No guidance is given on prerequisites or error conditions, leaving usage context partially inferred.

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/Overseer66/comfyui-mcp-server'

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