Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_schedule_history

Retrieve the complete schedule history and summary of all test runs for a specific automated spam test to track execution details and results.

Instructions

Get the list and summary of all tests that ran for a particular automated test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the automated spam test to get the schedule history for

Implementation Reference

  • The core handler function that validates input parameters using isScheduleHistoryParams, creates a SmartDelivery API client, fetches the schedule history from `/spam-test/report/${spam_test_id}/schedule-history` endpoint using retry logic, and returns formatted JSON response or error message.
    async function handleGetScheduleHistory(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isScheduleHistoryParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_schedule_history'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/schedule-history`),
          'get schedule history'
        );
    
        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,
        };
      }
    }
  • Defines the tool metadata including name, description, category (SMART_DELIVERY), and input schema that requires a single 'spam_test_id' parameter of type integer.
    export const GET_SCHEDULE_HISTORY_TOOL: CategoryTool = {
      name: 'smartlead_get_schedule_history',
      description: 'Get the list and summary of all tests that ran for a particular automated test.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the automated spam test to get the schedule history for',
          },
        },
        required: ['spam_test_id'],
      },
    };
  • src/index.ts:217-219 (registration)
    Registers the smartDeliveryTools array (which includes smartlead_get_schedule_history) to the tool registry if the smartDelivery category is enabled by license/features.
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Routes the tool call to the specific handleGetScheduleHistory implementation within the SmartDelivery tool dispatcher.
    case 'smartlead_get_schedule_history': {
      return handleGetScheduleHistory(args, apiClient, withRetry);
    }
  • Type guard function used for input validation, ensuring args is an object containing 'spam_test_id' as a number.
    export function isScheduleHistoryParams(args: unknown): args is ScheduleHistoryParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'spam_test_id' in args &&
        typeof (args as ScheduleHistoryParams).spam_test_id === 'number'
      );
    }
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. It describes a read operation ('Get'), implying it's likely non-destructive, but doesn't specify permissions, rate limits, pagination, or error handling. For a tool with no annotations, this leaves significant gaps in understanding how it behaves, such as whether it requires authentication or has performance constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, straightforward sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action and resource, making it easy to parse. However, it could be slightly more structured by explicitly mentioning the parameter or output, but overall, it's concise and well-formed for its length.

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 complexity of retrieving schedule history, the lack of annotations and output schema means the description should do more to compensate. It doesn't explain what the 'list and summary' includes (e.g., test results, timestamps, statuses) or any behavioral aspects like data format or limitations. For a tool with no structured support, this leaves users underinformed about what to expect from the operation.

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, with 'spam_test_id' clearly documented as 'ID of the automated spam test to get the schedule history for.' The description adds no additional parameter details beyond this, as it doesn't elaborate on format, constraints, or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema handles the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get the list and summary of all tests that ran for a particular automated test,' which provides a clear verb ('Get') and resource ('list and summary of all tests'). However, it's somewhat vague about what 'tests' specifically refer to (e.g., schedule history tests vs. other types), and it doesn't distinguish itself from sibling tools like 'smartlead_list_all_tests' or 'smartlead_get_spam_test_details,' which might overlap in purpose. This limits its specificity and differentiation.

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, exclusions, or compare it to sibling tools such as 'smartlead_list_all_tests' or 'smartlead_get_spam_test_details,' which could be related. Without this context, users must infer usage based on the tool name and description alone, leading to potential confusion in tool selection.

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