get_conversation_users
Retrieve a list of users participating in a specific conversation within Carbon Voice. Input the conversation ID to access participant details efficiently.
Instructions
Get users in a conversation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/server.ts:462-485 (handler)The MCP tool handler and registration for 'get_conversation_users'. It takes a conversation ID, authenticates with the user's token, calls the Carbon Voice API via simplifiedApi.getConversationUsers, formats the response to McpToolResponse, and handles errors.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); } }, );
- Zod input schema used by the tool: requires a 'conversation id' string parameter.export const getConversationByIdParams = zod.object({ "id": zod.string() })
- Generated API client function called by the tool handler to fetch users from a conversation via GET /simplified/conversations/{id}/users.const getConversationUsers = ( id: string, options?: SecondParameter<typeof mutator>, ) => { return mutator<User[]>( { url: `/simplified/conversations/${id}/users`, method: 'GET' }, options, ); };
- TypeScript output type for the API response: User[]export type GetConversationUsersResult = NonNullable< Awaited< ReturnType< ReturnType<typeof getCarbonVoiceSimplifiedAPI>['getConversationUsers'] > > >;