Skip to main content
Glama

Get TOTP

keychain_get_totp
Read-only

Retrieve the current TOTP code for a vault item by search term. Optionally reveal the secret value, subject to redaction settings.

Instructions

Get the current TOTP code by search term (bw get totp). The value is null unless reveal=true, and NOREVEAL or KEYCHAIN_NOREVEAL can still force redaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesSearch term or exact item id used for bw get totp.
revealNoWhether secret values are returned; default false and can be forced false by NOREVEAL.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.2.35
    • removedOutput schema / properties / result / properties / period / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / result / properties / period / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / result / properties / timeLeft / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / result / properties / timeLeft / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / result / properties / value / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / result / properties / value / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. Changed3 schema fields changedv0.2.19
    • addedInput schema / properties / reveal / description
      Added value: +"Whether secret values are returned; default false and can be forced false by NOREVEAL."
    • addedInput schema / properties / term / description
      Added value: +"Search term or exact item id used for bw get totp."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "result": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "kind": {
      +          "const": "totp",
      +          "type": "string"
      +        },
      +        "period": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "revealed": {
      +          "type": "boolean"
      +        },
      +        "timeLeft": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "value": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "kind",
      +        "value",
      +        "revealed",
      +        "period",
      +        "timeLeft"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "type": "object"
      +}
  3. Addedv0.1.20

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description discloses a key behavioral nuance: the value is null unless reveal=true, and NOREVEAL/KEYCHAIN_NOREVEAL can still force redaction. This is valuable context that the annotation alone does not convey.

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?

Two focused sentences, front-loaded with the core purpose and followed by the most important behavioral caveat. No wasted words.

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

Completeness5/5

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

Given the simple two-parameter schema, readOnly annotation, and available output schema, this description covers the essential invocation behavior and redaction caveat. Nothing critical is missing for an agent to use it correctly.

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 coverage is 100%, so the schema already documents both parameters. The description adds meaning by explaining the conditional null behavior tied to reveal and the environment variable redaction, going beyond the schema's default description.

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

Purpose5/5

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

The description clearly states the action (Get), the resource (current TOTP code), and the lookup method (by search term). It also references the underlying 'bw get totp' command, distinguishing it from sibling getter tools.

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

Usage Guidelines4/5

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

The description provides clear context for when this tool is used: to retrieve a TOTP code by search term. It does not explicitly name alternatives or exclusions, but the purpose is unambiguous and the sibling getter tools are already differentiated by resource type.

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