Skip to main content
Glama

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
NameRequiredDescriptionDefault
keyYes集合键名
membersYes要移除的成员或成员数组

Implementation Reference

  • 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)
          }
        ]
      };
    }
  • 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']
    }
  • 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']
      }
    },
  • 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);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. '移除' (remove) implies a destructive mutation, but the description doesn't specify whether this operation is reversible, what happens if members don't exist (e.g., silent ignore or error), or any side effects like returning the number of removed members. It lacks details on permissions, rate limits, or error conditions, which are critical for a mutation tool.

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

Conciseness4/5

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

The description is a single phrase '移除集合成员', which is very concise and front-loaded with the core action. There's no wasted text, but it might be overly terse, risking under-specification. It earns a 4 for efficiency, though it could benefit from slightly more context without losing conciseness.

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 complexity (a destructive mutation tool with no annotations and no output schema), the description is incomplete. It doesn't explain what the tool returns (e.g., number of removed members, success status, or error messages), behavioral traits like idempotency, or how it interacts with sibling tools. For a mutation operation, this leaves significant gaps for an AI agent to use it correctly.

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 both parameters: 'key' as the set key name and 'members' as the member(s) to remove. The description adds no additional meaning beyond what the schema provides (e.g., no examples, format details, or constraints). With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description '移除集合成员' (remove set members) clearly states the verb 'remove' and the resource 'set members', which is specific. However, it doesn't distinguish this tool from sibling tools like 'zset_remove' (which removes from sorted sets) or 'hash_del' (which removes from hashes), leaving ambiguity about when to use this specific set removal tool versus others.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the set must exist), exclusions (e.g., not for removing from other data types like hashes or lists), or refer to sibling tools like 'set_add' for adding members or 'set_members' for listing them. Usage is implied but not explicitly stated.

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