list_ai_actions
Retrieve available AI prompts and actions from Carbon Voice, with optional filtering by owner type or workspace for targeted results.
Instructions
List AI Actions (Prompts). Optionally, you can filter by owner type and workspace id. Filtering by owner type, Possible values: "user", "workspace", "system". Do not use unless the user explicitly requests it.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner_type | No | ||
| workspace_id | No |
Implementation Reference
- src/server.ts:830-859 (registration)Registration of the 'list_ai_actions' MCP tool, including description, input schema reference, annotations, and the inline handler function that calls the simplified API with authentication.server.registerTool( 'list_ai_actions', { description: 'List AI Actions (Prompts). Optionally, you can filter by owner type and workspace id. ' + 'Filtering by owner type, Possible values: "user", "workspace", "system". ' + 'Do not use unless the user explicitly requests it.', inputSchema: aIPromptControllerGetPromptsQueryParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async ( args: AIPromptControllerGetPromptsParams, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.aIPromptControllerGetPrompts( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error listing ai actions:', { error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:843-858 (handler)The executing handler for the tool: authenticates using authInfo.token, calls simplifiedApi.aIPromptControllerGetPrompts with args and header, formats the response using formatToMCPToolResponse, handles errors.async ( args: AIPromptControllerGetPromptsParams, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.aIPromptControllerGetPrompts( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error listing ai actions:', { error }); return formatToMCPToolResponse(error); } },
- TypeScript type definition for the input parameters to the tool, used for validation via Zod schema aIPromptControllerGetPromptsQueryParams.shape: optional owner_type (user/workspace/system) and workspace_id.export type AIPromptControllerGetPromptsParams = { owner_type?: AIPromptControllerGetPromptsOwnerType; workspace_id?: string; };
- Const enum defining possible values for owner_type: 'user', 'workspace', 'system'.export const AIPromptControllerGetPromptsOwnerType = { user: 'user', workspace: 'workspace', system: 'system', } as const;
- Generated API helper function in simplifiedApi that performs the actual HTTP GET request to `/prompts` endpoint with query params to retrieve the list of AI prompts (actions).const aIPromptControllerGetPrompts = ( params?: AIPromptControllerGetPromptsParams, options?: SecondParameter<typeof mutator>, ) => { return mutator<AIPrompt[]>( { url: `/prompts`, method: 'GET', params }, options, ); };