smartlead_get_sender_accounts
Retrieve all sender accounts configured for a specific spam test to analyze email deliverability and sender reputation.
Instructions
Get the list of all sender accounts selected for a specific spam test.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to get the sender accounts for |
Implementation Reference
- src/handlers/smartDelivery.ts:715-754 (handler)Main handler function that validates arguments using isSenderAccountsParams, creates a SmartDelivery API client, performs a GET request to retrieve sender accounts for the given spam_test_id, and returns the formatted JSON response or error.async function handleGetSenderAccounts( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isSenderAccountsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_sender_accounts' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/sender-accounts`), 'get sender accounts' ); 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:360-374 (schema)Tool definition including name, description, category (SMART_DELIVERY), and input schema requiring 'spam_test_id' as integer.export const GET_SENDER_ACCOUNTS_TOOL: CategoryTool = { name: 'smartlead_get_sender_accounts', description: 'Get the list of all sender accounts selected for a specific spam test.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the sender accounts for', }, }, required: ['spam_test_id'], }, };
- src/index.ts:217-219 (registration)Registers the array of smartDeliveryTools (which includes smartlead_get_sender_accounts) to the tool registry if smartDelivery category is enabled.if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
- src/types/smartDelivery.ts:326-333 (schema)Type guard function for validating input parameters matching SenderAccountsParams interface (spam_test_id: number).export function isSenderAccountsParams(args: unknown): args is SenderAccountsParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as SenderAccountsParams).spam_test_id === 'number' ); }
- src/handlers/smartDelivery.ts:86-88 (registration)Switch case in handleSmartDeliveryTool that routes the tool call to the specific handleGetSenderAccounts implementation.case 'smartlead_get_sender_accounts': { return handleGetSenderAccounts(args, apiClient, withRetry); }