set_members
Retrieve all members from a Redis set by specifying the key. Use this tool to access complete set data for analysis or processing.
Instructions
获取集合所有成员
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 集合键名 |
Implementation Reference
- src/services/mcpService.ts:1126-1138 (handler)The handler function that executes the 'set_members' tool logic. It ensures Redis connection and calls smembers on the given key to retrieve all set members, returning the result as JSON text.private async handleSetMembers(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.smembers(args.key); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:396-406 (registration)Tool registration in the ListTools response, including name, description, and input schema requiring a 'key' string parameter.{ name: 'set_members', description: '获取集合所有成员', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '集合键名' } }, required: ['key'] } },
- src/services/mcpService.ts:674-675 (registration)Dispatch case in the CallToolRequest handler that routes 'set_members' calls to the handleSetMembers method.case 'set_members': return await this.handleSetMembers(args);