list_conversations
Retrieve a simplified view of recent user conversations, including messages sent or received within the last 6 months, using Carbon Voice’s communication management tool.
Instructions
List all conversations. Returns a simplified view of user conversations that have had messages sent or received within the last 6 months.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/server.ts:411-435 (registration)Registration of the 'list_conversations' MCP tool, including its description, empty input schema, annotations, and inline handler function that fetches conversations using the simplified API and formats the response.server.registerTool( 'list_conversations', { description: 'List all conversations. ' + 'Returns a simplified view of user conversations that have had messages sent or received within the last 6 months.', inputSchema: z.object({}).shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args: unknown, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getAllConversations( setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error listing conversations:', { error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:423-435 (handler)The inline handler function for the 'list_conversations' tool. It takes no input args (unknown), uses authInfo to set headers, calls simplifiedApi.getAllConversations(), formats the result with formatToMCPToolResponse, and handles errors by logging and returning formatted error.async (args: unknown, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getAllConversations( setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error listing conversations:', { error }); return formatToMCPToolResponse(error); } }, );