Skip to main content
Glama

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

Implementation Reference

  • 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) } ] }; }
  • 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'] } },
  • Dispatch case in the CallToolRequest handler that routes 'list_range' tool calls to the handleListRange method.
    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