get
Retrieve string values from a Redis database using the Model Context Protocol (MCP). Provide a key to quickly fetch and manage stored data efficiently.
Instructions
Get string value
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key to get |
Implementation Reference
- src/tools/get_tool.ts:21-35 (handler)The execute method of GetTool that performs the Redis GET operation on the provided key and returns a ToolResponse.async execute(args: unknown, client: RedisClientType): Promise<ToolResponse> { if (!this.validateArgs(args)) { return this.createErrorResponse('Invalid arguments for get'); } try { const value = await client.get(args.key); if (value === null) { return this.createSuccessResponse('Key not found'); } return this.createSuccessResponse(value); } catch (error) { return this.createErrorResponse(`Failed to get key: ${error}`); } }
- src/tools/get_tool.ts:8-14 (schema)Input schema for the 'get' tool defining the required 'key' parameter.inputSchema = { type: 'object', properties: { key: { type: 'string', description: 'Key to get' } }, required: ['key'] };
- src/interfaces/types.ts:33-35 (schema)TypeScript interface defining arguments for the 'get' tool.export interface GetArgs { key: string; }
- src/tools/tool_registry.ts:30-31 (registration)Instantiation and registration of GetTool in the default tools array of ToolRegistry.new SetTool(), new GetTool(),
- src/tools/tool_registry.ts:7-7 (registration)Import of GetTool for registration.import { GetTool } from './get_tool.js';