list_range
Extract specific elements from a Redis list by specifying a start and stop index, enabling precise data retrieval for efficient list management.
Instructions
获取列表范围
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 列表键名 | |
| start | Yes | 起始索引 | |
| stop | Yes | 结束索引 |
Implementation Reference
- src/services/mcpService.ts:1075-1087 (handler)Handler function that executes the list_range tool by calling Redis LRANGE command on the connected Redis service and returning the result as JSON text.private async handleListRange(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.lrange(args.key, args.start, args.stop); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:338-350 (schema)Input schema for the list_range tool defining required parameters: key (string), start (number), stop (number).{ name: 'list_range', description: '获取列表范围', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '列表键名' }, start: { type: 'number', description: '起始索引' }, stop: { type: 'number', description: '结束索引' } }, required: ['key', 'start', 'stop'] } },
- src/services/mcpService.ts:666-667 (registration)Dispatch case in the CallToolRequest handler that routes 'list_range' tool calls to the handleListRange method.case 'list_range': return await this.handleListRange(args);