smartlead_get_sender_account_wise_report
Retrieve a detailed spam test report organized by sender accounts, showing individual email performance from each mailbox to analyze deliverability and sender reputation.
Instructions
Get detailed report of a spam test sorted by sender accounts with details of each email from each mailbox.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to get the sender account-wise report for |
Implementation Reference
- src/handlers/smartDelivery.ts:510-549 (handler)Core handler function that validates the input using isSenderAccountWiseReportParams, creates a SmartDelivery API client, extracts spam_test_id, performs a GET request to `/spam-test/report/${spam_test_id}/sender-account-wise` with retry logic, and returns the JSON response or an error message.async function handleGetSenderAccountWiseReport( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isSenderAccountWiseReportParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_sender_account_wise_report' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/sender-account-wise`), 'get sender account 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:280-294 (schema)Defines the tool's metadata including name, description, category (SMART_DELIVERY), and input schema requiring a single integer parameter 'spam_test_id'.export const GET_SENDER_ACCOUNT_WISE_REPORT_TOOL: CategoryTool = { name: 'smartlead_get_sender_account_wise_report', description: 'Get detailed report of a spam test sorted by sender accounts with details of each email from each mailbox.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the sender account-wise report for', }, }, required: ['spam_test_id'], }, };
- src/index.ts:217-219 (registration)Registers the array of all SmartDelivery tools (including this one) to the central ToolRegistry if the smartDelivery category is enabled by license/configuration.if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
- src/types/smartDelivery.ts:281-288 (schema)Type guard function to validate input parameters for the tool, ensuring it's an object with a numeric 'spam_test_id' property.export function isSenderAccountWiseReportParams(args: unknown): args is SenderAccountWiseReportParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as SenderAccountWiseReportParams).spam_test_id === 'number' ); }
- src/handlers/smartDelivery.ts:71-73 (registration)Switch case in handleSmartDeliveryTool that routes calls to this specific tool name to its handler function.case 'smartlead_get_sender_account_wise_report': { return handleGetSenderAccountWiseReport(args, apiClient, withRetry); }