Skip to main content
Glama

keychain_restore_item

Recover deleted items from your Bitwarden vault by specifying their unique ID to restore access to stored credentials.

Instructions

Restore an item from trash by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The `restoreItem` function in `KeychainSdk` handles the logic to restore a Bitwarden item from trash using `bw restore item`.
    async restoreItem(input: { id: string; reveal?: boolean }): Promise<unknown> {
      return this.bw.withSession(async (session) => {
        if (this.syncOnWrite()) {
          await this.bw
            .runForSession(session, ['sync'], { timeoutMs: 120_000 })
            .catch(() => {});
        }
    
        const { stdout } = await this.bw.runForSession(
          session,
          ['restore', 'item', input.id],
          { timeoutMs: 60_000 },
        );
        // restore may not return JSON; ignore stdout and refetch.
        void stdout;
    
        const { stdout: gotOut } = await this.bw.runForSession(
          session,
          ['get', 'item', input.id],
          { timeoutMs: 60_000 },
        );
        return this.maybeRedact(JSON.parse(gotOut) as AnyRecord, input.reveal);
      });
    }
  • Tool registration for `keychain_restore_item` (labeled as `.restore_item` internally).
      `${deps.toolPrefix}.restore_item`,
      {
        title: 'Restore Item',
        description: 'Restore an item from trash by id.',
        inputSchema: {
          id: z.string(),
        },
        _meta: toolMeta,
      },
      async (input, extra) => {
        if (isReadOnly) return readonlyBlocked();
        const sdk = await deps.getSdk(extra.authInfo);
        const item = await sdk.restoreItem(input);
        return {
          structuredContent: { item },
          content: [{ type: 'text', text: 'Restored.' }],
        };
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/icoretech/warden-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server