Skip to main content
Glama

string_get

Retrieve stored string values from Redis databases by specifying the key. This tool enables AI assistants to access and work with string data in Redis through natural language commands.

Instructions

获取字符串值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes键名

Implementation Reference

  • The handler function that implements the core logic of the 'string_get' MCP tool. It ensures a Redis connection, fetches the string value using the RedisService, and returns the result as formatted JSON text content.
    private async handleStringGet(args: any) {
      this.ensureRedisConnection();
      const result = await this.redisService!.get(args.key);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Input schema for the 'string_get' tool, defining that it requires a single 'key' parameter of type string.
    inputSchema: {
      type: 'object',
      properties: {
        key: { type: 'string', description: '键名' }
      },
      required: ['key']
    }
  • Registration of the 'string_get' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'string_get',
      description: '获取字符串值',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: '键名' }
        },
        required: ['key']
      }
    },
  • Dispatch case in the CallToolRequestSchema handler that routes 'string_get' calls to the handleStringGet method.
    case 'string_get':
      return await this.handleStringGet(args);
Behavior1/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure but offers none. It doesn't indicate whether this is a read-only operation (likely, but not stated), what happens if the key doesn't exist (returns null/error?), whether there are authentication requirements, rate limits, or performance characteristics. The description provides zero behavioral context beyond the basic action implied by 'get'.

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 at just four Chinese characters ('获取字符串值'). While this represents severe under-specification for other dimensions, from a pure conciseness perspective it's maximally efficient with zero wasted words. Every character directly contributes to stating the core action, though it fails to provide necessary context.

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

Completeness1/5

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

Given the complexity of a Redis string retrieval operation (which requires understanding of Redis data types, error handling, and system context), the description is completely inadequate. With no annotations, no output schema, and a minimal description that doesn't even mention Redis or differentiate from sibling tools, this leaves the agent with insufficient information to use the tool correctly. The description fails to provide the minimal context needed for a database operation tool.

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 input schema has 100% description coverage with the parameter 'key' clearly documented as '键名' (key name). The description adds no additional parameter information beyond what the schema already provides. According to scoring rules, when schema_description_coverage is high (>80%), the baseline score is 3 even with no parameter information in the description, which applies here.

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

Purpose2/5

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

The description '获取字符串值' (Get string value) is a tautology that essentially restates the tool name 'string_get' in Chinese. It doesn't specify what resource this operates on (Redis string keys), what system it interacts with, or how it differs from sibling tools like 'hash_get' or 'string_mget'. While the verb '获取' (get) is clear, the purpose remains vague without context about the underlying data store.

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

Usage Guidelines1/5

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

The description provides absolutely no guidance about when to use this tool versus alternatives. It doesn't mention that this is for retrieving string values from Redis (as inferred from sibling tools), nor does it differentiate it from similar tools like 'hash_get' (for hash fields), 'string_mget' (for multiple strings), or 'key_type' (for checking data type). There's no indication of prerequisites, error conditions, or appropriate contexts 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