Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_delete_lead

Remove a lead permanently from the Smartlead email marketing system by specifying the lead ID to maintain clean contact lists.

Instructions

Delete a lead permanently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lead_idYesID of the lead to delete

Implementation Reference

  • Core handler function that validates the input using isDeleteLeadParams, performs DELETE API request to /leads/{lead_id}, and returns the response or formatted error.
    async function handleDeleteLead(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isDeleteLeadParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_delete_lead'
        );
      }
    
      try {
        const response = await withRetry(
          async () => apiClient.delete(`/leads/${args.lead_id}`),
          'delete lead'
        );
    
        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 that requires a numeric lead_id.
    export const DELETE_LEAD_TOOL: CategoryTool = {
      name: 'smartlead_delete_lead',
      description: 'Delete a lead permanently.',
      category: ToolCategory.LEAD_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          lead_id: {
            type: 'number',
            description: 'ID of the lead to delete',
          },
        },
        required: ['lead_id'],
      },
    };
  • src/index.ts:207-209 (registration)
    Registers the leadTools array (which includes smartlead_delete_lead) into the tool registry if leadManagement category is enabled.
    if (enabledCategories.leadManagement) {
      toolRegistry.registerMany(leadTools);
    }
  • Dispatches calls to smartlead_delete_lead to the specific handleDeleteLead function within the lead tool handler.
    case 'smartlead_delete_lead': {
      return handleDeleteLead(args, apiClient, withRetry);
    }
  • src/index.ts:350-351 (registration)
    Main MCP tool call handler dispatches lead management tools (including smartlead_delete_lead) to handleLeadTool.
    case ToolCategory.LEAD_MANAGEMENT:
      return await handleLeadTool(name, toolArgs, 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. It states the action is permanent, which is useful behavioral context. However, it lacks critical details: it doesn't specify permissions required, side effects (e.g., impact on associated campaigns), error conditions, or what happens on success (e.g., confirmation message). For a destructive tool with zero annotation coverage, this is a significant gap.

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 front-loads the key action ('Delete') and includes the essential qualifier ('permanently'). Every word earns its place, making it easy to parse quickly.

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 incomplete. It doesn't cover behavioral aspects like permissions, side effects, or response format, leaving the agent with insufficient context to use it safely or effectively. The high schema coverage helps with parameters, but overall completeness is poor given the tool's critical nature.

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 the single parameter 'lead_id' clearly documented in the schema. The description adds no parameter-specific information beyond what the schema provides (e.g., format examples or constraints). Baseline 3 is appropriate when the schema does the heavy lifting, though no extra value is added.

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 resource ('a lead'), with 'permanently' adding specificity about the nature of the deletion. It distinguishes from siblings like 'smartlead_update_lead' or 'smartlead_update_lead_status' by emphasizing irreversible removal rather than modification. However, it doesn't explicitly differentiate from other deletion tools (e.g., 'smartlead_delete_campaign'), though the resource type makes this distinction implicit.

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 doesn't mention prerequisites (e.g., lead existence), compare to similar tools like 'smartlead_update_lead_status' for non-destructive changes, or warn about irreversible consequences. The agent must infer usage from the tool name and context alone.

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