Skip to main content
Glama

hash_del

Remove specific fields from a Redis hash by specifying the key and field names, enabling targeted data cleanup in Redis databases.

Instructions

删除哈希字段

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes哈希键名
fieldsYes要删除的字段名或字段名数组

Implementation Reference

  • The main handler function for the 'hash_del' tool. It ensures Redis connection, calls hdel on RedisService with key and fields, and returns the result as MCP content.
    private async handleHashDel(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.hdel(args.key, args.fields);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Registration of the 'hash_del' tool in the ListTools response, defining name, description, and input schema.
    {
      name: 'hash_del',
      description: '删除哈希字段',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: '哈希键名' },
          fields: {
            oneOf: [
              { type: 'string', description: '字段名' },
              { 
                type: 'array', 
                items: { type: 'string' },
                description: '字段名数组'
              }
            ],
            description: '要删除的字段名或字段名数组'
          }
        },
        required: ['key', 'fields']
      }
    },
  • Dispatch case in the main CallToolRequest handler that routes 'hash_del' calls to the specific handleHashDel method.
    case 'hash_del':
      return await this.handleHashDel(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action (delete) but doesn't describe what happens on success/failure, whether it's idempotent, error conditions, or performance implications. For a destructive operation with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is a single, efficient phrase ('删除哈希字段') that directly states the action. It's front-loaded with no wasted words, though it could benefit from slightly more detail given the tool's complexity. The structure is minimal but effective.

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 destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like what happens if fields don't exist, return values, or error handling. For a delete operation in a Redis context, more context is needed to guide safe usage.

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

Parameters3/5

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

Schema description coverage is 100%, with clear descriptions for both parameters (key and fields). The description doesn't add any meaning beyond what the schema provides, such as examples or constraints. However, since the schema fully documents the parameters, a baseline score of 3 is appropriate.

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

Purpose3/5

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

The description '删除哈希字段' (delete hash fields) clearly states the verb (delete) and resource (hash fields), but it's somewhat vague about the exact operation. It doesn't specify that this deletes fields from a Redis hash data structure, nor does it distinguish it from sibling tools like key_delete or hash_getall. The purpose is understandable but lacks specificity.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requiring a Redis connection via connect_redis), when not to use it, or how it differs from similar tools like key_delete (which deletes entire keys) or hash_* operations. This leaves the agent with little context for selection.

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