Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

srem

Remove a specific value from a Redis set using the Redis MCP Server. Input the set key and value to manage data efficiently in agentic applications.

Instructions

Remove a value from a Redis set.

Args: name: The Redis set key. value: The value to remove from the set.

Returns: A success message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueYes

Implementation Reference

  • The srem tool handler: decorated with @mcp.tool(), removes a value from a Redis set using RedisConnectionManager and r.srem. Returns success message if removed, not found message if not present, or error on failure. The docstring provides input/output schema.
    @mcp.tool() async def srem(name: str, value: str) -> str: """Remove a value from a Redis set. Args: name: The Redis set key. value: The value to remove from the set. Returns: A success message or an error message. """ try: r = RedisConnectionManager.get_connection() removed = r.srem(name, value) return ( f"Value '{value}' removed from set '{name}'." if removed else f"Value '{value}' not found in set '{name}'." ) except RedisError as e: return f"Error removing value '{value}' from set '{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