Skip to main content
Glama

upload_file

Upload a file into a Files surface (kind='files'). Provide the bytes inline as base64 in content_base64 (a bare base64 string or a data: URL), capped ~3 MB — the request-body limit; a fetch-URL path for larger files is coming. The server sniffs the MIME from magic bytes (don't trust the extension), enforces an allowlist, sanitizes SVGs, strips EXIF from images, and counts the bytes against your plan's storage quota. Returns the created file's {id, name, size, mimeType, parentFolderId, createdAt}. surface_slug is required (use list_surfaces to find the files surface); parent_folder_id defaults to the surface root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mimeNoOptional MIME hint. The server still sniffs magic bytes; this only helps for extension-less or ambiguous content.
slugYesThe workspace slug (bare or org-prefixed).
filenameYesThe file's name, including extension (e.g. "report.pdf").
surface_slugYesThe Files surface slug to upload into (required).
content_base64NoThe file bytes, base64-encoded. Accepts a bare base64 string or a "data:<mime>;base64,..." data URL. ~3 MB cap. Provide this OR `url`, not both.
parent_folder_idNoOptional folder id (from list_files) to place the file in. Defaults to the surface root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and succeeds: it discloses MIME sniffing via magic bytes, allowlist enforcement, SVG sanitization, EXIF stripping, and storage-quota accounting. It also states the returned field set, making side effects and return behavior clear.

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?

Every sentence contributes: core action, input constraints, server-side behavior, return shape, and parameter requirements are each covered without repetition. The most important scoping and constraint information is front-loaded.

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 no output schema, the description includes the exact returned fields. It covers prerequisites (list_surfaces, list_files), size limits, required vs optional parameters, and server transformations, so an agent has what it needs to call 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?

Schema coverage is 100%, and the description still adds value: it explains the content_base64 encoding forms and size cap, that surface_slug is required and how to find it, and that parent_folder_id defaults to the surface root. It also clarifies the mime parameter's limited role as a hint.

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: 'Upload a file into a Files surface (kind="files")'. The 'kind="files"' qualifier disambiguates the target from other surfaces, and the operation is distinct from sibling creation/list tools like create_surface and list_files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear usage context: bytes go inline as base64, the size cap is ~3 MB, and users should locate the files surface via list_surfaces. It does not explicitly state when-not-to-use or name an alternative, but the only stated alternative (fetch-URL path) is described as forthcoming.

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.