Skip to main content
Glama

fetch-memories

Retrieve specific user memories stored in the Omi Memories MCP Server interface for efficient access and management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Async handler function that fetches user memories from the Omi API, formats them into readable text blocks with details like ID, time, title, overview, category, emoji, and full transcript, and returns MCP-formatted text content or an error message.
    async () => { try { const response = await axios.get(`${EXPRESS_API_URL}/memories`, { params: { uid: SPECIFIC_USER_ID } }); const conversations: Conversation[] = response.data.conversations; // Format conversations for better readability const formattedText = conversations.map(conv => { return ` Memory: ${conv.id} Time: ${new Date(conv.created_at).toLocaleString()} Title: ${conv.structured.title} Overview: ${conv.structured.overview} Category: ${conv.structured.category} Emoji: ${conv.structured.emoji} Transcript: ${conv.transcript_segments.map(segment => ` ${segment.speaker}: ${segment.text}`).join('\n')} ------------------- `.trim(); }).join('\n\n'); return { content: [{ type: "text", text: formattedText }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `Error: Failed to fetch memories: ${error.message}` }], isError: true }; } throw error; } }
  • src/server.ts:42-87 (registration)
    MCP server tool registration for 'fetch-memories' with no input parameters (empty schema) and an inline async handler.
    server.tool( "fetch-memories", {}, // No parameters needed since we're using a specific user ID async () => { try { const response = await axios.get(`${EXPRESS_API_URL}/memories`, { params: { uid: SPECIFIC_USER_ID } }); const conversations: Conversation[] = response.data.conversations; // Format conversations for better readability const formattedText = conversations.map(conv => { return ` Memory: ${conv.id} Time: ${new Date(conv.created_at).toLocaleString()} Title: ${conv.structured.title} Overview: ${conv.structured.overview} Category: ${conv.structured.category} Emoji: ${conv.structured.emoji} Transcript: ${conv.transcript_segments.map(segment => ` ${segment.speaker}: ${segment.text}`).join('\n')} ------------------- `.trim(); }).join('\n\n'); return { content: [{ type: "text", text: formattedText }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `Error: Failed to fetch memories: ${error.message}` }], isError: true }; } throw error; } } );
  • TypeScript interface defining the structure of conversation/memory objects used within the fetch-memories handler for typing API response data.
    interface Conversation { id: string; created_at: string; started_at: string; finished_at: string; source: string; structured: { emoji: string; events: any[]; overview: string; title: string; action_items: any[]; category: string; }; transcript_segments: { is_user: boolean; start: number; end: number; text: string; speaker_id: number; speaker: string; person_id: null; }[]; }

Other Tools

Related 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/Ritesh2351235/Omi-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server