Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_campaign_sequence_analytics

Fetch analytics data for email campaign sequences to track performance metrics and engagement over specific time periods.

Instructions

Fetch analytics data for a specific email campaign sequence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign to fetch sequence analytics for
end_dateYesEnd date in YYYY-MM-DD HH:MM:SS format
start_dateYesStart date in YYYY-MM-DD HH:MM:SS format
time_zoneNoTimezone for the analytics data (e.g., "Europe/London")

Implementation Reference

  • The core handler function that validates the input parameters using isGetCampaignSequenceAnalyticsParams, makes an authenticated GET request to the Smartlead API endpoint `/campaigns/{campaign_id}/sequence-analytics` with date range and timezone parameters, formats the response as JSON text, and handles errors appropriately.
    async function handleGetCampaignSequenceAnalytics(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isGetCampaignSequenceAnalyticsParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_campaign_sequence_analytics'
        );
      }
    
      const { campaign_id, ...params } = args;
    
      try {
        const response = await withRetry(
          async () => apiClient.get(`/campaigns/${campaign_id}/sequence-analytics`, { 
            params 
          }),
          'get campaign sequence analytics'
        );
    
        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, and detailed input schema (JSON Schema) for validation, specifying required campaign_id, start_date, end_date, and optional time_zone.
    export const GET_CAMPAIGN_SEQUENCE_ANALYTICS_TOOL: CategoryTool = {
      name: 'smartlead_get_campaign_sequence_analytics',
      description: 'Fetch analytics data for a specific email campaign sequence.',
      category: ToolCategory.CAMPAIGN_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'number',
            description: 'ID of the campaign to fetch sequence analytics for',
          },
          start_date: {
            type: 'string',
            description: 'Start date in YYYY-MM-DD HH:MM:SS format',
          },
          end_date: {
            type: 'string',
            description: 'End date in YYYY-MM-DD HH:MM:SS format',
          },
          time_zone: {
            type: 'string',
            description: 'Timezone for the analytics data (e.g., "Europe/London")',
          },
        },
        required: ['campaign_id', 'start_date', 'end_date'],
      },
    };
  • Runtime type guard function that validates input arguments match the GetCampaignSequenceAnalyticsParams interface, checking for required properties with correct types.
    export function isGetCampaignSequenceAnalyticsParams(args: unknown): args is GetCampaignSequenceAnalyticsParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'campaign_id' in args &&
        typeof (args as { campaign_id: unknown }).campaign_id === 'number' &&
        'start_date' in args &&
        typeof (args as { start_date: unknown }).start_date === 'string' &&
        'end_date' in args &&
        typeof (args as { end_date: unknown }).end_date === 'string'
      );
    }
  • src/index.ts:197-199 (registration)
    Registers the array of campaign tools (including smartlead_get_campaign_sequence_analytics) to the tool registry if the campaignManagement category is enabled by license/features.
    if (enabledCategories.campaignManagement) {
      toolRegistry.registerMany(campaignTools);
    }
  • Switch case in handleCampaignTool that dispatches execution to the specific handler function for this tool name.
    case 'smartlead_get_campaign_sequence_analytics': {
      return handleGetCampaignSequenceAnalytics(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. While 'Fetch' implies a read-only operation, the description doesn't specify authentication requirements, rate limits, error conditions, or what format the analytics data returns. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for a straightforward data retrieval tool and follows good front-loading principles by stating the core purpose immediately.

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 tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what analytics data is returned, in what format, or what metrics are included. Given the complexity implied by the sibling tools and the lack of structured behavioral information, the description should provide more context about the tool's behavior and output.

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 schema description coverage is 100%, with all parameters well-documented in the input schema. The description doesn't add any parameter information beyond what's already in the schema, so it meets the baseline expectation but doesn't provide additional value. The description mentions 'specific email campaign sequence' which aligns with the campaign_id parameter but doesn't elaborate further.

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 verb ('Fetch') and resource ('analytics data for a specific email campaign sequence'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'smartlead_get_campaign_analytics_by_date' or 'smartlead_get_campaign_statistics', which appear to serve similar analytics functions.

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 the many other analytics-related sibling tools. There's no mention of prerequisites, alternatives, or specific use cases that would help an agent choose this over similar tools like 'smartlead_get_campaign_analytics_by_date' or 'smartlead_get_campaign_statistics'.

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