Skip to main content
Glama

Get Attachment

keychain_get_attachment
Read-only

Download a parent item's attachment as raw bytes in contentBase64, including filename and byte count. Pass itemId and attachmentId, or an unambiguous filename selector, to decode the file locally.

Instructions

Download an attachment from a parent item and return raw bytes as contentBase64. NOREVEAL blocks downloads. Pass itemId plus an attachment id, or an unambiguous filename selector resolved from the item metadata before calling bw get attachment. The response includes filename, byte count, and base64 content for local decoding. If the expected attachment filename is missing from keychain_get_item metadata, run keychain_sync and keychain_get_item again before retrying.

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": {
      "itemId": "<itemId>",
      "attachmentId": "<attachmentId>"
    },
    "name": "keychain_get_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemIdYesParent Bitwarden item id for attachment or item-specific operations.
attachmentIdYesAttachment id returned by item metadata, or an unambiguous filename selector for downloads.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.19
    • addedInput schema / properties / attachmentId / description
      Added value: +"Attachment id returned by item metadata, or an unambiguous filename selector for downloads."
    • addedInput schema / properties / itemId / description
      Added value: +"Parent Bitwarden item id for attachment or item-specific operations."
  2. Addedv0.1.20

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description carries most of the burden and does so well: it discloses the NOREVEAL access-control blocker, the base64 payload that must be decoded locally, and the response fields (filename, byte count, content). It does not cover size limits, large-attachment behavior, or error modes beyond the missing-filename case.

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?

Four sentences, front-loading the action and output format before prerequisites and the recovery path. Dense but every sentence carries operational information; the metadata-resolution clause is slightly redundant with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description steps in to describe the return payload, and it covers the prerequisite metadata call and the retry path. An agent could call this correctly from the description alone; only edge behaviors like payload-size handling are absent.

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% and both parameters are already documented, including the dual id-or-filename meaning of attachmentId. The description restates that dual mode rather than adding new syntax or format constraints, so it sits at the baseline.

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 (download an attachment from a parent item) and immediately specifies the return encoding (raw bytes as contentBase64). That distinguishes it cleanly from the create/delete attachment siblings without needing their schemas.

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?

Gives concrete calling conditions: pass itemId plus an attachment id, or an unambiguous filename selector resolved from item metadata. It also prescribes a fallback workflow (run keychain_sync then keychain_get_item when the filename is absent from metadata) and flags that NOREVEAL blocks downloads. It stops short of explicitly saying when to prefer keychain_get_item metadata instead of a download.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.