Skip to main content
Glama

rotate_api_key

Generate a new workspace API key and immediately invalidate the current one. This irreversible action requires updating all integrations and restarting the server.

Instructions

Generate a new workspace API key and immediately invalidate the current one.

WARNING: This action is irreversible. The moment this succeeds, the key used to call it stops working. All integrations must be updated with the new key immediately, and this MCP server must be restarted with the new BITSCALE_API_KEY environment variable.

Returns: {"api_key": "sk-live-newkey..."} — the new workspace API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:305-318 (handler)
    The rotate_api_key function that executes the tool logic. It calls POST /api-key/rotate to generate a new API key and invalidate the current one. Returns the new API key as a JSON string.
    @mcp.tool()
    def rotate_api_key() -> str:
        """
        Generate a new workspace API key and immediately invalidate the current one.
    
        WARNING: This action is irreversible. The moment this succeeds, the key
        used to call it stops working. All integrations must be updated with the
        new key immediately, and this MCP server must be restarted with the new
        BITSCALE_API_KEY environment variable.
    
        Returns: {"api_key": "sk-live-newkey..."} — the new workspace API key.
        """
        data = _post("/api-key/rotate")
        return json.dumps(data, indent=2)
  • main.py:56-62 (helper)
    The _post helper function used by rotate_api_key to make authenticated POST requests to the BitScale API.
    def _post(path: str, body: dict | None = None, timeout: int = 60) -> dict:
        """Perform an authenticated POST request against the BitScale API."""
        url = f"{BITSCALE_API_BASE}{path}"
        with httpx.Client(timeout=timeout) as client:
            response = client.post(url, headers=_headers(), json=body or {})
        response.raise_for_status()
        return response.json()
  • main.py:31-31 (registration)
    The FastMCP server instance ('mcp') that registers rotate_api_key via @mcp.tool() decorator on line 305.
    mcp = FastMCP("BitScale")
Behavior5/5

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

Discloses irreversibility, immediate key stoppage, and need to update integrations and restart server. With no annotations provided, description fully covers behavioral traits.

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?

Concise: two sentences plus return format. Front-loaded with purpose, then warning, then output. Every sentence adds value.

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?

Complete for a parameterless tool. Output schema shown via example, no missing context. Complex behavior (irreversible mutation) fully disclosed.

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?

Zero parameters in schema; description adds no param info, but baseline is 4 for no parameters. Schema coverage is 100% by default.

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?

Description clearly states it generates a new API key and invalidates the current one, with specific verb+resource. Distinct from all sibling tools which handle grid or workspace details.

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?

Explicit warning about immediate invalidation and required updates (integrations, restart). No alternatives to exclude since no other tool rotates keys, but context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/featherflow/bitscale-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server