Skip to main content
Glama

Rotate API key

rotate_api_key
Destructive

Replace a key's secret, keeping its name, scopes and website restriction. The old secret stops working immediately and the new one is returned ONCE. Only keys no stronger than this one can be rotated. Rotating the key this connection uses cuts the connection off.

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_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
key_idYesAPI key id (UUID) from list_api_keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description adds what the annotations cannot: the old secret dies immediately, the new secret is returned exactly once (so it must be captured), and a privilege-tier constraint governs which keys are eligible. The self-rotation warning is a genuinely non-obvious operational hazard.

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?

Four dense sentences, front-loaded with the core action and preservation semantics, with no filler. Minor cost: "this one" and "the key this connection uses" require the reader to infer the referent, and the sentences could be ordered so the eligibility rule precedes the action.

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?

With no output schema, the description correctly discloses the one thing an agent must know about the return value (single-shot new secret). It leaves open failure behavior — e.g. whether the old secret survives a failed rotation — but covers the essentials for a one-parameter mutation tool.

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% and the single key_id is documented with UUID format and a pointer to list_api_keys, so baseline would be 3. The description adds a selection rule — the target key must be no stronger than the calling key — which constrains which key_id is valid beyond anything in 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 and resource ("Replace a key's secret") plus exactly what is preserved (name, scopes, website restriction), which implicitly separates it from create_api_key and delete_api_key. An agent knows this mutates an existing key rather than minting or destroying one.

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 two concrete gating conditions for when this tool applies: only keys no stronger than the current one can be rotated, and rotating the connection's own key severs the connection. It stops short of naming a sibling alternative or stating prerequisites explicitly, so it is clear context rather than full when/when-not routing.

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.

Resources