Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

lpop

Remove and return the first element from a Redis list to process queue items or retrieve stored data in sequence.

Instructions

Remove and return the first element from a Redis list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'lpop' tool. It is decorated with @mcp.tool(), which handles registration and schema inference from the signature and docstring. Pops the leftmost element from a Redis list.
    @mcp.tool()
    async def lpop(name: str) -> str:
        """Remove and return the first element from a Redis list."""
        try:
            r = RedisConnectionManager.get_connection()
            value = r.lpop(name)
            return value if value else f"List '{name}' is empty or does not exist."
        except RedisError as e:
            return f"Error popping value from list '{name}': {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool removes and returns an element, implying mutation, but does not cover critical behaviors like error handling (e.g., if the list is empty or doesn't exist), side effects (e.g., list modification), or performance aspects (e.g., time complexity). This leaves significant gaps for an agent to understand operational risks.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse and understand quickly, with no wasted information.

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

Completeness3/5

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

Given the tool's moderate complexity (a mutation operation on Redis lists), no annotations, and an output schema present (which likely covers return values), the description is minimally adequate. It explains the basic action but lacks details on behavior, error cases, and parameter semantics, leaving the agent with incomplete context for safe and 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?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It implies the parameter 'name' refers to the Redis list key, but does not explicitly state this or provide examples (e.g., format, constraints). This adds minimal meaning beyond the schema, resulting in a baseline score due to the single parameter.

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

Purpose5/5

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

The description clearly states the action ('Remove and return') and the target resource ('the first element from a Redis list'), using specific verbs and distinguishing it from siblings like 'rpop' (which removes from the right end) and 'lpush' (which adds to the left). It precisely defines what the tool does without being vague or tautological.

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?

The description provides no guidance on when to use this tool versus alternatives, such as 'rpop' for removing from the right end or 'lrange' for reading without removal. It lacks context about prerequisites (e.g., the list must exist) or exclusions, offering only a basic functional statement without usage scenarios.

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/redis/mcp-redis'

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