list_rpop
Remove and retrieve elements from the right end of a Redis list. Specify the list key and optionally the number of elements to pop for efficient data management.
Instructions
右侧弹出列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | 弹出数量(可选) | |
| key | Yes | 列表键名 |
Implementation Reference
- src/services/mcpService.ts:1058-1070 (handler)The main handler function for the 'list_rpop' tool. It ensures Redis connection, calls rpop on the RedisService with key and optional count, and returns the result as text content.private async handleListRpop(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.rpop(args.key, args.count); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:326-337 (schema)Input schema definition for the 'list_rpop' tool, specifying the required 'key' and optional 'count' parameters.{ name: 'list_rpop', description: '右侧弹出列表', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '列表键名' }, count: { type: 'number', description: '弹出数量(可选)' } }, required: ['key'] } },
- src/services/mcpService.ts:664-665 (registration)Registration/dispatch point in the CallToolRequestSchema handler switch statement that routes 'list_rpop' calls to the handleListRpop method.case 'list_rpop': return await this.handleListRpop(args);