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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it correctly identifies this as a deletion operation (implying mutation/destruction), it doesn't mention permission requirements, whether deletions are permanent, error conditions, or rate limits. The return value description is minimal ('Confirmation message or an error message').

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 perfectly structured and concise: a clear purpose statement followed by well-organized Args and Returns sections. Every sentence earns its place, with no redundant information or unnecessary elaboration.

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?

For a destructive operation with no annotations, the description is minimally adequate. It covers the basic purpose and parameters, and the output schema exists (though not shown). However, it lacks important context about the mutation's consequences, error handling, and relationship to sibling tools, leaving gaps for an agent.

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: 'key (str): The stream key' and 'entry_id (str): The ID of the entry to delete.' This adds essential semantic meaning beyond the bare schema, though it doesn't provide format examples or constraints.

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 ('Delete') and target resource ('an entry from a Redis stream'), distinguishing it from sibling tools like 'delete' (generic key deletion) and 'json_del' (JSON-specific deletion). 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 'delete' or 'json_del', nor does it mention prerequisites, constraints, or typical use cases. It simply states what the tool does without contextual usage information.

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