string_mget
Retrieve multiple key values in a single operation to efficiently access Redis database entries, reducing query overhead and optimizing performance for bulk data handling.
Instructions
批量获取键值
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | 键名数组 |
Implementation Reference
- src/services/mcpService.ts:905-917 (handler)The handler function for the 'string_mget' tool. Ensures Redis connection, calls mget on RedisService with the array of keys, and returns the result as JSON text content.private async handleStringMget(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.mget(args.keys); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:175-185 (schema)Input schema definition for the string_mget tool: requires an object with a 'keys' array of strings.inputSchema: { type: 'object', properties: { keys: { type: 'array', items: { type: 'string' }, description: '键名数组' } }, required: ['keys'] }
- src/services/mcpService.ts:172-186 (registration)Registration of the string_mget tool in the ListTools response, including name, description, and input schema.{ name: 'string_mget', description: '批量获取键值', inputSchema: { type: 'object', properties: { keys: { type: 'array', items: { type: 'string' }, description: '键名数组' } }, required: ['keys'] } },
- src/services/mcpService.ts:642-643 (registration)Dispatcher case in the CallToolRequestSchema handler that routes 'string_mget' calls to the specific handler.case 'string_mget': return await this.handleStringMget(args);