Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_delete_folder

Remove a folder from Smart Delivery by specifying its folder ID, enabling users to maintain organized email marketing campaigns.

Instructions

Delete a folder from Smart Delivery.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idYesID of the folder to delete

Implementation Reference

  • The core handler function that validates the input arguments using isDeleteFolderParams and executes the DELETE API request to the Smart Delivery endpoint `/spam-test/folder/{folder_id}` to delete the specified folder.
    async function handleDeleteFolder(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isDeleteFolderParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_delete_folder'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { folder_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.delete(`/spam-test/folder/${folder_id}`),
          'delete 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,
        };
      }
    }
  • MCP tool schema definition with input schema specifying the required folder_id parameter as integer.
    export const DELETE_FOLDER_TOOL: CategoryTool = {
      name: 'smartlead_delete_folder',
      description: 'Delete a folder from Smart Delivery.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          folder_id: {
            type: 'integer',
            description: 'ID of the folder to delete',
          },
        },
        required: ['folder_id'],
      },
    };
  • Type guard function used for input validation, confirming args is an object containing a numeric folder_id.
    export function isDeleteFolderParams(args: unknown): args is DeleteFolderParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'folder_id' in args &&
        typeof (args as DeleteFolderParams).folder_id === 'number'
      );
    }
  • src/index.ts:217-219 (registration)
    Registers the smartDeliveryTools array (including smartlead_delete_folder) with the tool registry if the smartDelivery category is enabled by license.
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Switch case in handleSmartDeliveryTool that routes calls to the specific delete folder handler.
    case 'smartlead_delete_folder': {
      return handleDeleteFolder(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 the full burden of behavioral disclosure. It states the action is 'Delete', implying a destructive operation, but doesn't specify whether deletion is permanent, reversible, requires specific permissions, or has side effects (e.g., impacting associated campaigns or leads). For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unaddressed.

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, direct sentence with zero wasted words. It front-loads the key action ('Delete') and resource, making it immediately understandable. Every word earns its place, achieving optimal conciseness for a simple tool.

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 destructive nature and lack of annotations or output schema, the description is incomplete. It doesn't address critical context such as what happens post-deletion (e.g., confirmation, error handling), whether it affects related data, or what permissions are required. For a mutation tool with no structured safety hints, this leaves significant gaps for an agent to operate safely.

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 description adds no parameter semantics beyond what the input schema provides. The schema has 100% description coverage, clearly documenting the single 'folder_id' parameter as 'ID of the folder to delete'. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional context like format examples or validation rules.

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 folder from Smart Delivery'), making the purpose unambiguous. It distinguishes this tool from siblings like 'smartlead_create_folder' by specifying deletion rather than creation. However, it doesn't explicitly mention what 'Smart Delivery' refers to, leaving some context 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., needing a valid folder_id), consequences of deletion, or when to choose this over other deletion tools like 'smartlead_delete_campaign'. Without such context, an agent must infer usage from the tool name 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