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
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 键名 |
Implementation Reference
- src/services/mcpService.ts:837-849 (handler)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) } ] }; }
- src/services/mcpService.ts:118-124 (schema)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'] }
- src/services/mcpService.ts:115-125 (registration)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'] } },
- src/services/mcpService.ts:634-635 (registration)Dispatch case in the CallToolRequestSchema handler that routes 'string_get' calls to the handleStringGet method.case 'string_get': return await this.handleStringGet(args);