Skip to main content
Glama

Rotate merchant API key

shop.merchant.rotate_key
Destructive

Revoke the Bearer key used for this call and return a fresh mk_live_ key (shown once). Works for deactivated merchants too, so open orders can still be closed.

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": "shop.merchant.rotate_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
encryption_keyNoOptional: ALSO replace the buyer-data encryption key. New kid, same sig_by_wallet rule as registration. Envelopes sealed to the old kid are not re-encrypted: fetch them first.

Output Schema

NameRequiredDescriptionDefault
api_keyYes
terms_update_pendingNoPresent when a newer document version awaits re-acceptance (30-day window).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / encryption_key
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional: ALSO replace the buyer-data encryption key. New kid, same sig_by_wallet rule as registration. Envelopes sealed to the old kid are not re-encrypted: fetch them first.",
      +  "properties": {
      +    "alg": {
      +      "type": "string"
      +    },
      +    "kid": {
      +      "type": "string"
      +    },
      +    "pub": {
      +      "type": "string"
      +    },
      +    "sig_by_wallet": {
      +      "description": "EIP-191 signature by `wallet` over the encryption-key text.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "kid",
      +    "alg",
      +    "pub",
      +    "sig_by_wallet"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

The annotations say destructive=true, but the description supplies the traits that actually matter operationally: the calling credential is self-invalidated by the call, the replacement key is displayed only once and must be captured immediately, and the operation is permitted on deactivated merchants. That is meaningful context 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with the primary effect front-loaded and the edge-case permission second. No filler, no restatement of the title.

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?

Covers the core destructive behavior and the one-time secret exposure, and the output schema handles the return shape. The notable omission is that the optional encryption_key argument silently triggers a second, irreversible rotation whose old envelopes are not re-encrypted — a caller could easily miss that the description-level story is incomplete for a destructive action.

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 description coverage is 100%, so the schema already explains the nested encryption_key object, its required fields, and the sig_by_wallet rule, making 3 the baseline. The description adds nothing about parameters and never mentions that an optional encryption-key rotation can accompany the API-key rotation, so it does not exceed the baseline.

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 plus the exact effect ('Revoke the Bearer key used for this call and return a fresh mk_live_ key'), which unambiguously distinguishes it from every sibling in the merchant namespace. The parenthetical '(shown once)' further pins down what the caller gets back.

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?

Gives a clear use context that would otherwise be invisible: the tool is usable even for deactivated merchants so open orders can still be closed. It does not name when NOT to rotate (e.g. rotation vs. deactivate) or state the implicit prerequisite that the caller must already be authenticated with the key being revoked.

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.