Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

json_del

Remove specific JSON values stored in Redis by specifying the key and JSON path. Simplify data management by deleting targeted elements directly.

Instructions

Delete a JSON value from Redis at a given path.

Args: name: The Redis key where the JSON document is stored. path: The JSON path to delete (default: root '$').

Returns: A success message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathNo$

Implementation Reference

  • The main handler function for the 'json_del' tool. It is decorated with @mcp.tool(), which likely handles both definition and registration. Implements deletion of JSON values in Redis using jsonpath-like paths.
    @mcp.tool() async def json_del(name: str, path: str = "$") -> str: """Delete a JSON value from Redis at a given path. Args: name: The Redis key where the JSON document is stored. path: The JSON path to delete (default: root '$'). Returns: A success message or an error message. """ try: r = RedisConnectionManager.get_connection() deleted = r.json().delete(name, path) return ( f"Deleted JSON value at path '{path}' in '{name}'." if deleted else f"No JSON value found at path '{path}' in '{name}'." ) except RedisError as e: return f"Error deleting JSON value at path '{path}' in '{name}': {str(e)}"
  • The @mcp.tool() decorator registers the json_del function as an MCP tool.
    @mcp.tool()

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