Skip to main content
Glama

Rotate the principal key

rotate_principal_key
Destructive

Replace your principal's principal_key and cut off every agent that should not keep access. Use it when the key may have leaked or when you want to revoke a group of agents at once. Returns the new key once. Needs your agent credentials and the current principal_key (argument or X-Principal-Key header). Returns the new key once; the old one stops working. Every agent registered under the previous key is revoked for good (AGENT_REVOKED) except you and the agents in keep_agent_ids (list_agents shows them); the result lists kept_agent_ids and revoked_agent_ids. A principal registered before keys existed has none: any of its agents can call this without principal_key to mint the first one, which revokes nobody.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "rotate_principal_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idNoYour agent id (or X-Agent-Id header)
agent_keyNoSecret returned by register_agent (or X-Agent-Key header)
principal_idNoThe principal you act for (or X-Principal-Id header)
principal_keyNoCurrent principal_key (or X-Principal-Key header)
keep_agent_idsNoOther agents of the principal to keep working (you are always kept)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / keep_agent_ids
      Added value: +{
      +  "description": "Other agents of the principal to keep working (you are always kept)",
      +  "items": {
      +    "pattern": "^[A-Za-z0-9._:-]{3,128}$",
      +    "type": "string"
      +  },
      +  "maxItems": 100,
      +  "type": "array"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / agent_id / pattern
      Added value: +"^[A-Za-z0-9._:-]{3,128}$"
    • addedInput schema / properties / agent_key / maxLength
      Added value: +256
    • addedInput schema / properties / principal_id / pattern
      Added value: +"^[A-Za-z0-9._:@-]{3,128}$"
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations flag destructiveHint=true and idempotentHint=false, and the description substantially deepens that: the old key stops working immediately, kept agents are revoked permanently (AGENT_REVOKED), the response lists kept_agent_ids and revoked_agent_ids, and the new key is returned only once. It also documents an authentication path not visible in annotations: a pre-key principal's agent can call without principal_key to mint the first key.

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 text is dense and front-loaded with purpose and trigger before the mechanics, and most sentences carry distinct information. However, "Returns the new key once" appears twice in near-identical form, one of which is a wasted standalone sentence against an otherwise tight paragraph.

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 destructive, non-idempotent, multi-parameter credential rotation with no output schema, the description covers auth, side effects, exceptions, response shape, and the legacy bootstrap case. An agent has everything needed to decide and call correctly.

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?

With 100% schema coverage the baseline is 3, but the description adds real meaning beyond the schema: principal_key may be supplied as an argument or an X-Principal-Key header, keep_agent_ids is what protects named agents (discoverable via list_agents), and principal_key becomes optional for legacy principals. The keep_agent_ids explanation largely restates the schema field description, which keeps this from a 5.

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 first sentence names a specific verb and resource ("Replace your principal's principal_key") plus its blast radius ("cut off every agent that should not keep access"). This separates it cleanly from siblings like revoke_agent (single agent), register_agent, and list_agents, which the description also references.

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?

It gives explicit triggers: "when the key may have leaked or when you want to revoke a group of agents at once." The bulk-revocation phrasing implicitly contrasts with per-agent revocation but never names revoke_agent as the alternative, and there is no explicit when-not guidance (e.g., use revoke_agent for a single agent).

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.