Skip to main content
Glama

Add to Library

add_to_library

Add a file to a Brand Library. Briefs, Brand Edits, and Brand Skills can draw on Library images. Video and audio stay stored with the brand for other workflows; those features do not use them yet. Pass exactly one source:

  • upload_id: a completed upload from create_upload_urls, for local files.

  • media_id: an existing image, video, or audio ID, such as a generation output. Media from another brand is copied.

  • url: a public HTTPS URL; a copy is stored.

The type is detected from the file: images (JPEG, PNG, WebP, AVIF, SVG; max 10MB), video (MP4, WebM, MOV), and audio (MP3, WAV, OGG, FLAC, AAC, M4A), max 100 MiB. Returns the Library item with its media ID, stable link, and file details. If the brand already holds identical file contents, returns that item with existing: true. URLs are downloaded on every add, so changed contents may return a different item.

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": {
      "brand_session_id": "<brand_session_id>"
    },
    "name": "add_to_library"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPublic HTTPS location from which to download a copy of the file into this Brand Library.
media_idNoExisting image, video, or audio asset to add to this Brand Library. Use the media asset's ID, such as a generation output's id.
llm_modelNoThe model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Omit it or pass "unknown" if you are not certain; the tool runs the same either way. Recorded only for the server developer's analytics.
upload_idNoTemporary upload containing the file to save in this Brand Library. Use its ID from create_upload_urls or get_file_picker_handoff after the bytes have been uploaded.
brand_session_idYesBrand session ID from list_brands for the brand whose Library to use.

Output Schema

NameRequiredDescriptionDefault
idYesMedia ID of the file.
urlYesStable link to the file.
typeYesMedia family: image, video, or audio.
widthYesWidth in pixels, or null when not recorded.
heightYesHeight in pixels, or null when not recorded.
sourceYesuploaded, scraped (collected from a brand source), or generated.
existingYesTrue when the brand already held this file; nothing new was stored.
file_sizeYesFile size in bytes.
mime_typeYesMIME type of the file.
created_atYesTime the file was stored.
in_libraryYesWhether the file is in its Brand Library.
descriptionYesText description of the file, or null when there is none.
duration_msYesDuration in milliseconds, or null when not recorded.
workspace_idYesWorkspace ID, or null for a personal workspace that has no ID.
generation_idYesID of the generation that produced the file, or null when none is recorded.
brand_session_idYesBrand session ID of the brand the file belongs to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

Adds real value beyond annotations: format and size limits (10MB images, 100 MiB video/audio), the fact that URLs are re-downloaded on every add, and the `existing: true` dedupe behavior. However, the dedupe statement sits in mild tension with idempotentHint=false without being reconciled, and no permission or failure behavior is described. Since annotations already cover the safety profile, a 3 reflects useful but not fully coherent behavioral disclosure.

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-loads the core action, then uses a tight bulleted block for the three source variants and a final sentence for limits and return behavior. Dense and mostly waste-free, though the format/limit inventory is long enough to be slightly list-like rather than prose-efficient.

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?

For a 5-parameter mutation tool, the definition covers sourcing rules, format/size validation, dedupe semantics, and return payload shape. An output schema exists, so return values need not be spelled out, yet the description still summarizes them usefully.

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%, so the baseline is 3. The description does add genuine meaning — the exactly-one-of constraint across upload_id/media_id/url and the 'completed upload' precondition — which goes beyond the schema, but the llm_model parameter and the brand_session_id requirement are left entirely to 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?

States a specific verb and resource ('Add a file to a Brand Library') and immediately clarifies which downstream features consume Library images versus which store video/audio without using them. An agent can distinguish this from generate_* or list_library siblings without opening a schema.

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 strong context: 'Pass exactly one source' followed by per-source guidance naming create_upload_urls and the scenario for each (local file, existing asset, public URL). It also notes cross-brand media is copied, which steers selection. It stops short of explicit when-not-to-use or naming the removal/listing siblings as alternatives.

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