Skip to main content
Glama

Encode

keychain_encode
Read-only

Base64-encode strings for secure storage in Bitwarden vaults, enabling AI agents to manage encrypted data through the Warden MCP Server.

Instructions

Base64-encode a string (bw encode).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes

Implementation Reference

  • Implementation of the encode logic, which wraps `bw encode` to base64-encode input.
    async encode(input: { value: string }): Promise<{ encoded: string }> {
      // `bw encode` base64-encodes stdin.
      const { stdout } = await this.bw.withSession(async (session) => {
        return this.bw.runForSession(session, ['encode'], {
          stdin: `${input.value}\n`,
          timeoutMs: 30_000,
        });
      });
      return { encoded: stdout.trim() };
    }
  • Registration of the keychain_encode tool (aliased as keychain.encode).
    registerTool(
      `${deps.toolPrefix}.encode`,
      {
        title: 'Encode',
        description: 'Base64-encode a string (bw encode).',
        annotations: { readOnlyHint: true },
        inputSchema: {
          value: z.string(),
        },
        _meta: toolMeta,
      },
      async (input, extra) => {
        const sdk = await deps.getSdk(extra.authInfo);
        const encoded = await sdk.encode(input);
        return {
          structuredContent: encoded,
          content: [{ type: 'text', text: 'OK' }],
        };
      },
    );
Behavior3/5

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

The description adds minimal behavioral context beyond the annotations. The annotation 'readOnlyHint: true' already indicates a safe read operation, and the description doesn't contradict this. However, it doesn't disclose additional traits like rate limits, error handling, or output format, missing opportunities to enrich the agent's understanding.

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—a single sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficient, with every part contributing to clarity, making it easy for an agent to parse quickly.

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?

Given the tool's low complexity (one parameter, no output schema, read-only annotation), the description is minimally adequate. It covers the basic purpose but lacks details on usage, behavioral nuances, or parameter meaning, which could hinder the agent in more complex scenarios despite the simple structure.

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?

With 0% schema description coverage and one parameter ('value'), the description doesn't add any semantic details about the parameter beyond what the schema provides (type: string). It doesn't explain what 'value' represents, its constraints, or examples, leaving the schema to carry the full burden. Baseline 3 is appropriate as the schema is simple and complete.

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 ('Base64-encode') and the resource ('a string'), with the parenthetical '(bw encode)' providing additional context about the tool's origin or format. It distinguishes itself from sibling tools by focusing on encoding rather than CRUD operations on keychain items, though it doesn't explicitly contrast with similar encoding tools if any exist.

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. The description lacks context about prerequisites, typical use cases, or comparisons to other encoding methods or sibling tools, leaving the agent without explicit usage instructions.

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