Skip to main content
Glama

Rotate an app's service token

rotate_app_token
Destructive

Give a private app's service token a new value without an outage, and write the new value straight into each caller's secret env var. Each caller restarts to read it. The old value keeps working for a fixed overlap (20 minutes by default), so callers move over before it stops; the answer says when. The value never passes through this conversation. deliver_to names the callers, apps or agents in the same organization; omit it to deliver to the callers the token's earlier rotations recorded, which list_app_tokens shows. A rotation with no caller to deliver to is refused here, because its value would have to be shown: run valet apps token rotate in a terminal for a token used outside Valet. A token rotates again only after its old value stops working; a repeat before then is refused, so a retried call never rotates twice. A token that does not exist yet is minted. Requires connecting a Valet account. Requires the Admin role.

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": {
      "name": "<name>",
      "token": "<token>"
    },
    "name": "rotate_app_token"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe app's name, as list_services shows it: the app whose tokens these are.
tokenYesThe token's name, as list_app_tokens shows it.
org_nameNoThe Valet organization it belongs to. Omit to use the organization the account joined first.
deliver_toNoThe callers to write the new value into. Omit to use the callers the token recorded.

Output Schema

NameRequiredDescriptionDefault
appYesThe app whose token rotated.
orgYesName of the Valet organization the call acted in.
tokenYesThe token's name.
deliveriesYesWhat happened at each caller.
retiring_untilNoWhen the old value stops working, RFC 3339. Absent when the rotation minted the token's first value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the 20-minute overlap window, that callers must restart, that the value is never exposed in the conversation, and that the tool requires a connected Valet account plus the Admin role. The retry-refusal sentence ('a retried call never rotates twice') sits in mild tension with idempotentHint=false, but it describes an error-on-repeat rather than a stable replay, so it is not a real contradiction.

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?

Dense but front-loaded: the primary action and zero-outage behavior come first, then parameter guidance, then prerequisites. Every sentence carries information, though the delivery/refusal material is packed tightly enough to read as one long block.

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?

A destructive, multi-parameter rotation with an output schema is covered completely: what is destroyed, what the overlap guarantees, auth/role prerequisites, delivery fallback, and refusal conditions. Nothing an agent needs in order to call it correctly is missing.

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%, so baseline is 3, but the description adds real meaning: deliver_to may name apps or agents in the same organization, omitting it falls back to callers recorded by earlier rotations, and a rotation with no resolvable caller is refused rather than returning the value.

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 ('Give a private app's service token a new value') plus the delivery side effect ('write the new value straight into each caller's secret env var'). It also distinguishes itself from list_app_tokens, which it names as the place to discover recorded callers.

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?

Explicit when-to-use and when-not-to-use: omit deliver_to to reuse recorded callers, and do not use this tool when the token is consumed outside Valet ('run `valet apps token rotate` in a terminal'). Also states the repeat-rotation refusal and the mint-on-absent case, so the agent knows the failure modes before calling.

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