get_conversation
Retrieve a specific conversation by its ID to access messages and voice memos from Carbon Voice.
Instructions
Get a conversation by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/server.ts:437-460 (registration)Registration of the MCP tool 'get_conversation', including description, input schema, and the handler function that executes the logic by calling the simplified Carbon Voice API to fetch the conversation by ID.server.registerTool( 'get_conversation', { description: 'Get a conversation by its ID.', inputSchema: getConversationByIdParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getConversationById( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting conversation by id:', { error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:447-459 (handler)The handler function for the 'get_conversation' tool, which takes conversation ID, authenticates, calls the API, formats response or error.async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getConversationById( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting conversation by id:', { error }); return formatToMCPToolResponse(error); } },
- Zod schema definition for the input parameters of getConversationById, used as inputSchema: getConversationByIdParams.shape in the tool registration. Requires a conversation 'id' string.export const getConversationByIdParams = zod.object({ "id": zod.string() })
- Helper function getConversationById from the generated Carbon Voice Simplified API wrapper, which performs the actual HTTP GET request to retrieve conversation details by ID.const getConversationById = ( id: string, options?: SecondParameter<typeof mutator>, ) => { return mutator<Conversation>( { url: `/simplified/conversations/${id}`, method: 'GET' }, options, ); };