Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_delete_campaign_webhook

Remove a specific webhook from an email marketing campaign to stop receiving automated notifications or data updates for that campaign.

Instructions

Delete a specific webhook from a campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign containing the webhook
idYesID of the webhook to delete

Implementation Reference

  • The core handler function that validates input, calls the SmartLead API to delete the specified webhook from a campaign, and returns the response or error.
    async function handleDeleteCampaignWebhook(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isDeleteCampaignWebhookParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_delete_campaign_webhook'
        );
      }
    
      try {
        const smartLeadClient = createSmartLeadClient(apiClient);
        const { campaign_id, id } = args;
        
        // The API documentation suggests a DELETE with a body payload
        // Different from typical REST practices but following the API spec
        const response = await withRetry(
          async () => smartLeadClient.delete(`/campaigns/${campaign_id}/webhooks`, { 
            data: { id }
          }),
          'delete campaign webhook'
        );
    
        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 with name, description, category, and JSON schema for input parameters.
    export const DELETE_CAMPAIGN_WEBHOOK_TOOL: CategoryTool = {
      name: 'smartlead_delete_campaign_webhook',
      description: 'Delete a specific webhook from a campaign.',
      category: ToolCategory.WEBHOOKS,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'string',
            description: 'ID of the campaign containing the webhook',
          },
          id: {
            type: 'integer',
            description: 'ID of the webhook to delete',
          },
        },
        required: ['campaign_id', 'id'],
      },
    };
  • src/index.ts:222-224 (registration)
    Registers all webhook tools, including 'smartlead_delete_campaign_webhook', into the MCP tool registry if the webhooks category is enabled by license.
    if (enabledCategories.webhooks) {
      toolRegistry.registerMany(webhookTools);
    }
  • Runtime type guard function for validating input parameters against the DeleteCampaignWebhookParams interface.
    export function isDeleteCampaignWebhookParams(args: unknown): args is DeleteCampaignWebhookParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as DeleteCampaignWebhookParams).campaign_id === 'string' &&
        'id' in args &&
        typeof (args as DeleteCampaignWebhookParams).id === 'number'
      );
    }
  • Switch case in the webhook tool dispatcher that routes calls to the specific delete handler function.
    case 'smartlead_delete_campaign_webhook': {
      return handleDeleteCampaignWebhook(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 full burden. 'Delete' implies a destructive mutation, but the description doesn't disclose whether this requires specific permissions, whether the deletion is permanent/reversible, what happens to associated data, or any rate limits. This leaves significant behavioral gaps for a destructive operation.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple delete operation and front-loads the essential information.

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 doesn't explain what 'delete' entails behaviorally, what confirmation (if any) is needed, what the response looks like, or error conditions. The context signals show 2 required parameters with good schema coverage, but the description lacks critical behavioral context.

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 clearly documented in the schema. The description doesn't add any parameter details beyond what's in the schema (e.g., format examples, constraints, or relationships between campaign_id and id). Baseline 3 is appropriate when schema does the heavy lifting.

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 the target ('a specific webhook from a campaign'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'smartlead_delete_campaign' or 'smartlead_delete_folder', though the resource specificity (webhook vs campaign/folder) provides some implicit distinction.

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. There's no mention of prerequisites, when deletion is appropriate, or what happens after deletion. Sibling tools like 'smartlead_fetch_webhooks_by_campaign' or 'smartlead_upsert_campaign_webhook' exist, but no comparison is made.

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