db_flush
Clear all data from the current Redis database to reset it for testing or maintenance purposes.
Instructions
清空当前数据库
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": "db_flush"
}
}Input 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();