Skip to main content
Glama

Rotate Agent Secret

ledger_rotate_secret
Destructive

Mint a NEW agent_secret for an agent_id your workspace already owns, invalidating the old one.

Use this to RECOVER an agent whose secret was lost: the previous credential stops working immediately. Requires the workspace_key that owns agent_id — an agent's own agent_secret cannot rotate itself, because a leaked agent credential must not be able to lock its real owner out. Unlike ledger_track this never claims a new agent_id: an unknown id returns agent_not_claimed.

The new secret is returned ONCE. Store it before you drop the response.

Returns {"agent_id", "agent_secret", "_note"}, or {"error", "error_code"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYes
workspace_keyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructive=true and idempotent=false, and the description adds genuinely new behavioral facts: the old credential stops working immediately, ownership authorization is required, self-rotation is blocked, and the new secret is shown only ONCE and must be stored before the response is dropped. This is rich disclosure beyond the annotation set.

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?

Front-loaded with the core action and consequence, and each paragraph adds distinct value (usage, authorization constraint, return contract). It runs slightly long across four paragraphs, but no sentence is filler.

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 credential-rotation tool, the description covers purpose, precondition, authorization, irreversibility, the one-time return, and the error contract. Even though an output schema exists, the explicit return shape removes any ambiguity about the one-shot secret.

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 carry the semantics of both parameters. It explains that agent_id must already be owned by the workspace and that workspace_key must be the owning key, which is meaningful authorization context. It stops short of stating concrete formats or where to obtain workspace_key.

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 verb and resource ('Mint a NEW agent_secret for an agent_id') and immediately clarifies the consequence (invalidating the old one). It explicitly differentiates itself from the sibling ledger_track by noting it 'never claims a new agent_id', so an agent can distinguish the tools without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names the exact scenario ('RECOVER an agent whose secret was lost'), states the precondition (workspace_key that owns agent_id), and gives an explicit exclusion ('an agent's own agent_secret cannot rotate itself' and the leaked-credential rationale). The failure mode for an unknown id is also documented.

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.