Skip to main content
Glama

Upload a document

upload_document_base64

A file the person attached in THIS chat is NOT available to you as bytes — never try to base64-encode it yourself (the call hangs and nothing arrives); use 'request_upload_link' and give the person the link instead. Save a SMALL file (≤2MB decoded) into the caller's personal documents directly from the conversation. Provide 'filename' and 'content_base64' (the file's bytes, base64-encoded). Optional 'mime' (validated against the allowlist — PDF, images png/jpg/gif/webp, Office xlsx/docx/pptx/xls/doc/ppt, text/csv; executables and scripts are refused by magic-byte sniff, not extension) and 'note_id' (auto-link the document to one of the caller's notes). The document lands in the caller's personal tenant and counts toward their document-storage quota. For anything larger than 2MB use 'request_upload_link' instead (a big file's base64 does not fit in the model context). Returns 'web_url' (where the person sees the file: «Особисте → Документи», block «Файли») and 'download_url' (signed, ~15 min) — give the person web_url. Additive; runs the propose→confirm write gate. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filename": "<filename>",
      "content_base64": "<content_base64>"
    },
    "name": "upload_document_base64"
  }
}

Input Schema

NameRequiredDescriptionDefault
mimeNo
note_idNo
filenameYes
content_base64Yes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations: discloses quota consumption, tenant placement, mime validation by magic-byte sniff rather than extension, the propose→confirm write gate with status='confirmation_required', action_id and plan_token, and the ~15-minute signed download URL. Minor gap: it does not say what happens to a previously linked note if the upload is later deleted, nor the failure shape for rejected mime types.

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

Conciseness3/5

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

Nearly every sentence carries substance, but the single dense paragraph mixes format constraints, quota, return values and the confirmation protocol with parentheticals and dashes. The opening sentence is a negative warning about a different failure mode, so the core 'save a file' purpose is not 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?

For a write tool with no output schema, the description covers the essentials an agent needs: input construction, size limit, validation rules, destination and quota effect, the confirmation-gate flow, and the returned 'web_url'/'download_url' with instructions on which one to show the person.

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 description coverage is 0%, so the description carries the full burden and largely does: it explains 'content_base64' as the file's bytes already encoded, 'mime' as validated against a named allowlist, and 'note_id' as auto-linking to one of the caller's notes. It does not address the maxLength caps (255 for filename, 2796204 for content_base64) or why 'note_id' accepts either integer or string.

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 small (≤2MB decoded) file into the caller's personal documents directly from the conversation, with 'filename' and 'content_base64'. It explicitly distinguishes itself from the sibling 'request_upload_link' for anything larger, 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 (small file already in hand as bytes, ≤2MB decoded) and when-not (chat attachments are not available as bytes; anything over 2MB; base64 won't fit in context), and names the alternative tool to use in each excluded case. It warns against a specific failure mode — self-encoding an attachment, which hangs the call.

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