Get Attachment
keychain_get_attachmentRetrieve file attachments from Bitwarden vault items by specifying item and attachment IDs, returning data in base64 format for secure access.
Instructions
Download an attachment from an item and return it as base64 (bw get attachment).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | ||
| attachmentId | Yes |
Implementation Reference
- src/tools/registerTools.ts:863-883 (handler)Handler for the keychain_get_attachment tool, which uses the KeychainSdk to download an attachment.
`${deps.toolPrefix}.get_attachment`, { title: 'Get Attachment', description: 'Download an attachment from an item and return it as base64 (bw get attachment).', annotations: { readOnlyHint: true }, inputSchema: { itemId: z.string(), attachmentId: z.string(), }, _meta: toolMeta, }, async (input, extra) => { const sdk = await deps.getSdk(extra.authInfo); const attachment = await sdk.getAttachment(input); return { structuredContent: { attachment }, content: [{ type: 'text', text: 'OK' }], }; }, );