disconnect_redis
Terminate active connections to Redis servers to manage resources, ensure security, or reset sessions. Use this tool to disconnect from Redis MCP server instances effectively.
Instructions
断开与 Redis 服务器的连接
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/mcpService.ts:791-815 (handler)The main handler function for the 'disconnect_redis' tool. It checks if connected, calls redisService.disconnect(), nullifies services, and returns formatted response.private async handleDisconnectRedis() { if (!this.redisService) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: 'Not connected to Redis' }, null, 2) } ] }; } const result = await this.redisService.disconnect(); this.redisService = null; this.backupService = null; return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:93-100 (schema)Tool schema definition in the ListTools response, specifying name, description, and empty input schema (no parameters required).{ name: 'disconnect_redis', description: '断开与 Redis 服务器的连接', inputSchema: { type: 'object', properties: {} } },
- src/services/mcpService.ts:628-629 (registration)Registration and dispatch in the CallToolRequestSchema switch statement, routing calls to the handler.case 'disconnect_redis': return await this.handleDisconnectRedis();