Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_stop_automated_test

Stop an active automated email marketing test before its scheduled end date by providing the test ID. This allows users to halt tests that are no longer needed or require adjustment.

Instructions

Stop an active automated test before its end date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the automated test to stop

Implementation Reference

  • Core handler function that validates input parameters using isStopAutomatedTestParams, creates a SmartDelivery API client, sends a PUT request to stop the automated test by spam_test_id, and returns the JSON response or error message.
    async function handleStopAutomatedTest(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isStopAutomatedTestParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_stop_automated_test'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.put(`/spam-test/${spam_test_id}/stop`),
          'stop automated test'
        );
    
        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 input schema requiring a spam_test_id integer.
    export const STOP_AUTOMATED_TEST_TOOL: CategoryTool = {
      name: 'smartlead_stop_automated_test',
      description: 'Stop an active automated test before its end date.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the automated test to stop',
          },
        },
        required: ['spam_test_id'],
      },
    };
  • Type guard function that validates input arguments match StopAutomatedTestParams interface (object with numeric spam_test_id).
    export function isStopAutomatedTestParams(args: unknown): args is StopAutomatedTestParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'spam_test_id' in args &&
        typeof (args as StopAutomatedTestParams).spam_test_id === 'number'
      );
    }
  • src/index.ts:217-219 (registration)
    Registers the array of smartDeliveryTools (which includes smartlead_stop_automated_test) into the tool registry if the smartDelivery category is enabled.
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Switch case in handleSmartDeliveryTool dispatcher that routes calls to this specific tool to its handler function.
    case 'smartlead_stop_automated_test': {
      return handleStopAutomatedTest(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 tool stops an active test, implying a mutation, but doesn't cover permissions needed, whether the stop is reversible, what happens to test data, or error conditions. This leaves significant gaps for a mutation tool.

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 front-loaded with the core action and target, 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 mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral aspects like side effects, permissions, or response format, which are critical for safe and effective use in an automated 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 the parameter 'spam_test_id' clearly documented in the schema. The description doesn't add any parameter-specific details beyond what the schema provides, such as format examples or where to find the ID, so it meets the baseline for high schema coverage.

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 ('Stop') and target ('an active automated test'), specifying it must be stopped 'before its end date'. However, it doesn't differentiate from potential siblings like 'smartlead_update_campaign_status' or 'smartlead_delete_smart_delivery_tests', which might also affect tests or campaigns.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description mentions stopping 'before its end date', which implies a temporal constraint, but doesn't clarify prerequisites, consequences, or when other tools (e.g., for pausing or deleting tests) might be more appropriate.

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