Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

xdel

Remove specific entries from Redis streams by providing the stream key and entry ID to manage data efficiently.

Instructions

Delete an entry from a Redis stream.

Args: key (str): The stream key. entry_id (str): The ID of the entry to delete.

Returns: str: Confirmation message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
entry_idYes

Implementation Reference

  • The main handler function for the 'xdel' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function deletes the specified entry from the Redis stream and returns a success message, 'not found' if no entry deleted, or an error message on failure.
    @mcp.tool() async def xdel(key: str, entry_id: str) -> str: """Delete an entry from a Redis stream. Args: key (str): The stream key. entry_id (str): The ID of the entry to delete. Returns: str: Confirmation message or an error message. """ try: r = RedisConnectionManager.get_connection() result = r.xdel(key, entry_id) return ( f"Successfully deleted entry {entry_id} from {key}" if result else f"Entry {entry_id} not found in {key}" ) except RedisError as e: return f"Error deleting from stream {key}: {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