Skip to main content
Glama

Generate asset upload urls

video_assets_generate_presigned_url

Generates a list of pre-signed upload URLs for the assets required. This API is only necessary if you want to upload to Magic Hour's storage. Refer to the Input Files Guide for more details.

The response array will match the order of items in the request body.

Valid file extensions per asset type:

  • video: mp4, m4v, mov, webm

  • audio: mp3, wav, aac, flac, webm, weba, m4a, opus, ogg, oga, aiff, amr

  • image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, tif, bmp

  • gif: gif, webp, webm

Note: gif is only supported for face swap API video_file_path field.

Once you receive an upload URL, send a PUT request to upload the file directly.

Example:

curl -X PUT --data '@/path/to/file/video.mp4' \
  https://videos.magichour.ai/api-assets/id/video.mp4?<auth params from the API response>

MCP guidance:

  • This only creates presigned upload URLs. For local files, upload the raw bytes to each returned upload_url outside the generation call, then pass the matching file_path into the create tool.

  • For *_file_path values, prefer an existing Magic Hour file path or a file_path returned by the upload-URL endpoint after the file bytes are uploaded. Direct public media URLs may work when they are stable, fetchable, and return raw file bytes, but hotlinked URLs can fail; when in doubt, use the presigned upload flow first and pass the returned file_path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesThe list of assets to upload. The response array will match the order of items in the request body.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesThe list of upload URLs and file paths for the assets. The response array will match the order of items in the request body. Refer to the [Input Files Guide](https://docs.magichour.ai/integration/inputs-and-outputs) for more details.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare a safe, non-destructive, non-open-world operation, so the safety burden is low. The description still adds real behavioral context: the response array order matches the request body, a PUT with the raw file bytes is required afterward, and valid extensions differ per asset type (including the gif-only-for-face-swap caveat). It omits auth/expiry behavior of the presigned URLs, which keeps it short of a 5.

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, then constraints, then a concrete curl example and MCP guidance. It is somewhat long and repeats the extension list that already appears in the schema's `extension` description, which is the only real waste.

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?

With an output schema present, return-value details are unnecessary, and the description instead covers the full workflow an agent needs: request shape, response ordering, the follow-up PUT upload, and how the resulting file_path feeds the create tools. Nothing material is missing.

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 100% with a nested items array, so the baseline is 3. The description adds value beyond the schema by categorizing extensions per asset type (video/audio/image/gif) and flagging that gif is only valid for a specific face-swap field, clarifying constraints the flat enum-less schema does not organize.

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 ('Generates a list of pre-signed upload URLs for the assets required') and immediately scopes it ('only necessary if you want to upload to Magic Hour's storage'). This cleanly separates it from the sibling *_create_* tools that consume the uploaded file paths.

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?

It gives explicit when-to-use ('only if you want to upload to Magic Hour's storage'), a when-not by routing agents toward existing Magic Hour file paths or stable public URLs, and an alternative fallback ('when in doubt, use the presigned upload flow first'). The MCP guidance section names the ordering constraint relative to the create call.

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