set_remove
Remove specific members from a Redis set to manage collection data by deleting unwanted elements from a stored key.
Instructions
移除集合成员
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 集合键名 | |
| members | Yes | 要移除的成员或成员数组 |
Implementation Reference
- src/services/mcpService.ts:1109-1121 (handler)The handler function that implements the set_remove tool logic, ensuring Redis connection and executing SREM command to remove specified members from the set.private async handleSetRemove(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.srem(args.key, args.members); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:377-394 (schema)Input schema for the set_remove tool, validating parameters key (string) and members (string or array of strings).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:374-395 (registration)Registration of the set_remove tool in the MCP server's tools array, specifying name, description, and input schema.{ name: 'set_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:672-673 (registration)Switch case in the MCP request handler that routes 'set_remove' tool calls to the handleSetRemove method.case 'set_remove': return await this.handleSetRemove(args);