smartlead_get_spam_test_details
Retrieve detailed results for a specific email spam test to analyze deliverability and identify potential inbox placement issues.
Instructions
Retrieve details of a specific spam test by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam_test_id | Yes | ID of the spam test to retrieve details for |
Implementation Reference
- src/handlers/smartDelivery.ts:265-304 (handler)Core handler function that validates input parameters, makes API call to retrieve spam test details from SmartDelivery endpoint `/spam-test/${spam_test_id}`, formats response as MCP content, and handles errors.async function handleGetSpamTestDetails( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isGetSpamTestDetailsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_spam_test_details' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/${spam_test_id}`), 'get spam test 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:174-188 (schema)MCP tool definition including name, description, category, and JSON schema for input validation (requires spam_test_id as integer).export const GET_SPAM_TEST_DETAILS_TOOL: CategoryTool = { name: 'smartlead_get_spam_test_details', description: 'Retrieve details of a specific spam test by ID.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to retrieve details for', }, }, required: ['spam_test_id'], }, };
- src/types/smartDelivery.ts:225-232 (schema)TypeScript type guard function used in the handler to validate input arguments against GetSpamTestDetailsParams interface (checks for spam_test_id number).export function isGetSpamTestDetailsParams(args: unknown): args is GetSpamTestDetailsParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as GetSpamTestDetailsParams).spam_test_id === 'number' ); }
- src/handlers/smartDelivery.ts:53-55 (registration)Switch case in handleSmartDeliveryTool that registers and dispatches the tool call to the specific handler function.case 'smartlead_get_spam_test_details': { return handleGetSpamTestDetails(args, apiClient, withRetry); }