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);

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