get_ai_action_responses
Filter and retrieve AI-generated responses by prompt, message, or conversation ID in Carbon Voice. Narrow results with combined filters to view all responses tied to specific interactions.
Instructions
Retrieve previously generated AI Action (Prompt) responses by filtering for a specific prompt, message, or conversation ID. Combine filters to narrow results and view all AI-generated responses related to a particular prompt, message, or conversation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | No | ||
| date | No | ||
| direction | No | ||
| limit | No | ||
| message_id | No | ||
| prompt_id | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"channel_id": {
"type": "string"
},
"date": {
"format": "date-time",
"type": "string"
},
"direction": {
"enum": [
"older",
"newer"
],
"type": "string"
},
"limit": {
"default": 50,
"type": "number"
},
"message_id": {
"type": "string"
},
"prompt_id": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/server.ts:929-944 (handler)The core handler function for the 'get_ai_action_responses' MCP tool. It takes input parameters, authenticates via authInfo, calls the generated simplifiedApi to fetch AI responses, formats the result as McpToolResponse, and handles errors.async ( args: AIResponseControllerGetAllResponsesParams, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.aIResponseControllerGetAllResponses( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting ai action responses:', { error }); return formatToMCPToolResponse(error); } },
- src/server.ts:917-945 (registration)Registration of the 'get_ai_action_responses' tool using server.registerTool, including tool name, description, input schema (Zod validation), annotations, and the handler function.server.registerTool( 'get_ai_action_responses', { description: 'Retrieve previously generated AI Action (Prompt) responses by filtering for a specific prompt, message, or conversation ID. ' + 'Combine filters to narrow results and view all AI-generated responses related to a particular prompt, message, or conversation.', inputSchema: aIResponseControllerGetAllResponsesQueryParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async ( args: AIResponseControllerGetAllResponsesParams, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.aIResponseControllerGetAllResponses( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting ai action responses:', { error }); return formatToMCPToolResponse(error); } }, );
- Zod schema definition for the input query parameters of the get_ai_action_responses tool, used for validation in the tool registration. Defines optional filters like message_id, prompt_id, channel_id, with limit, direction, and date.export const aIResponseControllerGetAllResponsesQueryLimitDefault = 50; export const aIResponseControllerGetAllResponsesQueryParams = zod.object({ "message_id": zod.string().optional(), "prompt_id": zod.string().optional(), "channel_id": zod.string().optional(), "limit": zod.number().default(aIResponseControllerGetAllResponsesQueryLimitDefault), "direction": zod.enum(['older', 'newer']).optional(), "date": zod.string().datetime({}).optional() })