smartlead_get_spf_details
Check SPF authentication status for email spam tests to verify sender legitimacy and improve email deliverability.
Instructions
Check if SPF authentication passed or failed for the test.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to get the SPF details for |
Implementation Reference
- src/handlers/smartDelivery.ts:633-672 (handler)Core execution logic for the 'smartlead_get_spf_details' tool. Validates input parameters using isSpfDetailsParams, calls the Smart Delivery API endpoint `/spam-test/report/${spam_test_id}/spf-details`, and returns the JSON-formatted response or an error message.
async function handleGetSpfDetails( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isSpfDetailsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_spf_details' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/spf-details`), 'get SPF details' ); 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:328-342 (schema)MCP tool definition including the name, description, category, and input schema requiring a 'spam_test_id' integer parameter.
export const GET_SPF_DETAILS_TOOL: CategoryTool = { name: 'smartlead_get_spf_details', description: 'Check if SPF authentication passed or failed for the test.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the SPF details for', }, }, required: ['spam_test_id'], }, }; - src/tools/smartDelivery.ts:581-609 (registration)Registration of the 'smartlead_get_spf_details' tool (as GET_SPF_DETAILS_TOOL) in the array of Smart Delivery tools for MCP registry.
export const smartDeliveryTools = [ GET_REGION_WISE_PROVIDERS_TOOL, CREATE_MANUAL_PLACEMENT_TEST_TOOL, CREATE_AUTOMATED_PLACEMENT_TEST_TOOL, GET_SPAM_TEST_DETAILS_TOOL, DELETE_SMART_DELIVERY_TESTS_TOOL, STOP_AUTOMATED_TEST_TOOL, LIST_ALL_TESTS_TOOL, GET_PROVIDER_WISE_REPORT_TOOL, GET_GROUP_WISE_REPORT_TOOL, GET_SENDER_ACCOUNT_WISE_REPORT_TOOL, GET_SPAM_FILTER_DETAILS_TOOL, GET_DKIM_DETAILS_TOOL, GET_SPF_DETAILS_TOOL, GET_RDNS_DETAILS_TOOL, GET_SENDER_ACCOUNTS_TOOL, GET_BLACKLIST_TOOL, GET_EMAIL_CONTENT_TOOL, GET_IP_ANALYTICS_TOOL, GET_EMAIL_HEADERS_TOOL, GET_SCHEDULE_HISTORY_TOOL, GET_IP_DETAILS_TOOL, GET_MAILBOX_SUMMARY_TOOL, GET_MAILBOX_COUNT_TOOL, GET_ALL_FOLDERS_TOOL, CREATE_FOLDER_TOOL, GET_FOLDER_BY_ID_TOOL, DELETE_FOLDER_TOOL, ]; - src/types/smartDelivery.ts:308-315 (schema)Runtime type guard function isSpfDetailsParams for validating tool input parameters, ensuring 'spam_test_id' is a number.
export function isSpfDetailsParams(args: unknown): args is SpfDetailsParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as SpfDetailsParams).spam_test_id === 'number' ); } - src/types/smartDelivery.ts:100-102 (schema)TypeScript interface defining the expected parameters for the SPF details tool.
export interface SpfDetailsParams { spam_test_id: number; }