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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention whether this is a destructive operation (modifies existing list), error conditions (e.g., if list doesn't exist), return values, or rate limits. The expiration feature is mentioned but not explained in behavioral terms.

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 front-loads the core action ('Push a value onto the right of a Redis list') and adds the optional feature. Every word earns its place with zero wasted text.

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 3 parameters with 0% schema coverage and no annotations, the description is incomplete. While an output schema exists (which reduces the need to explain return values), the description doesn't address important context like what happens when pushing to non-existent lists, atomicity guarantees, or how expiration interacts with list operations. It's minimally adequate but has clear gaps.

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?

With 0% schema description coverage, the description partially compensates by mentioning 'value' and 'expiration time' parameters, but doesn't explain the 'name' parameter (likely the list key). It doesn't provide format details for the expiration parameter or clarify that 'value' can be multiple data types. The baseline is 3 since it adds some meaning beyond the bare schema.

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 specific action ('Push a value onto the right of a Redis list') and resource ('Redis list'), distinguishing it from sibling tools like 'lpush' (left push) and 'rpop' (right pop). It explicitly mentions the optional expiration feature, which further differentiates its functionality.

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 like 'lpush', 'rpop', or 'set' for similar operations. It mentions the optional expiration but doesn't explain when this feature should be used or what happens if omitted.

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