string_mset
Set multiple key-value pairs in Redis simultaneously with a single batch operation, streamlining database updates and reducing manual input overhead.
Instructions
批量设置键值
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyValues | Yes | 键值对数组 |
Implementation Reference
- src/services/mcpService.ts:888-900 (handler)The main handler function that implements the 'string_mset' tool logic. It ensures a Redis connection is active, invokes the RedisService.mset method with the provided keyValues array, and returns the result as formatted JSON text content.private async handleStringMset(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.mset(args.keyValues); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:153-169 (schema)Input schema definition for the 'string_mset' tool, specifying an object with a required 'keyValues' array of objects each containing 'key' and 'value' strings.inputSchema: { type: 'object', properties: { keyValues: { type: 'array', items: { type: 'object', properties: { key: { type: 'string', description: '键名' }, value: { type: 'string', description: '值' } }, required: ['key', 'value'] }, description: '键值对数组' } }, required: ['keyValues']
- src/services/mcpService.ts:150-170 (registration)Registration of the 'string_mset' tool in the ListTools response, including name, description, and input schema.{ name: 'string_mset', description: '批量设置键值', inputSchema: { type: 'object', properties: { keyValues: { type: 'array', items: { type: 'object', properties: { key: { type: 'string', description: '键名' }, value: { type: 'string', description: '值' } }, required: ['key', 'value'] }, description: '键值对数组' } }, required: ['keyValues'] }
- src/services/mcpService.ts:640-641 (registration)Dispatch case in the CallToolRequestSchema handler that routes 'string_mset' calls to the handleStringMset method.case 'string_mset': return await this.handleStringMset(args);