Skip to main content
Glama

kb_attachments_import

Save the actual bytes of a user-provided file reference as a downloadable document attachment. Pass the host-provided file object; the server downloads its public HTTPS URL with a bounded transfer and validates the bytes. Never invent a URL or substitute a description for the file. If the chat host cannot provide a downloadable reference, say so; a client holding local bytes can use kb_attachments_begin_upload. Optional expected_sha256 checks integrity without returning a hash. Returns attachment_uuid; embed alt for an image or label for a file. Active downloadable attachments remain until explicitly archived. Temporary source URLs and provider file IDs are not retained.

Input Schema

NameRequiredDescriptionDefault
fileYesActual host-provided file reference, not file contents or a local path. MIME is advisory; the server sniffs the bytes.
filenameNoOverride the stored filename; required if the host omits file_name.
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 independently computed checksum. A mismatch is refused before storage; no checksum is returned.
include_download_urlNoDefault false. Mint a short-lived (~5 minutes) Brainattic download capability only when needed to fetch the original bytes.

Output Schema

NameRequiredDescriptionDefault
attachmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Even though annotations already set openWorldHint=true and destructiveHint=false, the description adds substantial behavioral context: the server uses a bounded transfer, validates the bytes, refuses on checksum mismatch without returning a hash, does not retain temporary source URLs or provider file IDs, and that active attachments persist until explicitly archived.

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?

The description is dense but front-loaded: the action comes first, then the critical do-not rules, then fallback guidance, optional integrity behavior, return format, and lifecycle. Every sentence adds decision-relevant information with no repetition of schema or annotations.

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 mutation tool with an output schema, this description covers what the agent must know: required host inputs, fallback path, checksum behavior, return value, how to embed the result, and persistence semantics until archive. Nothing essential is missing.

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 already 100%, so the baseline would be 3, but the description adds value by explaining expected_sha256 as an independent integrity check with no returned hash, include_download_url as a short-lived (~5 minute) capability, and the filename override requirement. It doesn't explicitly address tenant_slug or document_id beyond what the schema says.

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?

The first sentence states a precise verb and resource: save the actual bytes of a host-provided file reference as a downloadable document attachment. It also implicitly separates this tool from siblings that handle uploads or plain URLs by specifying that the server itself fetches the host file object's HTTPS URL.

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 description gives clear when-to-use and when-not-to-use guidance: never invent a URL, never substitute a description for the file, and use kb_attachments_begin_upload when the client already has local bytes. It does not explicitly distinguish the very close sibling kb_attachments_import_url, leaving that alternative for the agent to infer.

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.