db_flush
Clear all data in the current Redis database, enabling a fresh start or reset. Ideal for debugging, testing, or preparing environments for new datasets.
Instructions
清空当前数据库
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/mcpService.ts:1313-1325 (handler)The main handler function for the 'db_flush' tool. Ensures Redis connection and executes FLUSHDB command via RedisService, returning the result as text 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:570-577 (registration)Registers the 'db_flush' tool in the MCP server's tool list, including its description and input schema (no required parameters).{ name: 'db_flush', description: '清空当前数据库', inputSchema: { type: 'object', properties: {} } },
- src/services/mcpService.ts:700-701 (handler)Switch case in the main CallToolRequest handler that routes 'db_flush' calls to the specific handleDbFlush method.case 'db_flush': return await this.handleDbFlush();
- src/services/mcpService.ts:574-576 (schema)Input schema for the 'db_flush' tool, defining an empty object (no input parameters required).type: 'object', properties: {} }