Skip to main content
Glama

kb_attachments_upload

Upload a small file you already hold as text or bytes, up to 64 KiB. Supply exactly one of content_text or content_base64. Never invent file bytes or write out base64 for a photo or a file shown in chat. Use kb_attachments_import for a real downloadable file reference, or kb_attachments_begin_upload for a client that can transfer local bytes directly. When neither is available, give the user the document permalink, ask them to open it and use Attach, then call kb_attachments_list. The web file limit is deployment-configured; an inline refusal states the live limit. Returns attachment_uuid: embed as alt or label. Unreferenced inline uploads are eventually swept; active downloadable uploads remain until explicitly archived.

Input Schema

NameRequiredDescriptionDefault
filenameYesOriginal filename including extension
mime_typeYesMIME type (server-side sniffed and validated)
document_idYesDocument to attach the file to
tenant_slugNoTenant slug to target. Required when your token grants several workspaces; omit when it grants one. If you omit it with several, the refusal names your default workspace; call kb_tenants_list to see every workspace the token grants.
content_textNoUTF-8 text you already hold, at most 64 KiB encoded (CSV, Markdown, JSON, plain text).
content_base64NoBase64 of a small binary you already hold as bytes, at most 64 KiB decoded. For photos or user files use import or a direct upload session.
include_download_urlNoMint a short-lived Brainattic download capability for the original uploaded bytes (default false). The capability is unauthenticated and valid for about 5 minutes — anyone who obtains it can fetch the file — so ask for it only when you will download the bytes. To embed the attachment in a document, use attachment_uuid instead.

Output Schema

NameRequiredDescriptionDefault
attachmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare non-read-only, non-idempotent, non-destructive, but the description adds substantial context beyond them: the size ceiling, that the web limit is deployment-configured and surfaced in the refusal message, that the server sniffs MIME types, and a lifecycle rule distinguishing swept unreferenced inline uploads from retained downloadable uploads.

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

Conciseness4/5

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

Front-loaded with the verb, the payload constraint and the exclusivity rule before the routing guidance, and every sentence carries actionable content. It is a dense, unbroken paragraph for a tool with this much conditional behavior, which costs some scannability but not correctness.

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?

With an output schema present the description need not enumerate return fields, yet it still tells the agent what the key return value (attachment_uuid) is for and how to embed it. Combined with the size limits, fallback path and retention behavior, an agent has everything needed to call this correctly or route elsewhere.

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 baseline is 3, but the description adds real meaning the schema cannot express: content_text and content_base64 are mutually exclusive and exactly one is required. It also explains how to use the returned attachment_uuid for embedding and warns that include_download_url mints an unauthenticated capability, which the schema only hints at with a default.

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 plus the hard constraint that defines the tool: 'Upload a small file you already hold as text or bytes, up to 64 KiB.' It immediately differentiates itself from kb_attachments_import and kb_attachments_begin_upload by naming both as alternatives for the cases this tool does not cover.

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 an explicit selection rule ('Supply exactly one of content_text or content_base64'), names both alternatives with the condition that selects each, and supplies a fallback procedure (permalink, ask user to Attach, then kb_attachments_list) for the residual case. This is a full when/when-not/alternative decision tree.

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.