Skip to main content
Glama

list_rpush

Appends one or multiple values to the end of a Redis list, specified by its key. Enables efficient data management and updates in Redis databases for streamlined operations.

Instructions

右侧推入列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes列表键名
valuesYes要推入的值或值数组

Implementation Reference

  • MCP tool handler for 'list_rpush': validates connection, calls RedisService.rpush(key, values), and formats result as MCP content.
    private async handleListRpush(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.rpush(args.key, args.values); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Input schema definition for 'list_rpush' tool, specifying key and values (string or array).
    { name: 'list_rpush', description: '右侧推入列表', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '列表键名' }, values: { oneOf: [ { type: 'string', description: '值' }, { type: 'array', items: { type: 'string' }, description: '值数组' } ], description: '要推入的值或值数组' } }, required: ['key', 'values'] }
  • Dispatch case in CallToolRequestSchema handler that routes 'list_rpush' calls to handleListRpush.
    case 'list_rpush': return await this.handleListRpush(args);
  • RedisService.rpush implementation: handles string or array values, ensures connection, calls underlying Redis client rPush.
    async rpush(key: string, values: string | string[]): Promise<RedisOperationResult<number>> { return this.executeCommand(async () => { if (!this.client) throw new Error('Redis client not initialized'); if (Array.isArray(values)) { return await this.client.rPush(key, values); } else { return await this.client.rPush(key, values); } }); }

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