Skip to main content
Glama
Nicolas-One

Redis CRUD MCP Server

by Nicolas-One

redis_hdel

Remove specified fields from a Redis hash. Provide the key and a list of field names to delete them from the hash structure.

Instructions

删除哈希字段。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
fieldsYes

Implementation Reference

  • Input schema for redis_hdel tool: requires key (string) and fields (array of strings).
    { name: "redis_hdel", description: "删除哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, fields: { type: "array", items: { type: "string" } } }, required: ["key", "fields"] } }
  • Handler for redis_hdel: calls client.hDel(args.key, args.fields) and returns a success message with count of deleted fields.
    redis_hdel: async () => { const r = await client.hDel(args.key, args.fields); return `HDEL 成功。删除 ${r} 个字段`; }
  • src/index.ts:165-177 (registration)
    Tool registration via ListToolsRequestSchema handler that includes redis_hdel in the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        { name: "redis_set", description: "设置键值。自动读取项目 .env 配置连接 Redis。", inputSchema: { type: "object", properties: { key: { type: "string" }, value: { type: "string" } }, required: ["key", "value"] } },
        { name: "redis_get", description: "获取键值。", inputSchema: { type: "object", properties: { key: { type: "string" } }, required: ["key"] } },
        { name: "redis_del", description: "删除键。", inputSchema: { type: "object", properties: { key: { type: "string" } }, required: ["key"] } },
        { name: "redis_exists", description: "检查键是否存在。", inputSchema: { type: "object", properties: { key: { type: "string" } }, required: ["key"] } },
        { name: "redis_info", description: "获取连接信息。", inputSchema: { type: "object", properties: {} } },
        { name: "redis_hset", description: "设置哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, field: { type: "string" }, value: { type: "string" } }, required: ["key", "field", "value"] } },
        { name: "redis_hget", description: "获取哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, field: { type: "string" } }, required: ["key", "field"] } },
        { name: "redis_hgetall", description: "获取哈希所有字段。", inputSchema: { type: "object", properties: { key: { type: "string" } }, required: ["key"] } },
        { name: "redis_hdel", description: "删除哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, fields: { type: "array", items: { type: "string" } } }, required: ["key", "fields"] } }
      ]
    }));
Behavior2/5

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

With no annotations, the description must convey behavioral traits. It only states the operation is a deletion, but does not clarify idempotency, return values (e.g., number of removed fields), or behavior for non-existent keys or fields. This is insufficient for a mutation tool.

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

Conciseness2/5

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

The description is very short (one phrase), but it is under-specified rather than concise. It lacks necessary details and front-loads no critical information. Every word is present, but the description does not earn its place as it fails to inform the agent adequately.

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 simplicity (2 required params, no output schema), the description is incomplete. It omits explanation of the return value, prerequisites (key must be a hash), and edge cases. A complete description would include at least the return type and behavior for missing fields.

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

Parameters1/5

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

Schema description coverage is 0%, yet the description adds no detail about the 'key' or 'fields' parameters. It does not explain that 'fields' is an array of field names, nor does it provide any additional context beyond the bare schema.

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 field) clearly states the verb and resource, distinguishing it from sibling tools that delete entire keys (redis_del) or get/set hash fields. However, it is minimal and does not specify that multiple fields can be deleted.

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 usage guidance is provided. The description does not indicate when to use this tool versus alternatives like redis_del (for whole key deletion) or redis_hgetall (for retrieving hash fields). No exclusions or prerequisites are mentioned.

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/Nicolas-One/redis-crud-mcp-server'

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