Skip to main content
Glama

string_mset

Set multiple key-value pairs in Redis simultaneously with a single batch operation, streamlining database updates and reducing manual input overhead.

Instructions

批量设置键值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyValuesYes键值对数组

Implementation Reference

  • The main handler function that implements the 'string_mset' tool logic. It ensures a Redis connection is active, invokes the RedisService.mset method with the provided keyValues array, and returns the result as formatted JSON text content.
    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 definition for the 'string_mset' tool, specifying an object with a required 'keyValues' array of objects each containing 'key' and 'value' strings.
    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 of the 'string_mset' tool in the ListTools response, including name, description, and input schema.
    { 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'] }
  • Dispatch case in the CallToolRequestSchema handler that routes 'string_mset' calls to the handleStringMset method.
    case 'string_mset': return await this.handleStringMset(args);

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