Skip to main content
Glama
fourcolors

Omi MCP Server

by fourcolors

read_omi_memories

Retrieve user memories from Omi with pagination support. Specify a user ID, limit, and offset to fetch memories efficiently for AI assistant integration.

Instructions

Retrieves user memories from Omi with pagination options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of memories to return (max: 1000, default: 100)
offsetNoNumber of memories to skip for pagination (default: 0)
user_idYesThe user ID to fetch memories for

Implementation Reference

  • The handler function that implements the tool logic: constructs API URL for Omi memories endpoint, fetches data using API key, parses as MemoriesResponse, and returns JSON of memories.
    async ({ user_id, limit, offset }) => {
    	try {
    		log(`Using appId: ${APP_ID}`);
    		log(`User ID: ${user_id}`);
    
    		// Construct URL with query parameters
    		const url = new URL(`https://api.omi.me/v2/integrations/${APP_ID}/memories`);
    		const params = new URLSearchParams();
    		params.append('uid', user_id);
    
    		if (typeof limit === 'number') {
    			params.append('limit', String(limit));
    		}
    		if (typeof offset === 'number') {
    			params.append('offset', String(offset));
    		}
    
    		url.search = params.toString();
    
    		const fetchUrl = url.toString();
    		log(`Fetching from URL: ${fetchUrl}`);
    
    		const response = await fetch(fetchUrl, {
    			method: 'GET',
    			headers: {
    				Authorization: `Bearer ${API_KEY}`,
    				'Content-Type': 'application/json',
    			},
    		});
    
    		log(`Response status: ${response.status}`);
    
    		if (!response.ok) {
    			const errorText = await response.text();
    			throw new Error(`Failed to fetch memories: ${response.status} ${response.statusText} - ${errorText}`);
    		}
    
    		const data = (await response.json()) as MemoriesResponse;
    		log('Data received');
    
    		const memories = data.memories || [];
    
    		return {
    			content: [{ type: 'text', text: JSON.stringify({ memories }) }],
    		};
    	} catch (error) {
    		log(`Error fetching memories: ${error}`);
    		throw new Error(`Failed to read memories: ${error instanceof Error ? error.message : String(error)}`);
    	}
    }
  • Zod schema for input parameters: user_id (string), limit (number optional), offset (number optional).
    {
    	user_id: z.string().describe('The user ID to fetch memories for'),
    	limit: z.number().optional().describe('Maximum number of memories to return (max: 1000, default: 100)'),
    	offset: z.number().optional().describe('Number of memories to skip for pagination (default: 0)'),
    },
  • src/index.ts:151-209 (registration)
    MCP server.tool registration of 'read_omi_memories' with description, input schema, and handler function.
    server.tool(
    	'read_omi_memories',
    	'Retrieves user memories from Omi with pagination options',
    	{
    		user_id: z.string().describe('The user ID to fetch memories for'),
    		limit: z.number().optional().describe('Maximum number of memories to return (max: 1000, default: 100)'),
    		offset: z.number().optional().describe('Number of memories to skip for pagination (default: 0)'),
    	},
    	async ({ user_id, limit, offset }) => {
    		try {
    			log(`Using appId: ${APP_ID}`);
    			log(`User ID: ${user_id}`);
    
    			// Construct URL with query parameters
    			const url = new URL(`https://api.omi.me/v2/integrations/${APP_ID}/memories`);
    			const params = new URLSearchParams();
    			params.append('uid', user_id);
    
    			if (typeof limit === 'number') {
    				params.append('limit', String(limit));
    			}
    			if (typeof offset === 'number') {
    				params.append('offset', String(offset));
    			}
    
    			url.search = params.toString();
    
    			const fetchUrl = url.toString();
    			log(`Fetching from URL: ${fetchUrl}`);
    
    			const response = await fetch(fetchUrl, {
    				method: 'GET',
    				headers: {
    					Authorization: `Bearer ${API_KEY}`,
    					'Content-Type': 'application/json',
    				},
    			});
    
    			log(`Response status: ${response.status}`);
    
    			if (!response.ok) {
    				const errorText = await response.text();
    				throw new Error(`Failed to fetch memories: ${response.status} ${response.statusText} - ${errorText}`);
    			}
    
    			const data = (await response.json()) as MemoriesResponse;
    			log('Data received');
    
    			const memories = data.memories || [];
    
    			return {
    				content: [{ type: 'text', text: JSON.stringify({ memories }) }],
    			};
    		} catch (error) {
    			log(`Error fetching memories: ${error}`);
    			throw new Error(`Failed to read memories: ${error instanceof Error ? error.message : String(error)}`);
    		}
    	}
    );
  • TypeScript interface for the Omi API memories response, used to type the parsed JSON.
    export interface MemoriesResponse {
    	memories: Memory[];
    }
  • TypeScript interface for individual Memory objects in the response.
    export interface Memory {
    	id: string;
    	content: string;
    	created_at: string;
    	tags: string[];
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'pagination options', which adds some context about how results are handled, but it does not cover other aspects like rate limits, authentication needs, error conditions, or what the return format looks like. This leaves gaps in understanding the tool's behavior beyond basic retrieval.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function and key feature (pagination). It is front-loaded with the core purpose and avoids unnecessary words, making it highly concise and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and hints at pagination but lacks details on return values, error handling, or usage context. This leaves the agent with incomplete information for effective tool invocation, though it meets a baseline for a read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, documenting all three parameters (limit, offset, user_id) with details like defaults and constraints. The description adds no additional meaning beyond this, as it only mentions 'pagination options' without elaborating on parameter usage. This meets the baseline for high schema coverage but does not enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Retrieves') and resource ('user memories from Omi'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'read_omi_conversations', which might retrieve a different type of data, so it lacks sibling differentiation for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as when to choose it over 'read_omi_conversations' or other siblings. It mentions pagination options but does not specify scenarios or prerequisites for usage, leaving the agent without contextual direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/fourcolors/omi-mcp'

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