Skip to main content
Glama

hash_getall

Retrieve all fields and values from a Redis hash by specifying its key. Use this tool to access complete hash data for analysis or processing in Redis operations.

Instructions

获取所有哈希字段

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes哈希键名

Implementation Reference

  • MCP tool handler for 'hash_getall': ensures Redis connection, retrieves all hash fields using redisService.hgetall(key), and returns the result as JSON-formatted text content.
    private async handleHashGetall(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.hgetall(args.key); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Input schema definition for the 'hash_getall' tool: requires a 'key' string parameter representing the hash key name.
    { name: 'hash_getall', description: '获取所有哈希字段', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '哈希键名' } }, required: ['key'] } },
  • Switch case registration in CallToolRequestHandler that routes 'hash_getall' calls to the handleHashGetall method.
    case 'hash_getall': return await this.handleHashGetall(args);
  • Supporting helper method in RedisService that executes the Redis HGETALL command via the client and wraps in executeCommand.
    async hgetall(key: string): Promise<RedisOperationResult<Record<string, string>>> { return this.executeCommand(async () => { if (!this.client) throw new Error('Redis client not initialized'); return await this.client.hGetAll(key); }); }

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