zset_remove
Remove specific members from a sorted set in Redis using a specified key. Supports single or multiple member deletion for efficient data management within the Redis MCP server.
Instructions
移除有序集合成员
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 有序集合键名 | |
| members | Yes | 要移除的成员或成员数组 |
Implementation Reference
- src/services/mcpService.ts:1160-1172 (handler)The main execution handler for the 'zset_remove' MCP tool. Ensures Redis connection, removes specified members from the sorted set using the Redis service's zrem method, and returns the result count in MCP content format.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) } ] }; }
- src/services/mcpService.ts:445-466 (schema)The input schema and metadata registration for the 'zset_remove' tool in the ListTools response.{ 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'] } },
- src/services/mcpService.ts:680-681 (registration)Dispatch registration in the CallToolRequest handler switch statement that routes 'zset_remove' calls to its handler function.case 'zset_remove': return await this.handleZsetRemove(args);