Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

xdel

Remove a specific entry from a Redis stream by specifying the stream key and entry ID, ensuring precise data management and cleanup.

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
entry_idYes
keyYes

Implementation Reference

  • The 'xdel' tool handler: an async function decorated with @mcp.tool() that deletes a specific entry from a Redis stream using RedisConnectionManager. Returns success or not found message, handles RedisError.
    @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