Skip to main content
Glama
Nicolas-One

Redis CRUD MCP Server

by Nicolas-One

redis_hset

Set a hash field in Redis by specifying the key, field, and value. Directly update or create hash entries with this operation.

Instructions

设置哈希字段。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
fieldYes
valueYes

Implementation Reference

  • The handler function for the redis_hset tool. Calls client.hSet() with key, field, and value arguments, then returns a success message.
    redis_hset: async () => { await client.hSet(args.key, args.field, args.value); return `HSET 成功。${args.key}.${args.field} = ${args.value}`; },
  • Input schema definition for redis_hset. Declares the tool name, description, and input schema requiring three string parameters: key, field, and value.
    { name: "redis_hset", description: "设置哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, field: { type: "string" }, value: { type: "string" } }, required: ["key", "field", "value"] } },
  • src/index.ts:165-177 (registration)
    Registration of all tools via ListToolsRequestSchema handler. redis_hset is registered as one of the available tools in the MCP server's tool list.
    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"] } }
      ]
    }));
Behavior1/5

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

No annotations are provided, and the description fails to disclose that this is a write operation that mutates state, overwrites existing fields, or any side effects. The agent cannot infer behavior from the minimal description.

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

Conciseness3/5

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

The description is a single sentence, which is concise but lacks structure (e.g., no parameter list, no examples). For a simple tool this could be adequate, but the brevity sacrifices necessary detail.

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 and lack of output schema or annotations, the description does not cover return values, overwrite behavior, or error conditions. Incomplete for an agent to use correctly.

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?

With 0% schema description coverage, the description must explain parameter meanings. It does not clarify that 'key' is the Redis key, 'field' is the hash field name, and 'value' is the value to set. The description adds no value over parameter names.

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 '设置哈希字段' (Set hash field) clearly states the action and target resource. However, it does not differentiate from sibling tools like redis_set (which sets a string key) or redis_hget (which gets a hash field).

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 on when to use this tool vs alternatives (e.g., redis_set for string values, redis_hdel for deleting fields). No context for prerequisites or situations to avoid.

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