Skip to main content
Glama

rotate_api_key

Rotate the API key for a specified agent: immediately invalidates the current key and returns a new key. Use to refresh credentials or after a security incident.

Instructions

轮换 API Key。旧 Key 立即失效,返回新 Key。请妥善保存新 Key。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesAgent ID

Implementation Reference

  • The actual HTTP API call: sends a POST request to /acap/v1/agents/{agentId}/rotate-key to rotate the API key.
    async rotateApiKey(agentId: string) {
      return this.request('POST', `/acap/v1/agents/${agentId}/rotate-key`);
    }
  • src/index.ts:287-296 (registration)
    Tool registration metadata: name 'rotate_api_key', description, and inputSchema (requires agent_id).
      name: 'rotate_api_key',
      description: '轮换 API Key。旧 Key 立即失效,返回新 Key。请妥善保存新 Key。',
      inputSchema: {
        type: 'object' as const,
        properties: {
          agent_id: { type: 'string', description: 'Agent ID' },
        },
        required: ['agent_id'],
      },
    },
  • The MCP tool handler dispatch: extracts agent_id from args and calls client.rotateApiKey(agent_id).
    case 'rotate_api_key': {
      const { agent_id } = args as { agent_id: string };
      result = await client.rotateApiKey(agent_id);
      break;
    }
  • src/index.ts:117-121 (registration)
    Feature group registration listing 'rotate_api_key' under the 'identity' group.
    identity: [
      'register_agent', 'get_profile', 'update_profile', 'search_agents',
      'verify_email', 'check_handle', 'get_my_agents', 'list_api_keys',
      'get_usage', 'rotate_api_key',
    ],
Behavior4/5

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

Discloses that old key becomes invalid immediately, returns new key, and advises to save new key. With no annotations, this is good behavioral disclosure, though it omits details like impact on ongoing sessions or rate limits.

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 sentences in Chinese, no wasted words. Front-loaded with core action and effect.

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?

For a simple tool with one parameter and no output schema or annotations, the description adequately covers purpose, effect, and user action (save new key). Could mention who can perform rotation but still strong.

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% for the single parameter (agent_id). Description adds no extra meaning beyond the schema's 'Agent ID' description, so 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?

Clearly states the tool rotates an API key (specific verb+resource), distinguishes from siblings like list_api_keys by focusing on rotation. The description is unambiguous.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs. alternatives (e.g., creating a new key without invalidating old one). Does not mention scenarios like needing to keep old key active or permission requirements.

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/ggqshuai-hub/a2amarket-mcp-server'

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