db_flush
Clear all data from the current Redis database to reset it for testing or maintenance purposes.
Instructions
清空当前数据库
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/mcpService.ts:1313-1325 (handler)The handler function that implements the db_flush tool logic. It ensures a Redis connection, calls flushdb() on the RedisService, and returns the result as MCP content.private async handleDbFlush() { this.ensureRedisConnection(); const result = await this.redisService!.flushdb(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:571-577 (registration)The tool registration in the MCP tools list, including the name, description, and input schema (no parameters required).name: 'db_flush', description: '清空当前数据库', inputSchema: { type: 'object', properties: {} } },
- src/services/mcpService.ts:700-701 (registration)The dispatch case in the CallToolRequestHandler switch statement that routes calls to the db_flush handler.case 'db_flush': return await this.handleDbFlush();