keychain_get_totp
Retrieve TOTP codes or seeds from Bitwarden vaults using search terms to generate time-based one-time passwords for secure authentication.
Instructions
Get a TOTP code/seed by search term (bw get totp). Returning a TOTP requires reveal=true.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | ||
| reveal | No |
Implementation Reference
- src/tools/registerTools.ts:1184-1210 (handler)The tool `${deps.toolPrefix}.get_totp` is registered here, and its handler implementation directly follows. It interacts with the `sdk.getTotp` method. Note: The tool registration uses the prefix `deps.toolPrefix`, so the final name is `keychain_get_totp` assuming `toolPrefix` is `keychain`.
`${deps.toolPrefix}.get_totp`, { title: 'Get TOTP', description: 'Get a TOTP code/seed by search term (bw get totp). Returning a TOTP requires reveal=true.', annotations: { readOnlyHint: true }, inputSchema: { term: z.string(), reveal: z.boolean().optional(), }, _meta: toolMeta, }, async (input, extra) => { const sdk = await deps.getSdk(extra.authInfo); const totp = await sdk.getTotp( { term: input.term }, { reveal: effectiveReveal(input) }, ); return { structuredContent: toolResult('totp', totp.value, totp.revealed, { period: totp.period, timeLeft: totp.timeLeft, }), content: [{ type: 'text', text: 'OK' }], }; }, );