Skip to main content
Glama

upload_file

Upload files to Mediagraph via local path or base64 data, supporting one-shot, batch, or contribution sessions. Automatically uses multipart for files over 16 MiB.

Instructions

Upload a file to Mediagraph. Two body modes (file_path or file_data) and three session modes:

Body modes:

  1. Local file: Provide file_path for files on the user's local filesystem

  2. Direct upload: Provide file_data (base64-encoded) with filename for files from other sources

Session modes (mutually exclusive):

  • Default: a fresh one-shot upload session is created and finalized for this single file.

  • upload_guid: append to an existing session created via create_upload_session. The session is NOT finalized; call set_upload_done when your batch is complete.

  • contribution_id: upload via a contribution's configured destination (storage folder / lightbox).

Files >16 MiB automatically use S3 multipart upload (parallel parts, retry per part); smaller files go through a single signed PUT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoFilename with extension (required when using file_data)
file_dataNoBase64-encoded file content (use this when file_path is not available)
file_pathNoAbsolute path to the file on the local filesystem
upload_guidNoAppend to an existing upload session (from create_upload_session). Caller is responsible for finalizing with set_upload_done.
contribution_idNoOptional: ID of a contribution (upload link). Mutually exclusive with upload_guid.
Behavior4/5

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

With no annotations, the description carries the full transparency burden. It discloses important behaviors: session finalization in default mode, non-finalization with upload_guid, and automatic S3 multipart upload for files >16 MiB. It could also mention return values or error handling, but the provided behavior is detailed and non-misleading.

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 well-structured with clear sections for body modes, session modes, and the multipart note. Each sentence adds necessary detail, and the formatting with numbered lists enhances readability without being verbose or redundant.

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?

The description covers the complex parameter interactions and session modes thoroughly, including the >16 MiB multipart behavior. However, no output schema is present, and the description does not mention the response format or error cases, leaving a small gap in completeness for a tool with this complexity.

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?

Despite 100% schema coverage, the description adds significant meaning to parameters: explaining that file_path is for local files and file_data requires filename, clarifying mutual exclusivity of upload_guid and contribution_id, and describing what happens in the default session mode. This goes well beyond the schema's parameter descriptions.

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 to Mediagraph and differentiates body modes and session modes. It distinguishes the singular upload_file from siblings like upload_files and create_upload_session by explicitly describing its one-shot and session-append capabilities.

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?

The description provides explicit usage guidance: when to use file_path vs file_data, when to use each session mode, and that modes are mutually exclusive. It references related tools (create_upload_session, set_upload_done) and explains the lifecycle consequences, making it clear when to choose this tool over alternatives.

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/mediagraph-io/mediagraph-mcp'

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