Skip to main content
Glama
fourcolors

Omi MCP Server

by fourcolors

create_omi_memories

Generate structured memories from text or explicit memory objects for a user using the Omi MCP Server. Ideal for organizing and extracting meaningful information from emails, social posts, or other sources.

Instructions

Creates Omi memories by extracting from text or using explicit memory objects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memoriesNoAn array of explicit memory objects to be created directly. Either this or text must be provided.
textNoThe text content from which memories will be extracted. Either this or memories must be provided.
text_sourceNoSource of the text content. Optional. Options: "email", "social_post", "other".
text_source_specNoAdditional specification about the source. Optional.
user_idYesThe user ID to create memories for

Implementation Reference

  • The handler function that executes the tool logic: validates input, constructs POST request to Omi API to create memories from provided text or explicit memories, handles errors.
    async ({ user_id, text, memories, text_source, text_source_spec }) => {
    	try {
    		// Runtime check
    		if (!text && !memories) {
    			throw new Error('Either text or memories must be provided');
    		}
    
    		const url = `https://api.omi.me/v2/integrations/${APP_ID}/user/memories?uid=${user_id}`;
    
    		// Construct the body, including only defined fields
    		const body: Record<string, any> = {};
    		if (text) body.text = text;
    		if (memories) body.memories = memories;
    		if (text_source) body.text_source = text_source;
    		if (text_source_spec) body.text_source_spec = text_source_spec;
    
    		log(`Creating memories with URL: ${url}`);
    		log(`Request body: ${JSON.stringify(body)}`);
    
    		const response = await fetch(url, {
    			method: 'POST',
    			headers: {
    				Authorization: `Bearer ${API_KEY}`,
    				'Content-Type': 'application/json',
    			},
    			body: JSON.stringify(body),
    		});
    
    		log(`Response status: ${response.status}`);
    
    		if (!response.ok) {
    			const errorText = await response.text();
    			throw new Error(`Failed to create memory: ${response.status} ${response.statusText} - ${errorText}`);
    		}
    
    		return {
    			content: [{ type: 'text', text: '{}' }],
    		};
    	} catch (error) {
    		log(`Error creating memory: ${error}`);
    		throw new Error(`Failed to create memory: ${error instanceof Error ? error.message : String(error)}`);
    	}
    }
  • Zod schema defining the input parameters: user_id, optional text or memories, text_source, text_source_spec.
    	user_id: z.string().describe('The user ID to create memories for'),
    	text: z.string().optional().describe('The text content from which memories will be extracted. Either this or memories must be provided.'),
    	memories: z
    		.array(
    			z.object({
    				content: z.string().describe('The content of the memory. Required.'),
    				tags: z.array(z.string().describe('A tag for the memory.')).optional().describe('Optional tags for the memory.'),
    			})
    		)
    		.optional()
    		.describe('An array of explicit memory objects to be created directly. Either this or text must be provided.'),
    	text_source: z.enum(['email', 'social_post', 'other']).optional().describe('Source of the text content. Optional. Options: "email", "social_post", "other".'),
    	text_source_spec: z.string().optional().describe('Additional specification about the source. Optional.'),
    },
  • src/index.ts:307-368 (registration)
    The server.tool registration call that defines and registers the create_omi_memories tool with MCP server.
    server.tool(
    	'create_omi_memories',
    	'Creates Omi memories by extracting from text or using explicit memory objects',
    	{
    		user_id: z.string().describe('The user ID to create memories for'),
    		text: z.string().optional().describe('The text content from which memories will be extracted. Either this or memories must be provided.'),
    		memories: z
    			.array(
    				z.object({
    					content: z.string().describe('The content of the memory. Required.'),
    					tags: z.array(z.string().describe('A tag for the memory.')).optional().describe('Optional tags for the memory.'),
    				})
    			)
    			.optional()
    			.describe('An array of explicit memory objects to be created directly. Either this or text must be provided.'),
    		text_source: z.enum(['email', 'social_post', 'other']).optional().describe('Source of the text content. Optional. Options: "email", "social_post", "other".'),
    		text_source_spec: z.string().optional().describe('Additional specification about the source. Optional.'),
    	},
    	async ({ user_id, text, memories, text_source, text_source_spec }) => {
    		try {
    			// Runtime check
    			if (!text && !memories) {
    				throw new Error('Either text or memories must be provided');
    			}
    
    			const url = `https://api.omi.me/v2/integrations/${APP_ID}/user/memories?uid=${user_id}`;
    
    			// Construct the body, including only defined fields
    			const body: Record<string, any> = {};
    			if (text) body.text = text;
    			if (memories) body.memories = memories;
    			if (text_source) body.text_source = text_source;
    			if (text_source_spec) body.text_source_spec = text_source_spec;
    
    			log(`Creating memories with URL: ${url}`);
    			log(`Request body: ${JSON.stringify(body)}`);
    
    			const response = await fetch(url, {
    				method: 'POST',
    				headers: {
    					Authorization: `Bearer ${API_KEY}`,
    					'Content-Type': 'application/json',
    				},
    				body: JSON.stringify(body),
    			});
    
    			log(`Response status: ${response.status}`);
    
    			if (!response.ok) {
    				const errorText = await response.text();
    				throw new Error(`Failed to create memory: ${response.status} ${response.statusText} - ${errorText}`);
    			}
    
    			return {
    				content: [{ type: 'text', text: '{}' }],
    			};
    		} catch (error) {
    			log(`Error creating memory: ${error}`);
    			throw new Error(`Failed to create memory: ${error instanceof Error ? error.message : String(error)}`);
    		}
    	}
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the creation action and two input methods, it doesn't disclose important behavioral traits like whether this is a write operation (implied but not stated), what permissions are needed, whether it's idempotent, what happens on failure, or what the return format looks like. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 clearly states the tool's purpose and two key input methods. It's front-loaded with essential information and contains no redundant or unnecessary words, making it easy to parse quickly.

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

Completeness2/5

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

Given that this is a creation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'Omi memories' are in this context, what the tool returns (e.g., success/failure, created memory IDs), or any behavioral constraints (e.g., rate limits, authentication needs). For a tool with 5 parameters and significant functionality, more context is needed to use it effectively.

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?

Schema description coverage is 100%, meaning all parameters are well-documented in the input schema itself. The description adds minimal value beyond the schema by mentioning 'extracting from text' (hinting at the 'text' parameter) and 'using explicit memory objects' (hinting at the 'memories' parameter), but doesn't provide additional semantic context like examples, edge cases, or relationships between parameters. This meets the baseline for high schema coverage.

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 action ('creates Omi memories') and specifies two methods ('extracting from text' or 'using explicit memory objects'), which gives a good sense of what the tool does. However, it doesn't differentiate itself from sibling tools like 'create_omi_conversation' or 'read_omi_memories', leaving some ambiguity about when to use this specific memory creation tool versus other memory/conversation tools.

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

Usage Guidelines3/5

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

The description implies usage by mentioning two input methods ('extracting from text' or 'using explicit memory objects'), which provides some context for when to use it. However, it doesn't explicitly state when to choose this tool over alternatives like 'create_omi_conversation' or 'read_omi_memories', nor does it mention any prerequisites or exclusions. The guidance is present but incomplete.

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