Skip to main content
Glama

Upload A File To Hedra

hedra_upload_file

Upload an image, video, or audio file to Hedra to get a temporary presigned URL for use as media input in AI generation jobs. Accepts local file paths, HTTPS URLs, or base64-encoded data.

Instructions

Upload a file (image, video, or audio) to Hedra and get back a short-lived presigned URL to use as a media input in hedra_submit_job (e.g. a start_image, a reference image, a voice-cloning audio sample).

Free — works even with $0.00 in the API wallet; funding is only enforced at job submission. The returned url expires 1 hour after upload; if it lapses before you submit, upload again.

Provide EXACTLY ONE source:

  • file_path: a path readable on the machine running this MCP server.

  • source_url: an https URL Hedra should fetch and re-upload (a plain external URL is NOT accepted directly by model inputs — it must go through this upload step first).

  • base64_data + filename: raw bytes inline, for clients that can't provide a local path or URL.

Returns: JSON {url, content_type, expires_at}. Pass this straight into a model's input as {"source":"url","url":} for the appropriate field (per hedra_get_model_input_schema).

Examples:

  • Use when: about to run an image-to-video model and need to upload the start frame first

  • Use when: cloning a voice from an audio sample the person uploaded

  • Don't use when: reusing a previous Hedra generation's output as input — pass {"source":"asset","asset_id":...} directly to hedra_submit_job instead, no re-upload needed

Error Handling:

  • "Error: file not found at " if file_path doesn't exist on the server's filesystem.

  • "Error [MODERATION_FAILED]..." can occur later at submit time if the uploaded content is refused, not at upload time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoFilename to use, required when base64_data is provided; optional otherwise.
file_pathNoPath to a file readable on the MCP server's filesystem.
source_urlNoAn https URL to fetch and re-upload to Hedra.
base64_dataNoRaw file bytes, base64-encoded. Requires filename.
Behavior5/5

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

Goes well beyond annotations by disclosing the 1-hour URL expiry, the fact that moderation failures happen later at submit time, and specific error message formats. It adds meaningful context about what the tool does and does not do at upload time.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

The description is thorough but well-structured with clear sections for usage, examples, and error handling. Every sentence provides actionable information without fluff, and the length is justified by the complexity of the tool.

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?

Despite lacking an output schema, the description documents the exact return JSON shape ({url, content_type, expires_at}) and how to pass it to model inputs. Combined with examples and error handling, the description fully equips an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even though the schema already describes all parameters, the description adds crucial semantics: exactly one source must be provided, file_path must be readable on the MCP server, source_url must be https and fetched/re-uploaded, and base64_data requires filename. This clarifies relationships and constraints not obvious from the schema alone.

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 clearly states the tool uploads a file (image, video, or audio) to Hedra and returns a presigned URL for use in hedra_submit_job. It distinguishes itself from siblings by explicitly contrasting with reuse of existing assets and specifying its role as a prerequisite for media submissions.

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?

Provides explicit when-to-use examples (image-to-video start frame, voice cloning sample) and a clear when-not-to-use case with an alternative (passing asset_id directly to hedra_submit_job). Also states the free-tier behavior, which helps decide when this step is necessary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HemanthDonga/hedra-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server