Skip to main content
Glama

string_mset

Set multiple Redis key-value pairs simultaneously to optimize database operations and reduce network overhead.

Instructions

批量设置键值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyValuesYes键值对数组

Implementation Reference

  • Handler function that executes the string_mset tool by calling RedisService.mset on the array of key-value pairs.
    private async handleStringMset(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.mset(args.keyValues);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Input schema for the string_mset tool defining the expected keyValues array structure.
    {
      name: 'string_mset',
      description: '批量设置键值',
      inputSchema: {
        type: 'object',
        properties: {
          keyValues: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                key: { type: 'string', description: '键名' },
                value: { type: 'string', description: '值' }
              },
              required: ['key', 'value']
            },
            description: '键值对数组'
          }
        },
        required: ['keyValues']
      }
    },
  • Registration in the tool dispatcher switch statement that maps 'string_mset' to its handler.
    case 'string_mset':
      return await this.handleStringMset(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. '设置' (set) implies a write/mutation operation, but the description doesn't disclose critical traits like whether this overwrites existing values, requires specific permissions, has rate limits, or what happens on failure. This is inadequate for a mutation tool with zero annotation coverage.

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 extremely concise with just four characters ('批量设置键值'), which efficiently conveys the core action. There's no wasted text, and it's front-loaded with the essential verb and object, making it easy to parse quickly.

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 of a batch write operation, no annotations, and no output schema, the description is incomplete. It lacks information on behavioral traits, error handling, return values, and differentiation from siblings. This is insufficient for safe and effective tool invocation in a multi-tool environment.

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 the parameter 'keyValues' clearly documented as an array of key-value objects. The description adds no additional meaning beyond what the schema provides, such as explaining key constraints or value formatting. With high schema coverage, the baseline score of 3 is appropriate.

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 '批量设置键值' (batch set key-values) states the tool's general purpose as a batch write operation, but it's vague about what resource it operates on. It doesn't specify that this is for Redis string operations or distinguish it from sibling tools like hash_mset or string_set, leaving ambiguity about its exact scope.

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. With sibling tools like string_set (single set), hash_mset (hash batch set), and string_mget (batch get), the description doesn't indicate whether this is for strings specifically, when batch operations are preferred, or any prerequisites for use.

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