Skip to main content
Glama

Upload media from a URL

upload_media_from_url

Downloads a public image (JPEG, PNG, WebP, GIF), video (MP4, MOV, WebM) or PDF into the workspace and returns a media id to put in create_post.media_ids. Media is per workspace and reusable across posts, except that a video file is deleted 7 days after the time of the posts that use it (a still stays): to post it again later, upload it again. Shager measures every video itself: width and height as displayed (a rotated phone video counts as portrait) and duration_ms come back in the response, and validate_post checks Reels, Shorts, Stories and TikTok length and shape rules with them (Shorts: vertical or square, up to 3 minutes; Instagram Reels 3 s–15 min; Stories up to 60 s). A file that doesn't fit a network needn't be re-made: set fit_shape and/or fit_length on the post and Shager makes a fitting copy for each network (validate_post lists them in fits). width, height and duration_ms are optional and only used when a file can't be measured; measured values win. A video that comes back with null width, height or duration_ms couldn't be measured: pass them and upload again before scheduling it. Private, local and credentialed URLs are refused. Size limit: 2 GB.

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": {
      "workspace_id": "<workspace_id>",
      "url": "<url>"
    },
    "name": "upload_media_from_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
widthNoFallback only: used when the video can't be measured.
heightNoFallback only: used when the video can't be measured.
file_nameNo
duration_msNoFallback only: used when the video can't be measured.
workspace_idYesWorkspace id from list_workspaces
idempotency_keyNoAny unique string you choose (REST: the Idempotency-Key header works too). Retrying with the same key and body returns the first result instead of creating a second one. Kept 24 hours.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behavior: media is reusable per workspace, video files are deleted 7 days after posts that use them, Shager measures width/height/duration itself, null measurements require re-upload with fallback values, and there is a 2 GB size limit. These are substantive operational details that materially affect correct use.

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

Conciseness4/5

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

The purpose is front-loaded and most sentences carry operational information, but the description is dense and packs network-specific validation rules into a long block. It remains useful, though tighter structuring could improve scanability.

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 complex, open-world ingestion tool with no output schema, the description covers the return value, measurement behavior, retention, URL restrictions, and size limits. It leaves minor gaps around `file_name` and the idempotency key, but the schema already documents the latter.

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 description adds real meaning beyond the schema for `width`, `height`, and `duration_ms`: they are fallback-only, measured values win, and they are needed only when measurement returns null. It also constrains `url` to public resources, though `file_name` and `idempotency_key` are not discussed in the description.

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 states a specific verb and resource: it downloads a public image, video, or PDF into the workspace and returns a media id. It also names the exact downstream usage (`create_post.media_ids`), making the tool's role distinct from upload siblings.

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 clearly says the URL must be public and that private, local, and credentialed URLs are refused, and it explains re-upload behavior for videos. It does not explicitly contrast this tool with `create_media_upload` or `complete_media_upload`, so the alternative-route guidance is incomplete.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources