Skip to main content
Glama

pii_rotate_key

Destructive

Rotate the PII vault encryption key: re-encrypt stored mappings with a new key, write it to the local key file, and invalidate the previous key for existing sessions.

Instructions

Rotate the PII vault encryption key (Step 102, ADR-102): re-encrypts all existing mappings with a new key and writes it to the local key file, making the previous key invalid for existing sessions. Optional newKey supplies the key material; a random key is generated when omitted (mirrors CLI rotate-key --new-key). Returns ok:false with an error when no encryption key is configured.

Input Schema

NameRequiredDescriptionDefault
newKeyNoOptional new key material (auto-generated when omitted)
confirmYesmandatory acknowledgement that this call mutates state; the tool writes nothing unless it is true (D5-08, D5-12)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "mandatory acknowledgement that this call mutates state; the tool writes nothing unless it is true (D5-08, D5-12)",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[]New value: +[
      +  "confirm"
      +]
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: it discloses the concrete blast radius (all existing mappings re-encrypted, previous key invalid for existing sessions), the side effect (writes to the local key file), and the failure mode (ok:false with an error when no key is configured). That is exactly the added context the annotations cannot carry.

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?

A single dense paragraph that front-loads the action and its consequence before the parameter and return notes. The parenthetical process references (Step 102, ADR-102, D5-08/D5-12) are mild noise, but every sentence still carries operational information.

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 usefully covers the success/failure contract (ok:false plus an error when no key is configured) and the confirm gating. It stops short of stating any permission or backup prerequisites for a destructive key-rotation, which would be the last piece an agent needs.

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%, so both parameters are already documented in the schema; the description's note that newKey is auto-generated when omitted and that it mirrors the CLI flag only re-states the schema. It adds no format, length, or encoding detail for the key material, so the baseline 3 is appropriate.

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+resource (rotate the PII vault encryption key) plus the concrete effect (re-encrypts all existing mappings, writes the new key to the local key file). It is unambiguous and clearly distinct from the other pii_* siblings such as pii_restore and pii_delete_session.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the agent can infer this is the key-rotation operation and that it mirrors the CLI 'rotate-key --new-key'. There is no explicit when-to-use/when-not guidance and no routing against the neighboring pii_* tools, so it lands at implied usage rather than a real decision rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.