Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

delete

Remove a specified key from Redis to manage data storage and maintain database efficiency.

Instructions

Delete a Redis key.

Args: key (str): The key to delete.

Returns: str: Confirmation message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes

Implementation Reference

  • The handler function for the 'delete' tool. It deletes the specified Redis key using the Redis client's delete method and returns a success or not-found message. Registered via the @mcp.tool() decorator, which also defines the input schema via type hints and docstring.
    @mcp.tool() async def delete(key: str) -> str: """Delete a Redis key. Args: key (str): The key to delete. Returns: str: Confirmation message or an error message. """ try: r = RedisConnectionManager.get_connection() result = r.delete(key) return f"Successfully deleted {key}" if result else f"Key {key} not found" except RedisError as e: return f"Error deleting key {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