Skip to main content
Glama

Download and upload image from URL

card_builder_upload_image_from_url
DestructiveIdempotent

Download an image from an http(s) URL and upload it to the Card Builder media library, sanitizing SVG files and blocking reserved or loopback addresses.

Instructions

Download an image from an http(s) URL and upload it to the Card Builder media library.

Only http/https schemes are accepted. The response must declare an image/* Content-Type (covers image/svg+xml) and stay within _MAX_URL_IMAGE_BYTES, else nothing is uploaded. image/svg+xml is sanitized (see sanitize_svg) regardless of filename, since the remote server controls the bytes. The file becomes public under /local/ with no authentication, and an existing path/ filename is silently overwritten.

The URL and every redirect hop are resolved and rejected on a loopback, link-local, unspecified, multicast or other reserved address (incl. ::ffff:127.0.0.1) — host_network: true means 127.0.0.1/localhost here can reach host services that trust it as a local peer. Private LAN ranges stay allowed (e.g. a camera snapshot on your own network).

Use when: mirroring a remote image into the media library. Not for: bytes already in memory — use card_builder_upload_media; a file on disk — use card_builder_upload_media_from_path. Returns: {reference, path, url}. Errors: {"error": "scheme_not_allowed" | "target_not_allowed" | "dns_resolution_failed" | "too_many_redirects" | "content_type_not_allowed" | "file_too_large" | "download_failed" | "invalid_svg" | ...}. Limits: 30-second timeout, _MAX_URL_IMAGE_BYTES (15 MiB) cap, up to _MAX_URL_REDIRECTS (5) redirects, each re-validated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYeshttp(s) URL of the image to download, e.g. 'https://example.com/bg.png'.
pathNoSub-folder under www/card_builder/ to upload into. Empty string uploads to the root.
filenameNoTarget filename to store as. Omit to derive one from the URL's last path segment.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.25.1
    • addedInput schema / properties / filename / description
      Added value: +"Target filename to store as. Omit to derive one from the URL's last path segment."
    • addedInput schema / properties / path / description
      Added value: +"Sub-folder under www/card_builder/ to upload into. Empty string uploads to the root."
    • addedInput schema / properties / url / description
      Added value: +"http(s) URL of the image to download, e.g. 'https://example.com/bg.png'."
  2. Addedv0.18.1

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, idempotentHint=true, and openWorldHint=true, but the description goes far beyond them. It discloses scheme restrictions, content-type enforcement, SVG sanitization, public no-auth placement under /local/, silent overwrite of existing path/filename, SSRF rejection rules for loopback/link-local/reserved addresses, timeout, byte cap, and redirect limits. This is exceptionally rich behavioral context with no contradiction of the annotations.

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?

Dense but well-structured with labeled sections (Use when/Not for, Returns, Errors, Limits). Every sentence adds actionable information about network safety, failure modes, or constraints. Front-loaded with the core action before the caveats.

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

Completeness5/5

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

Given the tool's complexity (network fetch, SSRF surface, overwrite behavior), the description covers what an agent needs: error codes, return shape, limits, and security model. An output schema exists so return values are not over-explained, and nothing critical is missing.

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%, so the schema already fully documents url, path, and filename. The description does not add syntax or format detail for individual parameters beyond what the schema provides, so the baseline 3 applies.

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?

States a precise verb+resource: 'Download an image from an http(s) URL and upload it to the Card Builder media library.' Explicitly distinguishes from siblings by naming card_builder_upload_media (in-memory bytes) and card_builder_upload_media_from_path (file on disk). No ambiguity about what it does.

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

Usage Guidelines5/5

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

Provides explicit 'Use when: mirroring a remote image' and 'Not for' clauses that route the agent to the correct sibling for in-memory or on-disk sources. The selection conditions are stated rather than inferred.

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

Deploy Server

Other Tools