Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

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
NameRequiredDescriptionDefault
spam_test_idYesID of the spam test to get the blacklist information for

Implementation Reference

  • 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,
        };
      }
    }
  • 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'],
      },
    };
  • 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);
    }
  • Dispatches to specific handler within the SmartDelivery tool handler switch statement.
    case 'smartlead_get_blacklist': {
      return handleGetBlacklist(args, apiClient, withRetry);
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

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