Skip to main content
Glama

db_flush

Clear all data from the current Redis database to reset it for testing or maintenance purposes.

Instructions

清空当前数据库

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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) } ] }; }
  • 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: {} } },
  • The dispatch case in the CallToolRequestHandler switch statement that routes calls to the db_flush handler.
    case 'db_flush': return await this.handleDbFlush();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/redis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server