Skip to main content
Glama

hash_get

Retrieve specific field values from Redis hash data structures using key and field identifiers for targeted data access.

Instructions

获取哈希字段

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes哈希键名
fieldYes字段名

Implementation Reference

  • The main handler function for the 'hash_get' tool. Ensures Redis connection, retrieves the hash field value using redisService.hget(key, field), and returns the result as formatted JSON text content.
    private async handleHashGet(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.hget(args.key, args.field);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • The input schema definition for the 'hash_get' tool, registered in the ListTools response. Requires 'key' and 'field' as strings.
    {
      name: 'hash_get',
      description: '获取哈希字段',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: '哈希键名' },
          field: { type: 'string', description: '字段名' }
        },
        required: ['key', 'field']
      }
    },
  • Registration/dispatch in the CallToolRequestSchema handler switch statement, routing calls to the handleHashGet method.
    case 'hash_get':
      return await this.handleHashGet(args);
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 doesn't disclose behavioral traits such as whether this is a read-only operation (implied by 'get' but not explicit), error handling (e.g., if key/field doesn't exist), performance characteristics, or authentication needs. The description is minimal and adds little beyond the basic action.

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 phrase ('获取哈希字段') that is extremely concise and front-loaded with the core action. There is zero waste or redundancy, making it efficient for quick scanning, though this conciseness comes at the cost of 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 complexity (simple read operation), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values, error cases, or dependencies (e.g., requires Redis connection as hinted by siblings). For a tool with 2 parameters and no structured safety hints, more context is needed to guide effective use.

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 both parameters ('key' and 'field') documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., no examples, format details, or constraints). Baseline is 3 since the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.

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 '获取哈希字段' (Get hash field) states the basic action but is vague about scope and resource. It specifies a verb ('获取' - get) and resource type ('哈希字段' - hash field), but doesn't distinguish from siblings like hash_getall (gets all fields) or clarify what type of hash structure this operates on. 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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention siblings like hash_getall (for all fields) or string_get (for non-hash values), nor does it specify prerequisites like requiring a Redis connection (implied by sibling tools but not stated). Usage is implied from the name alone.

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