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

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)}"

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