Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

zrem

Remove specific members from a Redis sorted set to manage ordered collections and maintain data accuracy in your database.

Instructions

Remove a member from a Redis sorted set.

Args: key (str): The sorted set key. member (str): The member to remove.

Returns: str: Confirmation message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
memberYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The zrem tool implementation: an async handler decorated with @mcp.tool() that removes a member from a Redis sorted set, handles Redis errors, and returns appropriate messages.
    @mcp.tool()
    async def zrem(key: str, member: str) -> str:
        """Remove a member from a Redis sorted set.
    
        Args:
            key (str): The sorted set key.
            member (str): The member to remove.
    
        Returns:
            str: Confirmation message or an error message.
        """
        try:
            r = RedisConnectionManager.get_connection()
            result = r.zrem(key, member)
            return (
                f"Successfully removed {member} from {key}"
                if result
                else f"Member {member} not found in {key}"
            )
        except RedisError as e:
            return f"Error removing from sorted set {key}: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action is a removal operation but doesn't mention whether this is destructive (it is), whether it requires specific permissions, what happens if the member doesn't exist, or any rate limits. The description provides basic function but lacks important behavioral context for a mutation tool.

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?

The description is well-structured with clear sections (purpose, Args, Returns) and uses minimal sentences. Every sentence earns its place by providing necessary information. It could be slightly more concise by integrating the Args explanation into the main description, but the structure is effective.

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 a mutation tool with no annotations, 2 parameters, and an output schema (which handles return values), the description is moderately complete. It covers purpose and parameters adequately but lacks behavioral context (destructive nature, error conditions, permissions). The output schema reduces the need to describe returns, but more behavioral transparency would improve completeness.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates by clearly explaining both parameters in the Args section: 'key (str): The sorted set key' and 'member (str): The member to remove.' This adds essential semantic meaning beyond the bare schema, though it doesn't elaborate on format constraints or examples.

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 ('Remove a member') and resource ('from a Redis sorted set'), distinguishing it from similar tools like srem (which removes from a set) and delete (which removes entire keys). The verb+resource combination is precise and unambiguous.

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 srem (for sets) or delete (for entire keys). It mentions the tool's purpose but offers no context about appropriate use cases 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/redis/mcp-redis'

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