Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

unsubscribe

Stop receiving messages from a specific Redis channel by unsubscribing from it, managing your data subscriptions effectively.

Instructions

Unsubscribe from a Redis channel.

Args: channel: The Redis channel to unsubscribe from.

Returns: A success message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'unsubscribe' tool. It uses Redis pubsub to unsubscribe from the specified channel and returns a success or error message. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def unsubscribe(channel: str) -> str:
        """Unsubscribe from a Redis channel.
    
        Args:
            channel: The Redis channel to unsubscribe from.
    
        Returns:
            A success message or an error message.
        """
        try:
            r = RedisConnectionManager.get_connection()
            pubsub = r.pubsub()
            pubsub.unsubscribe(channel)
            return f"Unsubscribed from channel '{channel}'."
        except RedisError as e:
            return f"Error unsubscribing from channel '{channel}': {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. It mentions the action but lacks details on effects (e.g., whether it stops receiving messages, impacts other subscribers, or requires specific permissions), rate limits, or error conditions beyond a generic mention of returns.

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 and front-loaded with the core action, followed by brief parameter and return details. It avoids redundancy and uses minimal sentences, though the 'Returns' section is somewhat generic and could be more specific.

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 the tool's moderate complexity (a mutation operation with no annotations), the description is minimally adequate. It covers the basic action and parameter but lacks details on behavioral traits, error handling, or integration with siblings like 'subscribe.' The presence of an output schema helps, but more context is needed for full 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?

The description adds meaningful context for the single parameter 'channel' by specifying it as 'The Redis channel to unsubscribe from,' which clarifies its role beyond the schema's basic type. With 0% schema description coverage and only one parameter, this compensates adequately, though it could detail format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('unsubscribe') and resource ('from a Redis channel'), making the purpose explicit. It distinguishes from siblings like 'subscribe' by indicating the opposite action, though it doesn't explicitly contrast with other Redis operations beyond the basic function.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active subscription), exclusions, or related tools like 'subscribe' for context, leaving usage unclear beyond the basic action.

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