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();
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the action ('flush') but doesn't disclose critical behavioral traits: whether this is destructive (likely yes), irreversible, requires specific permissions, affects all data types, or has side effects like performance impact. The description is minimal and lacks necessary operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase ('清空当前数据库') that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's high complexity (destructive database operation) and lack of annotations or output schema, the description is incomplete. It doesn't address safety, consequences, return values, or error conditions, leaving significant gaps for an AI agent to understand and use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%. With no parameters to document, the description doesn't need to add parameter semantics beyond the schema. A baseline score of 4 is appropriate as the schema fully covers the parameter aspect.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '清空当前数据库' (Flush the current database) clearly states the action (flush) and target resource (current database). It's specific enough to understand the core function, though it doesn't explicitly differentiate from sibling tools like key_delete_pattern or backup_create that might also affect data removal.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like key_delete_pattern (pattern-based deletion) and backup_create (data preservation), the description lacks context on appropriate use cases, prerequisites, or warnings about when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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