Skip to main content
Glama

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
NameRequiredDescriptionDefault
keyYes列表键名
startYes起始索引
stopYes结束索引

Implementation Reference

  • 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) } ] }; }
  • 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'] } },
  • Dispatch registration in the tool request handler switch statement.
    case 'list_range': return await this.handleListRange(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/redis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server