Skip to main content
Glama

list_rpush

Add elements to the end of a Redis list to manage data sequences or implement queue structures.

Instructions

右侧推入列表

Input Schema

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

Implementation Reference

  • The handler function that executes the list_rpush tool logic. It ensures Redis connection and calls rpush on RedisService with key and values, returning the result as text 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)
          }
        ]
      };
    }
  • The input schema definition for the list_rpush tool, specifying key (string) and values (string or array of strings).
    {
      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']
      }
  • The switch case in the CallToolRequestSchema handler that dispatches list_rpush calls to the handleListRpush method.
    case 'list_rpush':
      return await this.handleListRpush(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