Skip to main content
Glama

download_image

Download an image from a URL and return it as base64 or save it to a file.

Instructions

Download an image from a URL and return it as base64 or save to a file. Use this after generating an image to get the actual image data. Note: Z.AI image URLs expire after 30 days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the image to download (e.g., from generate_image or get_async_result)
outputNoOutput format: "base64" returns the image data directly, "file_output" saves to diskbase64
file_outputNoAbsolute path to save the image file (required if output is "file_output"). Example: /path/to/image.png
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It explains the core behavior (download, return base64 or save to file) and mentions URL expiry. However, it lacks details on potential failure modes, rate limits, or authentication requirements. With no annotations, this is minimally adequate but not comprehensive.

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 extremely concise: two sentences and a note. Every sentence adds value: first states action and options, second provides usage context, and the note gives an important constraint. No wasted words.

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?

For a simple download tool with three parameters and no output schema, the description covers the essential points: what it does, when to use it, output options, and a critical caveat (URL expiry). It lacks details about error handling or file path requirements, but these are partly covered by the schema. Overall, it is quite complete for the tool's complexity.

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

Parameters3/5

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

Schema description coverage is 100% (all three parameters have descriptions). Baseline is 3. The description adds context by echoing the output enum and clarifying the URL source from generation, but does not significantly deepen parameter understanding beyond the schema.

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 verb 'Download' and the resource 'image from a URL', and specifies the available output options (base64 or file). It distinguishes from sibling tools by indicating this is for downloading an image URL, typically after generation.

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 explicitly says 'Use this after generating an image to get the actual image data', providing clear when-to-use guidance. It also notes URL expiry, which is a time constraint. It does not explicitly contrast with sibling tools that combine generation and download, but the context is sufficient.

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/GeorgH93/z_ai_image_gen_mcp'

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