Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_create_folder

Create folders in Smart Delivery to organize and manage email marketing tests, enabling structured campaign management.

Instructions

Create a folder in Smart Delivery to organize tests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the folder to create

Implementation Reference

  • The core execution logic for the smartlead_create_folder tool. Validates arguments using isCreateFolderParams, creates a SmartDelivery API client, posts the folder name to '/spam-test/folder', and returns the JSON response or error message.
    async function handleCreateFolder(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isCreateFolderParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_create_folder'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { name } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.post('/spam-test/folder', { name }),
          'create folder'
        );
    
        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,
        };
      }
    }
  • The dispatcher function for all SmartDelivery tools, including the switch case that routes 'smartlead_create_folder' to handleCreateFolder.
    export async function handleSmartDeliveryTool(
      toolName: string, 
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      switch (toolName) {
        case 'smartlead_get_region_wise_providers': {
          return handleGetRegionWiseProviders(args, apiClient, withRetry);
        }
        case 'smartlead_create_manual_placement_test': {
          return handleCreateManualPlacementTest(args, apiClient, withRetry);
        }
        case 'smartlead_create_automated_placement_test': {
          return handleCreateAutomatedPlacementTest(args, apiClient, withRetry);
        }
        case 'smartlead_get_spam_test_details': {
          return handleGetSpamTestDetails(args, apiClient, withRetry);
        }
        case 'smartlead_delete_smart_delivery_tests': {
          return handleDeleteSmartDeliveryTests(args, apiClient, withRetry);
        }
        case 'smartlead_stop_automated_test': {
          return handleStopAutomatedTest(args, apiClient, withRetry);
        }
        case 'smartlead_list_all_tests': {
          return handleListAllTests(args, apiClient, withRetry);
        }
        case 'smartlead_get_provider_wise_report': {
          return handleGetProviderWiseReport(args, apiClient, withRetry);
        }
        case 'smartlead_get_group_wise_report': {
          return handleGetGroupWiseReport(args, apiClient, withRetry);
        }
        case 'smartlead_get_sender_account_wise_report': {
          return handleGetSenderAccountWiseReport(args, apiClient, withRetry);
        }
        case 'smartlead_get_spam_filter_details': {
          return handleGetSpamFilterDetails(args, apiClient, withRetry);
        }
        case 'smartlead_get_dkim_details': {
          return handleGetDkimDetails(args, apiClient, withRetry);
        }
        case 'smartlead_get_spf_details': {
          return handleGetSpfDetails(args, apiClient, withRetry);
        }
        case 'smartlead_get_rdns_details': {
          return handleGetRdnsDetails(args, apiClient, withRetry);
        }
        case 'smartlead_get_sender_accounts': {
          return handleGetSenderAccounts(args, apiClient, withRetry);
        }
        case 'smartlead_get_blacklist': {
          return handleGetBlacklist(args, apiClient, withRetry);
        }
        case 'smartlead_get_email_content': {
          return handleGetEmailContent(args, apiClient, withRetry);
        }
        case 'smartlead_get_ip_analytics': {
          return handleGetIpAnalytics(args, apiClient, withRetry);
        }
        case 'smartlead_get_email_headers': {
          return handleGetEmailHeaders(args, apiClient, withRetry);
        }
        case 'smartlead_get_schedule_history': {
          return handleGetScheduleHistory(args, apiClient, withRetry);
        }
        case 'smartlead_get_ip_details': {
          return handleGetIpDetails(args, apiClient, withRetry);
        }
        case 'smartlead_get_mailbox_summary': {
          return handleGetMailboxSummary(args, apiClient, withRetry);
        }
        case 'smartlead_get_mailbox_count': {
          return handleGetMailboxCount(args, apiClient, withRetry);
        }
        case 'smartlead_get_all_folders': {
          return handleGetAllFolders(args, apiClient, withRetry);
        }
        case 'smartlead_create_folder': {
          return handleCreateFolder(args, apiClient, withRetry);
        }
        case 'smartlead_get_folder_by_id': {
          return handleGetFolderById(args, apiClient, withRetry);
        }
        case 'smartlead_delete_folder': {
          return handleDeleteFolder(args, apiClient, withRetry);
        }
        default:
          throw new Error(`Unknown SmartDelivery tool: ${toolName}`);
      }
    }
  • Tool definition with input schema requiring a 'name' string parameter.
    export const CREATE_FOLDER_TOOL: CategoryTool = {
      name: 'smartlead_create_folder',
      description: 'Create a folder in Smart Delivery to organize tests.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the folder to create',
          },
        },
        required: ['name'],
      },
    };
  • Runtime type guard function used in the handler to validate input parameters match CreateFolderParams (object with 'name': string).
    export function isCreateFolderParams(args: unknown): args is CreateFolderParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'name' in args &&
        typeof (args as CreateFolderParams).name === 'string'
      );
    }
  • Array of all SmartDelivery tools including CREATE_FOLDER_TOOL, likely used for MCP tool registration.
    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,
    ];
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