Skip to main content
Glama

Import media from a URL

import_media_from_url

Download an image, video, audio file or PDF document from a public http(s) URL into the media library. Images up to 10 MB, audio up to 25 MB, PDF documents up to 100 MB and videos up to 200 MB; the file type is taken from the file's own bytes, not its URL or extension, and internal/private addresses are refused. A larger video has to be uploaded from the PostRite app, which sends it straight to storage — there is no import path for it here. Audio files and PDF documents are for chat: a post publishes images and videos only and refuses them. Returns the new media record (use the id of an image or a video as a mediaId on a post). Importing the same file twice returns the existing record rather than a copy.

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>"
    },
    "name": "import_media_from_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPublic http(s) URL of the image, video, audio file or PDF document
filenameNoOptional filename to store it under
organizationIdNoOrganization to act in — an id from list_organizations. Required when this connection was authorized for more than one organization; omit it when there is only one.

Output Schema

NameRequiredDescriptionDefault
idNoUse this as a mediaId on a post
sizeNoBytes
widthNo
heightNo
altTextNoAlternative text published with this file; null when none — set it with update_media
durationNoSeconds, for video
filenameNo
mimetypeNo
createdAtNo
duplicateNoTrue when an import matched a file already in the library
hasThumbnailNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: per-type size ceilings, sniffing the type from the file's bytes rather than the URL/extension, refusal of internal/private addresses, and dedupe on re-import returning the existing record. The dedupe sentence sits in mild tension with idempotentHint=false, though it can be read as per-file rather than per-call, so this is a note rather than a contradiction.

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?

Front-loaded with the action and target, then limits, then the type/security caveats, then the return contract. Dense but nearly every clause carries operational information; the size-limit enumeration is the only slightly heavy stretch.

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?

Covers the full picture an agent needs: accepted inputs and limits, security restrictions, the fallback path for oversized video, downstream usability of the returned record as a mediaId, and idempotent re-import behavior. Nothing material is left to guesswork despite an output schema already existing.

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 coverage is already 100%, so the baseline is 3, but the description earns more by clarifying that the URL must be public http(s) and that the file type ignores both the URL and the supplied filename — meaningful semantics for how the optional filename is (and isn't) interpreted.

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 specific verb and resource ('Download an image, video, audio file or PDF document from a public http(s) URL into the media library') and names the accepted asset classes. This clearly separates it from siblings like update_media or list_media, which operate on existing records rather than ingesting new ones.

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?

Gives explicit when-nots: oversized videos have no import path here and must be uploaded from the PostRite app, and audio/PDF are chat-only because 'a post publishes images and videos only and refuses them.' It stops short of naming sibling tools (e.g. update_media, list_media) as alternatives, which is the only gap.

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