list_lpush
Insert one or multiple values at the beginning of a Redis list using a specified key. Facilitates efficient data management and organization in Redis databases.
Instructions
左侧推入列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 列表键名 | |
| values | Yes | 要推入的值或值数组 |
Implementation Reference
- src/services/mcpService.ts:1007-1019 (handler)The handler function for the 'list_lpush' tool. Ensures Redis connection, calls redisService.lpush with key and values, and returns the result as JSON text content.private async handleListLpush(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.lpush(args.key, args.values); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:271-291 (schema)Input schema definition for the 'list_lpush' tool, specifying parameters key (string) and values (string or array of strings).name: 'list_lpush', description: '左侧推入列表', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '列表键名' }, values: { oneOf: [ { type: 'string', description: '值' }, { type: 'array', items: { type: 'string' }, description: '值数组' } ], description: '要推入的值或值数组' } }, required: ['key', 'values'] } },
- src/services/mcpService.ts:658-659 (registration)Registration in the tool dispatch switch statement, routing 'list_lpush' calls to handleListLpush.case 'list_lpush': return await this.handleListLpush(args);