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,
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether creation is idempotent, what happens on duplicate names, required permissions, rate limits, or what the response contains. 'Create' implies mutation, but details are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and purpose, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple creation tool with one parameter and no output schema, the description is minimally adequate but lacks completeness. It doesn't explain the result (e.g., folder ID, success confirmation) or error conditions, which is a gap given no annotations to cover behavioral aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'name' parameter is fully described in the schema), so the baseline is 3. The description adds no additional parameter semantics beyond what the schema provides, such as naming constraints or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a folder') and resource ('in Smart Delivery'), specifying its purpose to 'organize tests'. It distinguishes from siblings like 'smartlead_get_all_folders' (read) and 'smartlead_delete_folder' (delete), but doesn't explicitly contrast with other creation tools like 'smartlead_create_campaign'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites (e.g., permissions), when folder creation is appropriate, or how it relates to other organizational tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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