Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_stop_automated_test

Stop an active automated email marketing test before its scheduled end date by providing the test ID. This allows users to halt tests that are no longer needed or require adjustment.

Instructions

Stop an active automated test before its end date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the automated test to stop

Implementation Reference

  • Core handler function that validates input parameters using isStopAutomatedTestParams, creates a SmartDelivery API client, sends a PUT request to stop the automated test by spam_test_id, and returns the JSON response or error message.
    async function handleStopAutomatedTest( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isStopAutomatedTestParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_stop_automated_test' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.put(`/spam-test/${spam_test_id}/stop`), 'stop automated test' ); 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, }; } }
  • Tool definition including name, description, category, and input schema requiring a spam_test_id integer.
    export const STOP_AUTOMATED_TEST_TOOL: CategoryTool = { name: 'smartlead_stop_automated_test', description: 'Stop an active automated test before its end date.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the automated test to stop', }, }, required: ['spam_test_id'], }, };
  • Type guard function that validates input arguments match StopAutomatedTestParams interface (object with numeric spam_test_id).
    export function isStopAutomatedTestParams(args: unknown): args is StopAutomatedTestParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as StopAutomatedTestParams).spam_test_id === 'number' ); }
  • src/index.ts:217-219 (registration)
    Registers the array of smartDeliveryTools (which includes smartlead_stop_automated_test) into the tool registry if the smartDelivery category is enabled.
    if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
  • Switch case in handleSmartDeliveryTool dispatcher that routes calls to this specific tool to its handler function.
    case 'smartlead_stop_automated_test': { return handleStopAutomatedTest(args, apiClient, withRetry); }

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonathan-politzki/smartlead-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server