Skip to main content
Glama

Upload a file

upload_file

Save a file to the workspace's Media Library, for a run that reads a file link or a gateway spec too big to paste. Pass content (text, e.g. CSV or JSON) or content_base64, up to 4 MB. For a bigger file, get_upload_link first, send the file there, then call this with its upload_id. The answer has file_id and a file_url (valid 24 hours) to pass as a run input.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentNoThe file's text.
file_nameNoWith its extension, e.g. leads.csv or openapi.yaml.
upload_idNoFrom get_upload_link, after the file was sent.
content_base64NoThe file's bytes in base64, for binary files such as PDF or XLSX.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare write semantics, non-idempotency and that the tool is not destructive; the description adds real behavioral context on top: a 4 MB payload ceiling and the fact that the returned file_url expires after 24 hours. It does not say what happens on a duplicate file_name or whether an existing Media Library entry is replaced, which would matter for a non-idempotent write.

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?

Three tight sentences: purpose first, then payload limit, then the oversized-file path, then the return contract. Every clause carries information and nothing is repeated from the schema.

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?

There is no output schema, and the description compensates by naming file_id and the 24-hour file_url, which is exactly what an agent needs to chain into a run input. It stops short only on edge cases such as overwrite behavior and required permissions for a non-readOnly write.

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 already 100%, so the baseline is 3, but the description goes further by explaining the choice between content (text, CSV/JSON) and content_base64 (binary such as PDF or XLSX), and by tying upload_id to the get_upload_link handshake. That is decision-relevant meaning the schema alone does not convey.

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 ("Save a file to the workspace's Media Library") and immediately scopes the intended use case (a run that reads a file link, or a gateway spec too big to paste). It names the sibling it is not — get_upload_link — so an agent can separate the two without opening either 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 conditions and a complete alternative path for oversized files: get_upload_link first, send the file there, then call this with its upload_id. The two routes are mutually exclusive and the threshold (4 MB) that selects between them is stated.

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