Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

rpush

Push a value onto the right of a Redis list and optionally set an expiration time for the list.

Instructions

Push a value onto the right of a Redis list and optionally set an expiration time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueYes
expireNo

Implementation Reference

  • The rpush tool handler function. It appends a value to the right end of a Redis list (r.rpush), optionally sets an expiration, and returns a success or error message. Registered inline with the @mcp.tool() decorator.
    @mcp.tool() async def rpush(name: str, value: FieldT, expire: Optional[int] = None) -> str: """Push a value onto the right of a Redis list and optionally set an expiration time.""" try: r = RedisConnectionManager.get_connection() r.rpush(name, value) if expire: r.expire(name, expire) return f"Value '{value}' pushed to the right of list '{name}'." except RedisError as e: return f"Error pushing value to list '{name}': {str(e)}"
  • The @mcp.tool() decorator registers the rpush function as an MCP tool.
    @mcp.tool()

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