Skip to main content
Glama

files_upload

Upload a file to DialogBrain and get a file_id for use in messages_send.

When to use:

  • User wants to send a file/image to a contact

  • Before calling messages_send with an attachment

For a file that already exists on disk, use files_create_upload_url instead: content here travels through the conversation twice (once read, once written back), so it is only sensible up to about 50 KB. source_url is fine at any size — the fetch happens server-side.

Returns: file_id (integer) to pass to messages_send attachments parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoOptional display title
contentNoBase64-encoded file bytes. Suitable up to ~50 KB — above that the encoded bytes cost more context than the task; use files_create_upload_url for a local file, or source_url for a remote one. Either content OR source_url is required.
filenameNoFilename with extension (e.g. 'photo.png')upload
mime_typeNoMIME type (e.g. 'image/png', 'application/pdf')application/octet-stream
source_urlNoPublic URL to fetch file from. Either content OR source_url is required.
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  2. Added
  3. Removed
  4. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false). The description adds genuine context beyond that: the ~50 KB practical ceiling on `content` and the reason (double context cost), plus that `source_url` avoids it because the fetch is server-side. It stops short of covering duplicate-upload behavior or retention, so not 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.

Conciseness5/5

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

Front-loaded with the action and return value, then grouped when-to-use bullets, then the size caveat, then a one-line returns note. No sentence is redundant and the decision-relevant constraint (50 KB) is easy to find.

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 states the return contract (file_id integer, to be passed as an attachment to messages_send). Combined with the annotations covering the safety profile and 100% schema coverage, an agent has everything needed to call it correctly.

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%, so the baseline is 3 and the schema already documents all six parameters. The description still adds value by explaining the content-vs-source_url size tradeoff and the rationale for the 50 KB guidance, which is meaning the schema only gestures at.

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+resource ('Upload a file to DialogBrain') and names the output artifact (file_id) it produces. It explicitly distinguishes itself from the sibling files_create_upload_url, so an agent can route correctly 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 bullets (send a file to a contact, precede messages_send with an attachment) and an explicit when-not: for an on-disk file, use files_create_upload_url because content round-trips through the conversation. The alternative and the condition selecting it are both 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.