keychain_get_collection
Retrieve a specific Bitwarden collection by its ID to access grouped vault items. Use this tool to fetch collection details from your secure password manager.
Instructions
Get a collection by id (bw get collection).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| organizationId | No |
Implementation Reference
- src/sdk/keychainSdk.ts:1414-1427 (handler)The implementation of `getCollection` which calls `bw get collection`.
async getCollection(input: { id: string; organizationId?: string; }): Promise<unknown> { return this.bw.withSession(async (session) => { const args: string[] = ['get', 'collection', input.id]; if (input.organizationId) args.push('--organizationid', input.organizationId); const { stdout } = await this.bw.runForSession(session, args, { timeoutMs: 60_000, }); return this.parseBwJson(stdout); }); } - src/tools/registerTools.ts:679-698 (registration)The registration of the `get_collection` tool.
`${deps.toolPrefix}.get_collection`, { title: 'Get Collection', description: 'Get a collection by id (bw get collection).', annotations: { readOnlyHint: true }, inputSchema: { id: z.string(), organizationId: z.string().optional(), }, _meta: toolMeta, }, async (input, extra) => { const sdk = await deps.getSdk(extra.authInfo); const collection = await sdk.getCollection(input); return { structuredContent: { collection }, content: [{ type: 'text', text: 'OK' }], }; }, );