Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

delete

Remove a Redis key using its specified identifier. Returns a confirmation message upon successful deletion or an error message if the operation fails. Ideal for managing data in Redis efficiently.

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, decorated with @mcp.tool(). It deletes the specified Redis key and returns a confirmation or error message.
    @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