Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_delete_smart_delivery_tests

Remove multiple Smart Delivery spam tests in bulk by specifying their IDs to clean up test data and manage email marketing campaigns.

Instructions

Delete multiple Smart Delivery tests in bulk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spamTestIdsYesArray of spam test IDs to delete

Implementation Reference

  • The main handler function for the tool. Validates input parameters using isDeleteSmartDeliveryTestsParams, makes a POST request to the Smart Delivery API endpoint '/spam-test/delete', and returns the JSON response or an error message.
    async function handleDeleteSmartDeliveryTests( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isDeleteSmartDeliveryTestsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_delete_smart_delivery_tests' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const response = await withRetry( async () => smartDeliveryClient.post('/spam-test/delete', args), 'delete smart delivery tests' ); 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, }; } }
  • Defines the tool metadata including name, description, category, and input schema requiring spamTestIds as an array of integers.
    export const DELETE_SMART_DELIVERY_TESTS_TOOL: CategoryTool = { name: 'smartlead_delete_smart_delivery_tests', description: 'Delete multiple Smart Delivery tests in bulk.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spamTestIds: { type: 'array', items: { type: 'integer' }, description: 'Array of spam test IDs to delete', }, }, required: ['spamTestIds'], }, };
  • Type guard (validator) function that checks if input args conform to the DeleteSmartDeliveryTestsParams interface (object with spamTestIds: number[]). Used in the handler for input validation.
    export function isDeleteSmartDeliveryTestsParams(args: unknown): args is DeleteSmartDeliveryTestsParams { return ( typeof args === 'object' && args !== null && 'spamTestIds' in args && Array.isArray((args as DeleteSmartDeliveryTestsParams).spamTestIds) && (args as DeleteSmartDeliveryTestsParams).spamTestIds.every(id => typeof id === 'number') ); }
  • src/index.ts:217-219 (registration)
    Registers the array of smartDeliveryTools (including this tool) with the toolRegistry when the smartDelivery category is enabled by license/feature flags.
    if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }

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