Skip to main content
Glama

Put media on an AI attachment from links

import_attachment_media
DestructiveIdempotent

Put media on an AI attachment from links

Mojeeb downloads the attachment's media from https links and stores it as an upload would, replacing whatever was stored: one link for a photo, video or document, or up to 10 for an album's images, in order. For a client that can't send files, such as an AI assistant. A link can also be the url of a Mojeeb upload of this agent (createUpload), read from Mojeeb's storage instead of downloaded. Each link must answer 200 with the file itself within 20 seconds: redirects aren't followed, and a link to an address that isn't public is refused. A link that fails is 422 attachment_media_url_invalid; a file that arrives but isn't what the type takes is 422 invalid_media, with the same types and sizes as uploadAttachmentMedia. Nothing stored changes until every file passes. A video is re-encoded, so 503 media_processing_busy can answer here too. It shares the budget of 10 requests a minute per key with uploadAttachmentMedia.

Input Schema

NameRequiredDescriptionDefault
urlsYesLinks to the files: an https link or the `url` of a Mojeeb upload of this agent (`createUpload`) each; one for a photo, video or document, up to 10 for an album's images, in order.
agent_idYesThe agent the resource belongs to. Another company's agent, or the nil UUID, is `404 agent_not_found`; an agent outside the key's agent list is `403 agent_not_authorized`.
attachment_idYesAn AI attachment of the agent. Another agent's attachment is `404 not_found`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / urls / description
      Previous value: -"https links to the files: one for a photo, video or document, up to 10 for an album's images, in order."New value: +"Links to the files: an https link or the `url` of a Mojeeb upload of this agent (`createUpload`) each; one for a photo, video or document, up to 10 for an album's images, in order."
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations declare destructive/idempotent/openWorld, but the description goes well beyond them: atomic replacement semantics ("Nothing stored changes until every file passes"), fetch constraints (must return 200, 20s timeout, no redirects followed, non-public addresses refused), specific error codes (422 attachment_media_url_invalid, 422 invalid_media, 503 media_processing_busy), and a shared rate limit of 10 req/min per key with uploadAttachmentMedia.

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 purpose and the key constraint (replaces stored media) before error and rate-limit detail. The opening line duplicates the title and could be folded away, but the remaining sentences each add actionable information.

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 destructive, open-world, no-output-schema tool, the description covers failure modes, atomicity, encoding side effects and rate budget thoroughly. It does not describe what a successful response returns (e.g. the resulting media records), which is the only notable gap.

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 coverage is 100% and the `urls` schema description already contains the one-vs-ten album rule and the createUpload URL option, so the description largely restates it. Baseline 3 applies since the schema carries the parameter semantics.

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 (put media on an AI attachment from links) and immediately distinguishes itself from `uploadAttachmentMedia` and from the `createUpload` URL variant. An agent can tell exactly what this does versus get_attachment_media and import_saved_reply_media.

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 an explicit selecting condition: "For a client that can't send files, such as an AI assistant," which contrasts with the direct-upload sibling. It also notes that a link may be a `createUpload` URL of this agent, linking it to that tool. It stops short of an explicit "use uploadAttachmentMedia instead when you have the bytes" instruction.

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