Skip to main content
Glama

zset_remove

Remove members from a Redis sorted set to manage ordered data collections. Specify the key and members to delete for maintaining accurate sorted set structures.

Instructions

移除有序集合成员

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes有序集合键名
membersYes要移除的成员或成员数组

Implementation Reference

  • The primary handler function for the 'zset_remove' MCP tool. It ensures a Redis connection, calls zrem on the Redis service to remove members from the sorted set, and returns the result as JSON text.
    private async handleZsetRemove(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.zrem(args.key, args.members);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Dispatch case in the MCP tool request handler switch statement that routes 'zset_remove' calls to the specific handler method.
    case 'zset_remove':
      return await this.handleZsetRemove(args);
  • Registration of the 'zset_remove' tool in the MCP server's tools list. Includes name, description, and input schema for validation.
    {
      name: 'zset_remove',
      description: '移除有序集合成员',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: '有序集合键名' },
          members: {
            oneOf: [
              { type: 'string', description: '成员' },
              { 
                type: 'array', 
                items: { type: 'string' },
                description: '成员数组'
              }
            ],
            description: '要移除的成员或成员数组'
          }
        },
        required: ['key', 'members']
      }
    },
  • Input schema for the 'zset_remove' tool defining parameters: key (string) and members (string or array of strings). Used for validation.
    inputSchema: {
      type: 'object',
      properties: {
        key: { type: 'string', description: '有序集合键名' },
        members: {
          oneOf: [
            { type: 'string', description: '成员' },
            { 
              type: 'array', 
              items: { type: 'string' },
              description: '成员数组'
            }
          ],
          description: '要移除的成员或成员数组'
        }
      },
      required: ['key', 'members']
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It implies a destructive operation (remove) but doesn't disclose whether it's idempotent (safe for non-existent members), returns the number of removed members, or has side effects. For a mutation tool, this is inadequate transparency.

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?

The description is a single, efficient phrase in Chinese with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable for its intended audience.

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

Completeness2/5

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

For a destructive tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success/failure, return values, or error handling. Given the context of sibling Redis tools, more operational context is needed for safe use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in Chinese. The description adds no additional meaning beyond the schema (e.g., no examples of member formats or key naming conventions). Baseline 3 is appropriate as the schema adequately documents parameters.

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 '移除有序集合成员' (remove sorted set members) clearly states the action (remove) and target resource (sorted set members). It distinguishes from sibling tools like zset_add (add) and zset_range (query), but doesn't specify it's for Redis zsets versus other data structures, which slightly limits differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active Redis connection via connect_redis), error conditions (e.g., if key doesn't exist), or comparison to similar tools like set_remove (for unordered sets) or key_delete (for entire keys).

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/pickstar-2002/redis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server