Skip to main content
Glama

Regenerate API key

regenerate_api_key
Destructive

Replaces an API key's secret with a new key that keeps the same name, scope, and monitor. The old key stops working immediately, and the new plaintext key appears only in this result.

Instructions

Requires the admin scope or higher. Replaces an API key's secret: a new key, with a new id and the same name, scope and (for a tracing key) monitor. The old key stops working immediately wherever it is held, including when it is the calling key. No expiry stays no expiry; an expiring key gets a fresh 90 days, capped at the calling key's expiry. Keys the old key created keep working (no cascade). Refused (403, with max_scope) for a key scoped above the caller's. The plaintext key appears only in this result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_key_idYesUUID of the key to regenerate, from list_api_keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.17
    • changedInput schema / properties / api_key_id / description
      Previous value: -"UUID of the key to regenerate. Get it from list_api_keys."New value: +"UUID of the key to regenerate, from list_api_keys."
  2. Addedv0.1.6

TDQS

A4.4/5.0
Behavior5/5

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

Annotations declare destructive/non-idempotent, and the description goes well beyond them: the old key dies immediately (even the calling key), expiry semantics are spelled out (no-expiry stays, expiring gets a fresh 90 days capped at the caller's expiry), no cascade to child keys, and the auth failure mode with the max_scope error. Full behavioral disclosure for a destructive mutation.

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

Conciseness4/5

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

Dense but every clause carries distinct operational information with no filler. Mild penalty for front-loading the auth prerequisite ahead of the action statement, which delays the core purpose by one sentence.

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?

For a single-param destructive mutation with no output schema, the description covers prerequisites, side effects, expiry rules, cascade behavior, error handling, and the fact that the plaintext key is returned only here. Nothing an agent needs to call this safely is missing.

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?

Only one parameter and schema coverage is 100%, so the schema already explains api_key_id as a UUID sourced from list_api_keys. The description adds no additional meaning about the parameter, so the baseline 3 applies.

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 (replaces/regenerates) on a specific resource (an API key's secret) and spells out the resulting object identity: a new key with a new id but the same name, scope and monitor. An agent can distinguish this from create_api_key (new key) and revoke_api_key (removal) purely from the text.

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?

Gives a hard prerequisite ('Requires the admin scope or higher') and an explicit when-not case ('Refused (403, with max_scope) for a key scoped above the caller's'). It never names sibling tools like create_api_key or revoke_api_key as alternatives, so routing is inferred rather than stated.

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