get_conversation_users
Retrieve all participants in a Carbon Voice conversation to identify who is involved in the discussion.
Instructions
Get users in a conversation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/server.ts:462-485 (registration)MCP tool registration for 'get_conversation_users', including the handler function that calls the simplified API with conversation ID and formats the response.server.registerTool( 'get_conversation_users', { description: 'Get users in a conversation.', inputSchema: getConversationByIdParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getConversationUsers( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting conversation users:', { error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:472-484 (handler)Handler function for the 'get_conversation_users' tool: fetches users for a given conversation ID using the Carbon Voice API.async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getConversationUsers( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting conversation users:', { error }); return formatToMCPToolResponse(error); } },
- Zod schema for input parameters (conversation ID), used as inputSchema for the tool.export const getConversationByIdParams = zod.object({ "id": zod.string() })
- Generated API client function that performs the HTTP GET request to retrieve users in a conversation.const getConversationUsers = ( id: string, options?: SecondParameter<typeof mutator>, ) => { return mutator<User[]>( { url: `/simplified/conversations/${id}/users`, method: 'GET' }, options, ); };
- Zod schema defining the expected response structure for conversation users (array of user objects).export const getConversationUsersResponseItem = zod.object({ "id": zod.string().describe(' ID'), "link": zod.string().describe('Link to User'), "created_at": zod.string().datetime({}), "first_name": zod.string().describe('First Name'), "last_name": zod.string().optional().describe('Last Name'), "full_name": zod.string().describe('Full Name'), "image_url": zod.string().optional().describe('Image Url'), "emails": zod.array(zod.string()).optional().describe('List of emails (First one is the primary)'), "phones": zod.array(zod.string()).optional().describe('List of phones (First one is the primary)'), "languages": zod.array(zod.string()).optional().describe('List of languages (First one is the primary)') }) export const getConversationUsersResponse = zod.array(getConversationUsersResponseItem)