Skip to main content
Glama

Rotate your API key

rotateKey
Destructive

Mint a new API key for your profile; the old one is dead instantly and exactly once. Takes a signed challenge from getChallenge (challenge: { challenge_id, signature }, recovery key) — the API key alone is refused, so a thief holding it cannot lock you out. Works without the old key: pass profile_id and the challenge (the lost-key drill in docs('keys')). Add new_recovery_pubkey and recovery_proof (the new recovery key's proof, purpose rotate_recovery) to replace the recovery key in the same step. The reply is the only place the new key appears; store it where the old one was — a retry with the same idempotency_key is refused with conflict, never replayed. No seller-written text in the reply.

Input Schema

NameRequiredDescriptionDefault
challengeNoRequired. The API key alone is refused (forbidden, reason challenge_required): call getChallenge, sign its `message` with the recovery key, and pass the id and signature here.
profile_idNoThe profile, when you have no API key to send (implied by the key otherwise).
recovery_proofNoThe new recovery key's proof of control: purpose rotate_recovery, wallet = new_recovery_pubkey, subject = your profile id (docs('keys')).
idempotency_keyNoOptional. Send the same key on a retry and you get the original result back instead of a second change (24 hours). The same key with a different input is refused (conflict). Tools whose reply carries a secret (createProfile, rotateKey, setWebhook) show it once: a retry with the same key is refused with conflict instead of replaying the secret.
new_recovery_pubkeyNoAlso replace the recovery key: the NEW recovery key's address. Needs recovery_proof; the challenge is still signed by the current one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and non-idempotent, but the description adds substantial context beyond them: the old key is invalidated immediately, the API key alone is refused (forbidden/challenge_required), the new key appears only in the reply, retries with the same idempotency_key are refused with conflict rather than replayed, and the reply contains no seller-written text.

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?

Three dense sentences, front-loaded with purpose before prerequisites and edge cases. Every clause carries real information, though the backticked reference chains make it heavier than ideal for scanning.

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?

With no output schema, the description correctly covers the return: the reply is the only place the new key appears and it must be stored. Combined with the prerequisite flow, idempotency behavior, and recovery-key option, an agent has everything needed to call this destructive tool safely.

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 100%, so the baseline is 3, but the description adds joint semantics the schema does not spell out: new_recovery_pubkey and recovery_proof must be sent together to rotate the recovery key, and the challenge is still signed by the current recovery key. That materially aids correct invocation.

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 ('Mint a new API key for your profile') plus the crucial scope fact that the old one dies instantly and exactly once. An agent can distinguish this from siblings like getChallenge (a prerequisite) and createProfile without opening any schema.

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?

Explicitly names the prerequisite (getChallenge signed challenge, recovery key), states when the API key alone is refused, and gives the alternative path for the lost-key case (pass profile_id plus challenge). It also flags the optional recovery-key replacement flow in the same call.

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