Skip to main content
Glama

string_mget

Retrieve multiple string values from Redis keys in a single operation to reduce network calls and improve performance when fetching multiple cached items or configuration settings.

Instructions

批量获取键值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysYes键名数组

Implementation Reference

  • Registration of the string_mget tool in the ListTools response, including name, description, and input schema.
    {
      name: 'string_mget',
      description: '批量获取键值',
      inputSchema: {
        type: 'object',
        properties: {
          keys: {
            type: 'array',
            items: { type: 'string' },
            description: '键名数组'
          }
        },
        required: ['keys']
      }
    },
  • The main handler function for the string_mget MCP tool. Ensures Redis connection, calls RedisService.mget, and returns formatted result.
    private async handleStringMget(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.mget(args.keys);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Dispatch case in the CallToolRequest handler that routes string_mget calls to the specific handler.
    case 'string_mget':
      return await this.handleStringMget(args);
  • Helper method in RedisService that performs the actual MGET operation using the Redis client library.
    async mget(keys: string[]): Promise<RedisOperationResult<(string | null)[]>> {
      return this.executeCommand(async () => {
        if (!this.client) throw new Error('Redis client not initialized');
        return await this.client.mGet(keys);
      });
    }
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. It states '批量获取键值' (batch get key-values), which implies a read-only operation, but doesn't specify whether it's atomic, what happens with missing keys, error handling, or performance characteristics. For a tool with zero annotation coverage, this is insufficient for safe invocation.

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 phrase '批量获取键值', which is extremely concise and front-loaded with the core action. Every word earns its place by specifying batch operation and resource, with no wasted text. It's appropriately sized for a simple retrieval tool.

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 no annotations and no output schema, the description is incomplete for a tool that likely returns multiple values. It doesn't explain the return format (e.g., array, map, error handling for missing keys), which is critical for an agent to process results. For a batch operation with zero structured metadata, more context is needed.

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?

The description implies batch retrieval but doesn't add meaning beyond the input schema, which has 100% coverage. The schema documents 'keys' as an array of strings, and the description's '批量' (batch) aligns with this but provides no additional details on constraints, formats, or examples. With high schema coverage, the baseline 3 is appropriate.

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 '批量获取键值' clearly states the action (获取/get) and resource (键值/key-values) in Chinese, translating to 'batch get key-values'. It's specific about the batch operation, though it doesn't explicitly differentiate from its sibling 'string_get' which likely handles single keys. The purpose is clear but lacks explicit sibling distinction.

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 the sibling 'string_get' for single-key operations or other retrieval tools like 'hash_get', leaving the agent to infer usage from the name alone. No context or exclusions are provided.

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