smartlead_get_provider_wise_report
Retrieve a detailed spam test report categorized by email providers to analyze deliverability performance across different email services.
Instructions
Get detailed report of a spam test sorted by email providers.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to get the provider-wise report for |
Implementation Reference
- src/handlers/smartDelivery.ts:428-467 (handler)Core handler function that executes the tool: validates input using isProviderWiseReportParams, calls SmartDelivery API POST /spam-test/report/{spam_test_id}/providerwise, returns formatted JSON response or error message.async function handleGetProviderWiseReport( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isProviderWiseReportParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_provider_wise_report' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.post(`/spam-test/report/${spam_test_id}/providerwise`), 'get provider wise report' ); 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:248-262 (schema)Tool definition with input schema: requires spam_test_id (integer). Used for MCP tool registration and validation.export const GET_PROVIDER_WISE_REPORT_TOOL: CategoryTool = { name: 'smartlead_get_provider_wise_report', description: 'Get detailed report of a spam test sorted by email providers.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the provider-wise report for', }, }, required: ['spam_test_id'], }, };
- src/index.ts:217-219 (registration)Registers the smartDeliveryTools array (including this tool) to the MCP toolRegistry if smartDelivery category enabled by license.if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
- src/index.ts:354-355 (registration)Top-level tool dispatch in CallToolRequest handler: routes SMART_DELIVERY tools to handleSmartDeliveryTool.case ToolCategory.SMART_DELIVERY: return await handleSmartDeliveryTool(name, toolArgs, apiClient, withRetry);
- src/handlers/smartDelivery.ts:65-67 (registration)Dispatches this specific tool name to the handleGetProviderWiseReport function within handleSmartDeliveryTool switch.case 'smartlead_get_provider_wise_report': { return handleGetProviderWiseReport(args, apiClient, withRetry); }
- src/types/smartDelivery.ts:263-270 (schema)Type guard function for input validation: checks for object with spam_test_id as number.export function isProviderWiseReportParams(args: unknown): args is ProviderWiseReportParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as ProviderWiseReportParams).spam_test_id === 'number' ); }