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'] }

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