Skip to main content
Glama

var2_upload_asset

Upload a file the user ATTACHED to the chat (a photo from their phone, "my logo as a PNG", a voice memo) when NO link exists for it yet. If the message already contains a link or placeholder_id for the file, this tool is WRONG — a www.var2.ai / api.var2.ai / .supabase.co link is already inside var2; hand it to the matching create/modify/get tool. Sole pasted-link exception: NON-var2 link + explicit "import / pull it into var2". Text-only request, no file ("I want a song and cover art") → the matching create_ generator. When it IS an upload: call this FIRST, then pass the returned url verbatim as image_url / first_frame_url / reference_image_urls / audio_url / source_video_url. If your host filled in file (a native attachment object), just send it as-is — no url, no base64. Stores bytes durably in var2 storage; returns a first-party url (no expiry) + placeholder_id for var2_join_videos chaining. ≤100MB per file. base64 data: ALWAYS pass expected_bytes (+ sha256 if known) so truncation is rejected; >1.4M chars → parts via chunk_index/chunk_total/upload_id. Never pre-shrink a file to fit.

Input Schema

NameRequiredDescriptionDefault
urlNoPublic https URL of the asset to rehost/import. Must be reachable from Vercel's egress; private/loopback hostnames are rejected. Provide EITHER `url` or `data` (not both).
dataNoBase64 (or a `data:` URL) of the raw bytes — for a SMALL local file with no public URL when the client has no shell to PUT with. Hard-capped at 1MB; larger files MUST use var2_request_upload. Provide EITHER `url` or `data` (not both).
fileNoNATIVE attachment input. Hosts that support file params (ChatGPT via `_meta["openai/fileParams"]`) fill this in themselves when the user attaches a file — you do NOT construct it. The server reads its `download_url` and imports the bytes directly, so no PUT, no base64 and no browser step is involved. Hosts without file-param support never send this; use `url` or `data` there.
nameNoOptional display name. Stored in the generation row's prompt/title so it shows up cleanly in the user's asset library.
typeYesModality of the asset. The server validates the bytes (Content-Type for `url`, plus a magic-byte signature check either way) match image/* / video/* / audio/*; a mismatch rejects the upload.
sha256NoHex sha256 of the original file — verified end-to-end when provided.
upload_idNoChunk-session id. Omit on part 0 (response returns one); pass it on every later part. The final part assembles, validates and stores.
chunk_indexNoChunked upload for files whose base64 exceeds one call: slice the base64 STRING into parts (~200K chars each recommended — a part is emitted as tool-call tokens, so keep it small enough to produce reliably; 1.4M hard cap; any split point) and send one part per call in `data`. 0-based part number.
chunk_totalNoTotal parts. Required with chunk_index.
content_typeNoMIME of the inline `data` (e.g. "image/png"). Optional — the magic-byte check derives the real type regardless.
expected_bytesNoSize of the ORIGINAL file in bytes. STRONGLY recommended with `data`: a decoded-size mismatch is rejected instead of storing a truncated file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations carry only a title, so the description bears the full behavioral burden and delivers: durable storage, a no-expiry first-party url plus placeholder_id, a 100MB per-file cap, the requirement to pass expected_bytes/sha256 with base64 so truncation is rejected, and chunking behavior for large base64. This goes well beyond anything in 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.

Conciseness4/5

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

Dense but front-loaded: the core distinction from create/modify/get tools and the create_* fallback leads, followed by operational detail. Every sentence is load-bearing for this routing-heavy tool, though the parenthetical-heavy style makes it heavier than strictly necessary.

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 complex 11-parameter tool with nested objects and no output schema, the description explains the return values (url, placeholder_id) and the full upload/chunking contract, so an agent has everything needed to invoke it correctly and use its result.

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 documents all 11 parameters including the chunk-session semantics and the native `file` object. The description reinforces usage (send the returned url verbatim as image_url/audio_url, pass expected_bytes) but adds little that isn't already in the schema, so the baseline of 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 specific verb+resource ("Upload a file the user ATTACHED to the chat") with concrete examples (photo, logo PNG, voice memo) and explicitly distinguishes itself from the create_* generator siblings and the matching create/modify/get tools. An agent can route correctly without opening any schema.

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?

Gives explicit when-to-use (attached file, no link yet), when-NOT (link or placeholder_id present → hand to create/modify/get tool), the single pasted-link exception, and the text-only alternative (create_* generator). It also states this is called FIRST and how the returned url feeds later calls.

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