Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_delete_campaign

Permanently delete a specific email marketing campaign by its ID using the Smartlead Simplified MCP Server to manage your campaign list.

Instructions

Delete a campaign permanently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign to delete

Implementation Reference

  • The primary handler function that implements the tool logic: validates input using isDeleteCampaignParams, makes a DELETE API call to `/campaigns/${campaign_id}`, and returns the response or error.
    async function handleDeleteCampaign(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isDeleteCampaignParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_delete_campaign'
        );
      }
    
      try {
        const response = await withRetry(
          async () => apiClient.delete(`/campaigns/${args.campaign_id}`),
          'delete campaign'
        );
    
        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 schema definition including name, description, category, and input schema requiring 'campaign_id'.
    export const DELETE_CAMPAIGN_TOOL: CategoryTool = {
      name: 'smartlead_delete_campaign',
      description: 'Delete a campaign permanently.',
      category: ToolCategory.CAMPAIGN_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'number',
            description: 'ID of the campaign to delete',
          },
        },
        required: ['campaign_id'],
      },
    };
  • Runtime type guard (isDeleteCampaignParams) and TypeScript interface (DeleteCampaignParams) for input validation.
    export function isDeleteCampaignParams(args: unknown): args is DeleteCampaignParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as { campaign_id: unknown }).campaign_id === 'number'
      );
    }
  • src/index.ts:197-199 (registration)
    Registers the campaign tools (including smartlead_delete_campaign) with the tool registry if the category is enabled.
    if (enabledCategories.campaignManagement) {
      toolRegistry.registerMany(campaignTools);
    }
  • Switch case in handleCampaignTool that routes the tool call to the specific handleDeleteCampaign function.
    case 'smartlead_delete_campaign': {
      return handleDeleteCampaign(args, apiClient, withRetry);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'permanently' hints at irreversibility, it lacks critical details such as required permissions, confirmation prompts, side effects (e.g., impact on leads or analytics), or error handling. This is inadequate for a destructive operation with zero annotation coverage.

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, front-loaded sentence with zero wasted words. It directly conveys the core action and key behavioral trait ('permanently'), making it highly efficient and easy to parse.

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?

For a destructive tool with no annotations and no output schema, the description is insufficient. It misses essential context such as success/error responses, idempotency, dependencies, or recovery options, leaving significant gaps in understanding the tool's full behavior and implications.

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?

The input schema has 100% description coverage, clearly documenting the 'campaign_id' parameter. The description does not add any additional semantic context beyond what the schema provides (e.g., format examples or validation rules), so it meets the baseline score for high schema coverage without extra value.

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 ('Delete') and target resource ('a campaign'), with the adverb 'permanently' adding specificity about the nature of the deletion. However, it does not explicitly differentiate this tool from sibling tools like 'smartlead_delete_folder' or 'smartlead_delete_lead', which perform similar deletion operations on different resources.

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 no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., campaign existence), exclusions, or related tools like 'smartlead_delete_campaign_webhook' for partial deletions, leaving the agent without contextual usage cues.

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