Skip to main content
Glama
fourcolors

Omi MCP Server

by fourcolors

read_omi_conversations

Retrieve user conversations from Omi with pagination and filtering by status, user ID, or inclusion of discarded data for efficient data management.

Instructions

Retrieves user conversations from Omi with pagination and filtering options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_discardedNoWhether to include discarded conversations (default: false)
limitNoMaximum number of conversations to return (max: 1000, default: 100)
offsetNoNumber of conversations to skip for pagination (default: 0)
statusesNoComma-separated list of statuses to filter conversations by
user_idYesThe user ID to fetch conversations for

Implementation Reference

  • src/index.ts:74-140 (registration)
    Complete registration of the 'read_omi_conversations' MCP tool using server.tool(). Includes tool name, description, Zod input schema for parameters (user_id, limit, offset, include_discarded, statuses), and the inline async handler that builds the API request to Omi, fetches conversations, and returns them as JSON text content.
    server.tool(
    	'read_omi_conversations',
    	'Retrieves user conversations from Omi with pagination and filtering options',
    	{
    		user_id: z.string().describe('The user ID to fetch conversations for'),
    		limit: z.number().optional().describe('Maximum number of conversations to return (max: 1000, default: 100)'),
    		offset: z.number().optional().describe('Number of conversations to skip for pagination (default: 0)'),
    		include_discarded: z.boolean().optional().describe('Whether to include discarded conversations (default: false)'),
    		statuses: z.string().optional().describe('Comma-separated list of statuses to filter conversations by'),
    	},
    	async ({ user_id, limit, offset, include_discarded, statuses }) => {
    		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}/conversations`);
    			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));
    			}
    			if (typeof include_discarded === 'boolean') {
    				params.append('include_discarded', String(include_discarded));
    			}
    			if (typeof statuses === 'string' && statuses.length > 0) {
    				params.append('statuses', statuses);
    			}
    
    			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 conversations: ${response.status} ${response.statusText} - ${errorText}`);
    			}
    
    			const data = (await response.json()) as ConversationsResponse;
    			log('Data received');
    
    			const conversations = data.conversations || [];
    
    			return {
    				content: [{ type: 'text', text: JSON.stringify({ conversations }) }],
    			};
    		} catch (error) {
    			log(`Error fetching conversations: ${error}`);
    			throw new Error(`Failed to read conversations: ${error instanceof Error ? error.message : String(error)}`);
    		}
    	}
    );
  • TypeScript interface for the ConversationsResponse from Omi API, used to type the fetched data in the tool handler.
    export interface ConversationsResponse {
    	conversations: Conversation[];
    }
  • The core handler logic for the tool: constructs query parameters for pagination and filtering, makes authenticated GET request to Omi API endpoint https://api.omi.me/v2/integrations/{APP_ID}/conversations, parses response as ConversationsResponse, extracts conversations array, and returns as MCP content text block with JSON.
    async ({ user_id, limit, offset, include_discarded, statuses }) => {
    	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}/conversations`);
    		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));
    		}
    		if (typeof include_discarded === 'boolean') {
    			params.append('include_discarded', String(include_discarded));
    		}
    		if (typeof statuses === 'string' && statuses.length > 0) {
    			params.append('statuses', statuses);
    		}
    
    		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 conversations: ${response.status} ${response.statusText} - ${errorText}`);
    		}
    
    		const data = (await response.json()) as ConversationsResponse;
    		log('Data received');
    
    		const conversations = data.conversations || [];
    
    		return {
    			content: [{ type: 'text', text: JSON.stringify({ conversations }) }],
    		};
    	} catch (error) {
    		log(`Error fetching conversations: ${error}`);
    		throw new Error(`Failed to read conversations: ${error instanceof Error ? error.message : String(error)}`);
    	}
    }
Behavior2/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 and filtering options', which hints at some behavior, but fails to cover critical aspects like authentication requirements, rate limits, error handling, or what the return format looks like (e.g., JSON structure). For a retrieval tool with 5 parameters, this leaves significant gaps.

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 front-loads the core purpose ('retrieves user conversations from Omi') and adds relevant details ('with pagination and filtering options'). There is no wasted verbiage, making it highly concise and well-structured.

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 the complexity of a retrieval tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on authentication, rate limits, error cases, and the structure of returned data (e.g., conversation objects). Without annotations or an output schema, the agent has insufficient information to handle this tool effectively in context.

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%, so the input schema fully documents all 5 parameters with descriptions. The description adds minimal value by mentioning 'pagination and filtering options', which loosely corresponds to parameters like 'limit', 'offset', and 'statuses', but doesn't provide additional semantics beyond what the schema already specifies. 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 verb ('retrieves') and resource ('user conversations from Omi'), making the purpose evident. It also mentions 'pagination and filtering options' which adds specificity. However, it doesn't explicitly distinguish this tool from its sibling 'read_omi_memories', which might cause confusion about when to retrieve conversations versus memories.

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 like 'read_omi_memories' or 'create_omi_conversation'. It mentions filtering options but doesn't specify scenarios or prerequisites for usage, leaving the agent without context for tool selection.

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