Skip to main content
Glama

list_lpush

Add one or more values to the beginning of a Redis list, enabling efficient queue management and data prepending operations.

Instructions

左侧推入列表

Input Schema

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

Implementation Reference

  • The handler function that implements the 'list_lpush' MCP tool. It ensures Redis connection, calls redisService.lpush(key, values), and returns the result as formatted text content.
    private async handleListLpush(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.lpush(args.key, args.values);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the 'list_lpush' tool, specifying key (string) and values (string or array of strings).
    inputSchema: {
      type: 'object',
      properties: {
        key: { type: 'string', description: '列表键名' },
        values: {
          oneOf: [
            { type: 'string', description: '值' },
            { 
              type: 'array', 
              items: { type: 'string' },
              description: '值数组'
            }
          ],
          description: '要推入的值或值数组'
        }
      },
      required: ['key', 'values']
    }
  • Registration of the 'list_lpush' tool in the MCP ListTools response, including name, description, and input schema.
    {
      name: 'list_lpush',
      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 registration in the CallToolRequestSchema switch statement that routes 'list_lpush' calls to the handleListLpush method.
    // List 操作
    case 'list_lpush':
      return await this.handleListLpush(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose that this is a mutation operation (implied by 'push'), potential side effects (e.g., list creation if key doesn't exist), error conditions, or performance characteristics. The description adds minimal context beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise with a single phrase, but this brevity leads to under-specification rather than efficient communication. While front-loaded, it lacks necessary detail for a tool with mutation behavior and sibling alternatives.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Inadequate for a mutation tool with no annotations and no output schema. The description doesn't explain return values (e.g., new list length), error cases, or how it differs from list_rpush. Given the complexity of list operations and rich sibling toolset, more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter documentation in Chinese. The description adds no additional meaning about parameters beyond what the schema provides (e.g., no examples or constraints). Baseline score of 3 is appropriate since the schema adequately defines key and values parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '左侧推入列表' (left-push to list) states the action and target resource, but is vague about what exactly is being pushed and lacks differentiation from sibling tools like list_rpush (right-push). It doesn't specify it's for Redis lists or mention the tool's role in a data structure context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like list_rpush or list_lpop. The description doesn't provide context about left-push semantics (e.g., adding to the head of the list) or prerequisites, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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