list_lpop
Remove and return elements from the beginning of a Redis list to process queue items or retrieve stored data in order.
Instructions
左侧弹出列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 列表键名 | |
| count | No | 弹出数量(可选) |
Implementation Reference
- src/services/mcpService.ts:1041-1053 (handler)Handler function that executes the list_lpop tool: ensures Redis connection and calls redisService.lpop(key, count) to pop elements from the left of the list.private async handleListLpop(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.lpop(args.key, args.count); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:314-325 (schema)Schema definition for the list_lpop tool in the ListTools response, specifying input parameters: key (required), count (optional).{ name: 'list_lpop', description: '左侧弹出列表', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '列表键名' }, count: { type: 'number', description: '弹出数量(可选)' } }, required: ['key'] } },
- src/services/mcpService.ts:662-663 (registration)Registration in the CallToolRequest handler switch statement that dispatches to the list_lpop handler.case 'list_lpop': return await this.handleListLpop(args);