Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_update_campaign_status

Change the status of an email marketing campaign by updating it to PAUSED, STOPPED, or START using the campaign ID.

Instructions

Update the status of a campaign. Use this specifically for changing a campaign's status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign to update the status for
statusYesNew status for the campaign (must be in uppercase)

Implementation Reference

  • The handler function that executes the tool logic: validates arguments using isUpdateCampaignStatusParams, extracts campaign_id and status, performs POST request to `/campaigns/${campaign_id}/status` via apiClient with retry logic, and returns the API response or error.
    async function handleUpdateCampaignStatus(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isUpdateCampaignStatusParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_update_campaign_status'
        );
      }
    
      const { campaign_id, status } = args;
    
      try {
        const response = await withRetry(
          async () => apiClient.post(`/campaigns/${campaign_id}/status`, { status }),
          'update campaign status'
        );
    
        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 inputSchema for validation (campaign_id: number, status: enum ['PAUSED', 'STOPPED', 'START']).
    export const UPDATE_CAMPAIGN_STATUS_TOOL: CategoryTool = {
      name: 'smartlead_update_campaign_status',
      description: 'Update the status of a campaign. Use this specifically for changing a campaign\'s status.',
      category: ToolCategory.CAMPAIGN_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'number',
            description: 'ID of the campaign to update the status for',
          },
          status: {
            type: 'string',
            enum: ['PAUSED', 'STOPPED', 'START'],
            description: 'New status for the campaign (must be in uppercase)',
          },
        },
        required: ['campaign_id', 'status'],
      },
    };
  • TypeScript interface and type guard function for input validation of the tool parameters.
    export interface UpdateCampaignStatusParams {
      campaign_id: number;
      status: 'PAUSED' | 'STOPPED' | 'START';
    }
    
    export interface GetCampaignParams {
      campaign_id: number;
    }
    
    export interface GetCampaignSequenceParams {
      campaign_id: number;
    }
    
    export interface ListCampaignsParams {
      status?: 'active' | 'paused' | 'completed';
      limit?: number;
      offset?: number;
    }
    
    export interface SaveCampaignSequenceParams {
      campaign_id: number;
      sequence: Array<{
        seq_number: number;
        seq_delay_details: {
          delay_in_days: number;
        };
        variant_distribution_type: 'MANUAL_EQUAL' | 'MANUAL_PERCENTAGE' | 'AI_EQUAL';
        lead_distribution_percentage?: number;
        winning_metric_property?: 'OPEN_RATE' | 'CLICK_RATE' | 'REPLY_RATE' | 'POSITIVE_REPLY_RATE';
        seq_variants: Array<{
          subject: string;
          email_body: string;
          variant_label: string;
          id?: number;
          variant_distribution_percentage?: number;
        }>;
      }>;
    }
    
    // New interface definitions for remaining campaign management endpoints
    export interface GetCampaignsByLeadParams {
      lead_id: number;
    }
    
    export interface ExportCampaignLeadsParams {
      campaign_id: number;
    }
    
    export interface DeleteCampaignParams {
      campaign_id: number;
    }
    
    export interface GetCampaignAnalyticsByDateParams {
      campaign_id: number;
      start_date: string;
      end_date: string;
    }
    
    export interface GetCampaignSequenceAnalyticsParams {
      campaign_id: number;
      start_date: string;
      end_date: string;
      time_zone?: string;
    }
    
    // Type guards
    export function isCreateCampaignParams(args: unknown): args is CreateCampaignParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'name' in args &&
        typeof (args as { name: unknown }).name === 'string'
      );
    }
    
    export function isUpdateCampaignScheduleParams(args: unknown): args is UpdateCampaignScheduleParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as { campaign_id: unknown }).campaign_id === 'number'
      );
    }
    
    export function isUpdateCampaignSettingsParams(args: unknown): args is UpdateCampaignSettingsParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as { campaign_id: unknown }).campaign_id === 'number'
      );
    }
    
    export function isUpdateCampaignStatusParams(args: unknown): args is UpdateCampaignStatusParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as { campaign_id: unknown }).campaign_id === 'number' &&
        'status' in args &&
        typeof (args as { status: unknown }).status === 'string' &&
        ['PAUSED', 'STOPPED', 'START'].includes((args as { status: string }).status)
      );
    }
  • src/index.ts:197-199 (registration)
    Registration of the campaignTools array (which includes UPDATE_CAMPAIGN_STATUS_TOOL) into the toolRegistry if campaignManagement category is enabled.
    if (enabledCategories.campaignManagement) {
      toolRegistry.registerMany(campaignTools);
    }
  • Dispatch case in handleCampaignTool switch statement that routes the tool call to the specific handler function.
    case 'smartlead_update_campaign_status': {
      return handleUpdateCampaignStatus(args, apiClient, withRetry);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool updates campaign status, implying a mutation operation, but doesn't cover critical aspects like required permissions, whether changes are reversible, rate limits, or error conditions. The description is insufficient for a mutation tool with zero annotation coverage, failing to inform the agent about behavioral risks or constraints.

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

Conciseness4/5

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

The description is concise with two short sentences that directly state the tool's function and a basic usage hint. It's front-loaded and wastes no words, though the second sentence could be integrated more smoothly. It efficiently communicates the core idea without unnecessary elaboration, earning a high score for brevity and clarity.

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

Completeness2/5

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

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., side effects, permissions), output format, or error handling. While the schema covers parameters well, the description fails to provide sufficient context for safe and effective use, especially compared to sibling tools that may overlap in functionality.

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%, with both parameters ('campaign_id' and 'status') well-documented in the schema, including enum values for status. The description adds no parameter-specific information beyond what the schema provides, such as format details or examples. Given the high schema coverage, a baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

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

Purpose3/5

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

The description states the tool's purpose ('Update the status of a campaign'), which is clear but vague. It specifies the action (update) and resource (campaign status), but doesn't differentiate from sibling tools like 'smartlead_update_campaign_settings' or 'smartlead_update_lead_status' that also modify campaign-related data. The description is functional but lacks specificity about what distinguishes this status update from other campaign modifications.

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?

The description provides minimal guidance with 'Use this specifically for changing a campaign's status,' which implies context but offers no explicit when-to-use rules, alternatives, or exclusions. It doesn't mention when to choose this over similar tools like 'smartlead_update_campaign_settings' or what prerequisites might exist (e.g., campaign must exist). This leaves usage ambiguous despite the hint.

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