set_members
Retrieve all members of a set stored in Redis using the specified key. Enables efficient data access and management for sets in Redis databases.
Instructions
获取集合所有成员
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 集合键名 |
Implementation Reference
- src/services/mcpService.ts:1126-1138 (handler)Handler function that checks Redis connection, calls smembers on the key, and returns the members as JSON text content.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 (schema)Tool registration including name, description, and input schema requiring a 'key' string.{ name: 'set_members', description: '获取集合所有成员', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '集合键名' } }, required: ['key'] } },
- src/services/mcpService.ts:674-675 (registration)Switch case in CallToolRequest handler that dispatches to the set_members handler.case 'set_members': return await this.handleSetMembers(args);