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
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID |
Implementation Reference
- src/acap-client.ts:197-199 (handler)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'], }, }, - src/index.ts:854-858 (handler)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', ],