Skip to main content
Glama

regenerate_api_key

Destructive

Rotate an API key's secret: the old key stops working immediately, while a new key with the same name and permissions is created for you.

Instructions

Requires an API key with the admin scope or higher. Replace an API key's secret: a new key with the same name, scope and, for a tracing key, the same monitor is created, and THE OLD KEY STOPS WORKING IMMEDIATELY, in every job, exporter, dotfile and agent that still holds it. If it is the key you are calling with, your next call fails until you switch to the new one. The new key has a NEW id. A key that never expired still never expires; one that had an expiry gets a fresh 90 days, capped at your own key's expiry. Unlike revoke_api_key this does not cascade: keys the old key created keep working. Refused (403, with max_scope) for a key with a higher scope than yours. The plaintext key is returned ONCE and cannot be retrieved again: write it where the old one was used, and never echo it back to the person.

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.6

TDQS

A4.4/5.0
Behavior5/5

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

The description is exceptionally transparent about behavioral consequences: the old key stops working immediately, the new key has a new ID, expiry handling is detailed, and it warns about the plaintext being returned only once. It also covers the 403 error case. This far exceeds the annotations (which only indicate destructiveHint), adding crucial context for safe usage.

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?

The description is lengthy but every sentence carries essential information, front-loaded with the admin requirement and the immediate impact on the old key. It is dense but not padded, and the structure flows logically from prerequisite to effects to exceptions.

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 destructive nature and absence of an output schema, the description covers everything needed: return behavior (plaintext once), error conditions, scope checks, and the impact on other systems. No critical operational detail 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?

Schema coverage is 100% for the single parameter, and the schema description already explains how to get the key ID via list_api_keys. The tool description adds no additional meaning about the parameter itself, which is acceptable given the high coverage. The baseline of 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?

The description states the core purpose explicitly: 'Replace an API key's secret' with precise details about preserving name, scope, and monitor for tracing keys. It clearly distinguishes from siblings like revoke_api_key (cascade vs. no cascade) and create_api_key (new vs. regenerated).

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 a clear prerequisite (admin scope or higher) and explicitly contrasts with revoke_api_key, noting it does not cascade. While it doesn't mention create_api_key as an alternative for brand-new keys, the context implies regeneration is for existing keys. It gives practical guidance on when this tool is appropriate.

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