smartlead_list_all_tests
Retrieve all Smart Delivery tests (manual or automated) with pagination controls to manage email marketing campaign testing data.
Instructions
List all Smart Delivery tests, either manual or automated.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of tests to retrieve (default: 10) | |
| offset | No | Offset for pagination (default: 0) | |
| testType | Yes | Type of tests to list (manual or auto) |
Implementation Reference
- src/handlers/smartDelivery.ts:387-426 (handler)The core handler function that validates input parameters using isListAllTestsParams, makes a POST request to the SmartDelivery API endpoint `/spam-test/report?testType=${testType}` with pagination params, and returns the JSON response or formatted error.async function handleListAllTests( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isListAllTestsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_list_all_tests' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { testType, limit = 10, offset = 0 } = args; const response = await withRetry( async () => smartDeliveryClient.post(`/spam-test/report?testType=${testType}`, { limit, offset }), 'list all tests' ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], isError: false, }; } catch (error: any) { return { content: [{ type: 'text', text: `API Error: ${error.response?.data?.message || error.message}` }], isError: true, }; } }
- src/tools/smartDelivery.ts:223-246 (schema)Defines the tool metadata including name, description, category, and input schema specifying required 'testType' ('manual' or 'auto') and optional pagination parameters 'limit' and 'offset'.export const LIST_ALL_TESTS_TOOL: CategoryTool = { name: 'smartlead_list_all_tests', description: 'List all Smart Delivery tests, either manual or automated.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { testType: { type: 'string', enum: ['manual', 'auto'], description: 'Type of tests to list (manual or auto)', }, limit: { type: 'integer', description: 'Number of tests to retrieve (default: 10)', }, offset: { type: 'integer', description: 'Offset for pagination (default: 0)', }, }, required: ['testType'], }, };
- src/index.ts:216-219 (registration)Registers the smartDeliveryTools array (including smartlead_list_all_tests schema) to the MCP toolRegistry if the smartDelivery category is enabled by license.// Register smart delivery tools if enabled if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
- src/index.ts:354-356 (registration)In the main CallToolRequest handler, routes all SMART_DELIVERY category tools (including smartlead_list_all_tests) to handleSmartDeliveryTool for execution.case ToolCategory.SMART_DELIVERY: return await handleSmartDeliveryTool(name, toolArgs, apiClient, withRetry); case ToolCategory.WEBHOOKS:
- src/handlers/smartDelivery.ts:64-65 (registration)Within handleSmartDeliveryTool switch statement, specifically routes 'smartlead_list_all_tests' calls to the handleListAllTests implementation.} case 'smartlead_get_provider_wise_report': {