Skip to main content
Glama

Delete Items

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
NameRequiredDescriptionDefault
idsYes
permanentNo

Implementation Reference

  • 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;
      });
    }
  • 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}.` },
          ],
        };
      },
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that deletion can be soft or hard (permanent=true), which is valuable behavioral context. However, it doesn't mention authentication requirements, rate limits, error conditions, what 'per-id results' means, or whether deletion is reversible. For a destructive operation with no annotations, more behavioral details would be expected.

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 extremely concise (two sentences) with zero wasted words. It's front-loaded with the core purpose, followed by important behavioral detail about soft/hard deletion. Every sentence earns its place by providing essential information.

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

Completeness3/5

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

For a destructive tool with no annotations and no output schema, the description provides basic but incomplete coverage. It explains the deletion behavior (soft/hard) and parameter purposes, but lacks information about authentication, error handling, what 'per-id results' contains, and doesn't differentiate from sibling deletion tools. Given the complexity of a batch deletion operation, more completeness would be expected.

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

Parameters4/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 explains that 'ids' parameter accepts multiple item IDs (1-200 items) and that 'permanent' controls hard vs soft deletion. This adds meaningful semantics beyond the bare schema. However, it doesn't explain ID format or provide examples of valid IDs.

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 ('Delete multiple items by id') and resource ('items'), making the purpose immediately understandable. It distinguishes from sibling 'keychain_delete_item' by specifying 'multiple items' versus single item deletion. However, it doesn't specify what type of items (e.g., logins, cards, notes) are being deleted, which would make it more specific.

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?

The description provides no guidance on when to use this tool versus alternatives like 'keychain_delete_item' (single item deletion) or 'keychain_delete_folder' (folder deletion). It mentions 'soft-delete by default' but doesn't explain what soft delete means or when to use permanent deletion. No prerequisites or contextual usage information is provided.

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