Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

json_del

Remove JSON values from Redis at specified paths to manage and clean stored data efficiently.

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$

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The json_del tool handler function, decorated with @mcp.tool() which also handles registration. It deletes a JSON value at the specified path in a Redis-stored JSON document and returns a success or error message.
    @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)}"
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the destructive nature ('Delete'), but doesn't mention authentication requirements, rate limits, error conditions beyond generic 'error message', or what happens if the path doesn't exist. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

Perfectly structured with purpose statement, parameter explanations, and return value note in three compact sections. Every sentence earns its place with zero wasted words. The information is front-loaded with the core purpose stated first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations but with output schema (returns success/error message), the description covers the essential purpose and parameters adequately. However, for a destructive operation, it should ideally mention permissions, side effects, or what 'success' actually means (e.g., number of deleted elements).

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 well by explaining both parameters: 'name' is 'The Redis key where the JSON document is stored' and 'path' is 'The JSON path to delete' with default value context. This adds meaningful semantics beyond the bare schema, though it doesn't explain JSON path syntax or format expectations.

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 a JSON value'), target resource ('from Redis at a given path'), and distinguishes it from siblings like 'delete' (general key deletion) and 'json_get'/'json_set' (JSON read/write operations). 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (deleting JSON values from Redis with path-based targeting) and implicitly distinguishes it from sibling 'delete' (which likely deletes entire keys). However, it doesn't explicitly state when NOT to use it or name specific alternatives beyond what's implied by the sibling list.

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