lithtrix_memory_get
Retrieve a stored memory by key to access persisted information across sessions and agents.
Instructions
Retrieve a stored memory by key (GET /v1/memory/{key}). Requires LITHTRIX_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Memory key (1–128 chars: letters, digits, hyphen, underscore, dot, colon) |
Implementation Reference
- tools/memory.js:148-166 (handler)Handler function for lithtrix_memory_get: validates API key, sends GET /v1/memory/{key} to the Lithtrix API, and returns the JSON response.
async ({ key }) => { const apiKey = process.env.LITHTRIX_API_KEY; if (!apiKey) return missingApiKeyResponse(); const path = `/v1/memory/${encodeURIComponent(key)}`; let response; try { response = await fetch(new URL(path, LITHTRIX_API_URL), { headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }, }); } catch (err) { return networkErrorResponse(err); } return apiJsonResponse(response); } ); - tools/memory.js:145-147 (schema)Input schema for lithtrix_memory_get: accepts a single 'key' parameter with a 1-128 character alphanumeric pattern.
{ key: memoryKeySchema, }, - tools/memory.js:10-17 (schema)memoryKeySchema reusable Zod schema: validates key format (1-128 chars, letters/digits/hyphen/underscore/dot/colon).
const memoryKeySchema = z .string() .min(1) .max(128) .regex(/^[a-zA-Z0-9\-_.:]+$/) .describe( "Memory key (1–128 chars: letters, digits, hyphen, underscore, dot, colon)" ); - tools/memory.js:142-166 (registration)Registration of lithtrix_memory_get tool via server.tool() in registerMemoryTools, called from index.js line 47.
server.tool( "lithtrix_memory_get", "Retrieve a stored memory by key (GET /v1/memory/{key}). Requires LITHTRIX_API_KEY.", { key: memoryKeySchema, }, async ({ key }) => { const apiKey = process.env.LITHTRIX_API_KEY; if (!apiKey) return missingApiKeyResponse(); const path = `/v1/memory/${encodeURIComponent(key)}`; let response; try { response = await fetch(new URL(path, LITHTRIX_API_URL), { headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }, }); } catch (err) { return networkErrorResponse(err); } return apiJsonResponse(response); } );