Skip to main content
Glama

Generate a TOTP/HOTP one-time code

generate_totp
Read-onlyIdempotent

Compute RFC 4226/6238 one-time passcodes from a base32 secret. Supports 6/8 digits, SHA1/SHA256/SHA512, and custom periods.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "secret": "<secret>"
    },
    "name": "generate_totp"
  }
}

Input Schema

NameRequiredDescriptionDefault
atNoUnix time in milliseconds; defaults to now
modeNototp
digitsNo
periodNoTOTP period in seconds
secretYesBase32 TOTP/HOTP secret
counterNoHOTP counter
algorithmNoSHA1

Output Schema

NameRequiredDescriptionDefault
codeYes
modeYes
digitsYes
periodYes
algorithmYes
secondsRemainingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds that codes are computed locally from a secret rather than fetched, but says nothing about invalid-secret handling, secret sensitivity, or how output changes when 'at' advances.

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 tight sentences, capability-first, with zero filler. Every clause maps to a real configurable dimension of the tool.

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?

An output schema and annotations carry much of the load, but for a 7-parameter crypto tool the description omits the TOTP-vs-HOTP distinction (that HOTP needs a counter and ignores period) and any note on time windows or clock skew. That gap matters for correct 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 coverage is 57%; the description restates the option space for digits, algorithm and period that the schema already enumerates, and never mentions the mode (totp/hotp) or counter parameters, which are the ones most likely to be misused. Useful as a summary but adds little semantics beyond the schema.

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?

States a specific verb ('Compute') and resource ('RFC 4226/6238 one-time passcodes') and pins the input format ('base32 secret'). The standards references make it unmistakable against siblings like generate_password or generate_uuid, which produce different artifacts.

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

Usage Guidelines3/5

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

Use is implied by the RFC references and the 'one-time passcode' framing, but there is no explicit statement of when to pick this over a sibling, nor any guidance on when to choose totp vs hotp mode or which algorithm to use. No exclusions or prerequisites are given.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.