keychain_delete_items
Remove multiple stored items from a password manager vault by specifying their IDs, with options for temporary or permanent deletion.
Instructions
Delete multiple items by id. Returns per-id results (soft-delete by default; set permanent=true to hard delete).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | ||
| permanent | No |
Implementation Reference
- src/sdk/keychainSdk.ts:1131-1163 (handler)Implementation of 'deleteItems' that deletes multiple vault items in a single session.
async deleteItems(input: { ids: string[]; permanent?: boolean; }): Promise<Array<{ id: string; ok: boolean; error?: string }>> { if (input.ids.length === 0) return []; if (input.ids.length > 200) throw new Error('Too many ids (max 200)'); // Run inside a single session lock to avoid re-syncing/unlocking per item. return this.bw.withSession(async (session) => { if (this.syncOnWrite()) { await this.bw .runForSession(session, ['sync'], { timeoutMs: 120_000 }) .catch(() => {}); } const results: Array<{ id: string; ok: boolean; error?: string }> = []; for (const id of input.ids) { try { const args = ['delete', 'item', id]; if (input.permanent) args.push('--permanent'); await this.bw.runForSession(session, args, { timeoutMs: 60_000 }); results.push({ id, ok: true }); } catch (e) { results.push({ id, ok: false, error: e instanceof Error ? e.message : String(e), }); } } return results; }); } - src/tools/registerTools.ts:767-790 (registration)Registration and handler for the 'delete_items' tool.
`${deps.toolPrefix}.delete_items`, { title: 'Delete Items', description: 'Delete multiple items by id. Returns per-id results (soft-delete by default; set permanent=true to hard delete).', inputSchema: { ids: z.array(z.string()).min(1).max(200), permanent: z.boolean().optional(), }, _meta: toolMeta, }, async (input, extra) => { if (isReadOnly) return readonlyBlocked(); const sdk = await deps.getSdk(extra.authInfo); const results = await sdk.deleteItems(input); const okCount = results.filter((r) => r.ok).length; return { structuredContent: { results, okCount, total: results.length }, content: [ { type: 'text', text: `Deleted ${okCount}/${results.length}.` }, ], }; }, );