list_range
Retrieve a specified range of elements from a Redis list by providing the key, start index, and stop index.
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 ensures Redis connection and executes LRANGE command via redisService to retrieve the list range.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)Tool schema definition including input validation for key, start, and stop parameters.{ 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 registration in the tool request handler switch statement.case 'list_range': return await this.handleListRange(args);