smartlead_get_blacklist
Retrieve blacklist information for email campaigns by providing a spam test ID to identify which IP addresses and emails were flagged.
Instructions
Get the list of all blacklists per IP per email sent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to get the blacklist information for |
Implementation Reference
- src/handlers/smartDelivery.ts:756-795 (handler)Core execution logic: validates input params, calls SmartDelivery API `/spam-test/report/${spam_test_id}/blacklist`, returns JSON response or formatted error.async function handleGetBlacklist( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isBlacklistParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_blacklist' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/blacklist`), 'get blacklist' ); 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:376-390 (schema)Tool metadata and input schema definition (requires spam_test_id). Included in smartDeliveryTools array for registration.export const GET_BLACKLIST_TOOL: CategoryTool = { name: 'smartlead_get_blacklist', description: 'Get the list of all blacklists per IP per email sent.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the blacklist information for', }, }, required: ['spam_test_id'], }, };
- src/types/smartDelivery.ts:335-342 (schema)Type guard function for validating tool input parameters (object with numeric spam_test_id).export function isBlacklistParams(args: unknown): args is BlacklistParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as BlacklistParams).spam_test_id === 'number' ); }
- src/index.ts:217-219 (registration)Registers the smartDeliveryTools array (containing smartlead_get_blacklist) with the MCP tool registry when smartDelivery category is license-enabled.if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
- src/handlers/smartDelivery.ts:89-91 (registration)Dispatches to specific handler within the SmartDelivery tool handler switch statement.case 'smartlead_get_blacklist': { return handleGetBlacklist(args, apiClient, withRetry); }