Skip to main content
Glama

kb_attachments_begin_upload

Begin a short-lived direct attachment upload for a client that can transfer local file bytes. Provide document_id and the original filename; optionally provide expected_sha256. The result contains an HTTPS upload_url ending in #token=. The fragment is local to the client and is never sent to the server: extract its token and POST the raw file bytes with Content-Type: application/octet-stream and Authorization: Bearer . Send no multipart envelope; upload_url is the endpoint, not a file field, not the fragment. The capability expires in five minutes and succeeds once. The returned size limit is authoritative. Never put the token in a path, query, tool argument, or log.

Input Schema

NameRequiredDescriptionDefault
filenameYesOriginal filename including extension
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.
expected_sha256NoOptional SHA-256 hex digest of the exact file bytes (64 hexadecimal characters).

Output Schema

NameRequiredDescriptionDefault
expires_atYes
upload_urlYes
max_size_bytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that the capability is short-lived (five minutes), single-use, that the returned size limit is authoritative, and gives a security constraint (never put the token in a path, query, argument, or log). It also clarifies the fragment-vs-server subtlety, which no annotation or schema field conveys.

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?

Dense and front-loaded, leading with the purpose before the protocol. The multiple imperative clauses about the token and multipart envelope are slightly repetitive, but each carries operational weight and none is filler.

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 an output schema existing, the description still explains the meaningful shape of the result (upload_url with #token fragment, authoritative size limit), which an agent needs to act correctly. It covers authentication, idempotency, expiry, and the non-multipart wire format — nothing needed to invoke correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all four parameters including the conditional tenant_slug behavior. The description only restates that document_id and filename are required and expected_sha256 optional, adding essentially no semantic detail beyond the structured fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (begin a direct attachment upload) and adds a scope qualifier — 'for a client that can transfer local file bytes' — which implicitly separates it from siblings like kb_attachments_upload and kb_attachments_import_url. It does not name those siblings outright, so an agent must infer the routing, but the core purpose is unambiguous.

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?

The qualifier 'for a client that can transfer local file bytes' gives a clear selection condition and the description spells out the full follow-up procedure (extract fragment token, POST raw bytes). It stops short of explicitly naming the alternative tool for clients that cannot transfer bytes, leaving that inference to the agent.

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.