Skip to main content
Glama
Ritesh2351235

Omi Memories MCP Server

fetch-memories

Retrieve stored memories from a user's Omi account through the Model Context Protocol server interface.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the 'fetch-memories' tool logic. It makes an API request to fetch conversations for a specific user ID, formats the data into a readable text summary including IDs, times, titles, overviews, categories, emojis, and transcripts, and returns it as MCP content. Includes error handling for Axios errors.
        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:43-87 (registration)
    Registration of the 'fetch-memories' tool using McpServer.tool() method, specifying the tool name, an empty input schema (no parameters), and an inline async handler function.
      "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;
        }
      }
    );
  • Empty Zod schema object indicating the tool takes no input parameters.
    {},  // No parameters needed since we're using a specific user ID
  • TypeScript interface defining the Conversation type used to type the API response data in the handler, including structured metadata and transcript segments.
    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;
      }[];
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other 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