Skip to main content
Glama

rotate_key

Rotate an API key, optionally keeping the old key valid for up to 1,440 minutes.

Creates a new key with the same name, scopes, and rate limits. The new key is returned once — store it immediately.

Requires: API key with write scope.

Args: key_id: UUID of the API key to rotate (get from whoami())

Returns: {"api_key": "bh_...", "key_id": "uuid", "prefix": "bh_...", "scopes": ["read", "write"], "message": "Key rotated. Store securely."}

Expiry and all restrictions are preserved. Without a grace period the old key stops working immediately.

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": {
      "key_id": "<key_id>"
    },
    "name": "rotate_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
key_idYes
grace_minutesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / grace_minutes
      Added value: +{
      +  "default": 0,
      +  "title": "Grace Minutes",
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the new key is returned only once, that the old key can remain valid for up to 1,440 minutes, that expiry and restrictions are preserved, and that without a grace period the old key stops working immediately. This is strong behavioral disclosure for a mutation tool.

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 well-structured with clear sections (behavior, requirement, args, returns). It is slightly verbose with the return example, but every sentence adds useful information. The most important behavioral facts are front-loaded.

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

Completeness4/5

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

For a 2-parameter tool with no output schema, the description covers the essential context: what happens, what's required, what the response looks like, and the grace period behavior. It could explicitly name grace_minutes in the Args section, but the overall completeness is high.

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 description coverage is 0%, so the description must compensate. It explains key_id as the UUID of the API key to rotate and mentions grace_minutes implicitly via the grace period explanation. It doesn't explicitly name grace_minutes in the Args section, but the behavioral description makes its meaning clear. The return example also clarifies the output shape.

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 ('Rotate an API key'), the resource (API key), and the key behavior (creates a new key with same name/scopes/rate limits, optionally keeping old key valid). It distinguishes itself from siblings like revoke_api_key and create_api_key by describing the rotation semantics.

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 explains when to use it (to rotate an API key) and notes the requirement of write scope. It doesn't explicitly name alternatives like revoke_api_key or create_api_key, but the rotation semantics and grace period option provide clear context for 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.