Skip to main content
Glama

Rotate API key

rotate_api_key
Destructive

Replace an API key with a new secret that keeps the same name, expiry and permissions. The old secret stops working at once. The answer holds the new secret once.

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": {
      "id": "<id>"
    },
    "name": "rotate_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesKey ID from list_api_keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the destructive annotation, the description specifies that the old secret stops working immediately and that the new secret is returned only once. These are important operational details, though permission requirements are not described.

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?

The description is three short, front-loaded sentences with no wasted wording. Each sentence contributes a distinct and useful fact.

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 one-parameter credential-rotation tool with no output schema, the description covers the essential behavior: preservation of key settings, immediate invalidation of the old secret, and one-time return of the new secret.

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%, and the single id parameter is already documented as coming from list_api_keys. The description does not add additional parameter meaning beyond what the schema provides.

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 a specific action and resource: replace an API key with a new secret while preserving name, expiry, and permissions. This clearly distinguishes rotation from creating a brand-new key or revoking one without replacement.

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 replacement framing gives clear context for when this tool is appropriate, especially versus creating or revoking keys. However, it does not explicitly name alternatives or state when not to use rotation.

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