disconnect_redis
Terminate the active connection to a Redis database server to release resources and end the session.
Instructions
断开与 Redis 服务器的连接
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": "disconnect_redis"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/mcpService.ts:791-815 (handler)The main handler function that executes the logic for the 'disconnect_redis' MCP tool. It checks if a Redis connection exists, calls disconnect on the service if so, clears the service references, and returns a standardized MCP response with the result.
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 (registration)Tool registration in the MCP server's tools list. Defines the tool name, description, and input schema (empty object, no parameters required). This is passed to server.setTools().
{ name: 'disconnect_redis', description: '断开与 Redis 服务器的连接', inputSchema: { type: 'object', properties: {} } }, - src/services/mcpService.ts:628-629 (registration)Dispatch registration in the switch statement of the CallToolRequestHandler. Routes calls to the 'disconnect_redis' tool to its handler method.
case 'disconnect_redis': return await this.handleDisconnectRedis(); - src/services/mcpService.ts:96-99 (schema)Input schema for the 'disconnect_redis' tool, defining an empty object (no input parameters required). Part of the tool registration.
inputSchema: { type: 'object', properties: {} }