Skip to main content
Glama

set_add

Add one or multiple members to a Redis set using the specified key. This tool helps store unique values in Redis for data management and deduplication.

Instructions

添加集合成员

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes集合键名
membersYes要添加的成员或成员数组

Implementation Reference

  • The handler function that executes the 'set_add' tool logic: checks Redis connection, adds members to set using RedisService.sadd, and returns formatted result.
    private async handleSetAdd(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.sadd(args.key, args.members);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • The input schema definition for the 'set_add' tool provided in the ListTools response.
    {
      name: 'set_add',
      description: '添加集合成员',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: '集合键名' },
          members: {
            oneOf: [
              { type: 'string', description: '成员' },
              { 
                type: 'array', 
                items: { type: 'string' },
                description: '成员数组'
              }
            ],
            description: '要添加的成员或成员数组'
          }
        },
        required: ['key', 'members']
      }
  • The switch case in the CallToolRequestSchema handler that registers and dispatches 'set_add' tool calls to its handler function.
    case 'set_add':
      return await this.handleSetAdd(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the action ('add') but lacks behavioral details: it doesn't specify if duplicates are allowed, if the set is created if missing, error conditions, or performance implications. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase ('添加集合成员') that front-loads the core action. There is no wasted verbiage, making it highly concise and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is a mutation operation (adding to a set) with no annotations and no output schema, the description is incomplete. It lacks details on behavior (e.g., idempotency, creation on missing key), error handling, or return values, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'key' (集合键名 - set key name) and 'members' (要添加的成员或成员数组 - members or array of members to add). The description doesn't add meaning beyond the schema (e.g., format examples or constraints), so it meets the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '添加集合成员' (add set members) clearly states the verb 'add' and the resource 'set members', making the purpose immediately understandable. It distinguishes from siblings like 'set_members' (read) and 'set_remove' (delete), though it doesn't explicitly mention the 'set' data structure context beyond the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the set must exist), when not to use it (e.g., for removing members), or direct alternatives like 'set_remove' for deletion. The agent must infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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