Skip to main content
Glama

Restore Item

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.' }],
        };
      },
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool restores from trash, implying a mutation (write operation) that changes item state. However, it lacks details on permissions needed, side effects (e.g., if restoration affects other items), error conditions, or response format. This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with no annotations, 1 parameter at 0% schema coverage, and no output schema), the description is incomplete. It lacks behavioral details (e.g., success/failure outcomes), parameter specifics, and usage context, making it inadequate for safe and effective agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions the parameter 'id' as the means to restore, adding meaning beyond the bare schema. However, it doesn't specify the id format (e.g., numeric, UUID) or source, leaving ambiguity. The description provides basic semantics but insufficient detail for full clarity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Restore') and resource ('item from trash'), specifying it's done 'by id'. It distinguishes from siblings like 'keychain_delete_item' (opposite action) and 'keychain_get_item' (read vs. restore). However, it doesn't explicitly differentiate from potential restore-related siblings, though none are listed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., item must be in trash), exclusions, or related tools like 'keychain_delete_item' for context. The description is purely functional without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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