Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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) } ] }; }
  • 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: {} } },
  • Switch case in the main CallToolRequest handler that routes 'db_flush' calls to the specific handleDbFlush method.
    case 'db_flush': return await this.handleDbFlush();
  • Input schema for the 'db_flush' tool, defining an empty object (no input parameters required).
    type: 'object', properties: {} }

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