hash_getall
Retrieve all fields and values associated with a specific hash key in Redis, enabling comprehensive data access and management for streamlined database operations.
Instructions
获取所有哈希字段
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 哈希键名 |
Implementation Reference
- src/services/mcpService.ts:973-985 (handler)The main handler function for the 'hash_getall' tool. It ensures Redis connection, calls hgetall on the key, and returns the result as JSON 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) } ] }; }
- src/services/mcpService.ts:236-246 (schema)The tool schema definition including name, description, and input schema requiring a 'key' string.{ name: 'hash_getall', description: '获取所有哈希字段', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '哈希键名' } }, required: ['key'] } },
- src/services/mcpService.ts:652-653 (registration)The switch case registration in the CallToolRequestSchema handler that dispatches to the specific handler method.case 'hash_getall': return await this.handleHashGetall(args);