Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_campaign_statistics_by_date

Retrieve email campaign performance metrics for a specific date range to analyze engagement and track marketing effectiveness.

Instructions

Fetch campaign statistics for a specific date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign to fetch statistics for
end_dateYesEnd date in YYYY-MM-DD format
start_dateYesStart date in YYYY-MM-DD format

Implementation Reference

  • The core handler function that validates input parameters using isCampaignStatisticsByDateParams, makes an authenticated API call to Smartlead's /campaigns/{campaign_id}/analytics-by-date endpoint with start_date and end_date query parameters, and returns the JSON response or formatted error.
    async function handleCampaignStatisticsByDate(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isCampaignStatisticsByDateParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_campaign_statistics_by_date'
        );
      }
    
      const { campaign_id, start_date, end_date } = args;
    
      try {
        const response = await withRetry(
          async () => apiClient.get(`/campaigns/${campaign_id}/analytics-by-date`, {
            params: {
              start_date,
              end_date
            }
          }),
          'get campaign statistics by date'
        );
    
        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 input schema with required parameters: campaign_id (number), start_date (string YYYY-MM-DD), end_date (string YYYY-MM-DD).
    export const CAMPAIGN_STATISTICS_BY_DATE_TOOL: CategoryTool = {
      name: 'smartlead_get_campaign_statistics_by_date',
      description: 'Fetch campaign statistics for a specific date range.',
      category: ToolCategory.CAMPAIGN_STATISTICS,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'number',
            description: 'ID of the campaign to fetch statistics for',
          },
          start_date: {
            type: 'string',
            description: 'Start date in YYYY-MM-DD format',
          },
          end_date: {
            type: 'string',
            description: 'End date in YYYY-MM-DD format',
          },
        },
        required: ['campaign_id', 'start_date', 'end_date'],
      },
    };
  • src/index.ts:212-214 (registration)
    Bulk registers all statistics tools (including smartlead_get_campaign_statistics_by_date via statisticsTools array) to the ToolRegistry if the campaignStatistics feature category is enabled.
    if (enabledCategories.campaignStatistics) {
      toolRegistry.registerMany(statisticsTools);
    }
  • Dispatches tool calls matching the name to the specific handler function handleCampaignStatisticsByDate within the statistics tool handler.
    case 'smartlead_get_campaign_statistics_by_date': {
      return handleCampaignStatisticsByDate(args, 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 the full burden of behavioral disclosure. It only states what the tool does ('Fetch campaign statistics'), without mentioning whether this is a read-only operation, if it requires specific permissions, what format the statistics are returned in, or any rate limits or constraints. For a tool with no annotation coverage, this is a significant gap in transparency.

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 front-loads the key information ('Fetch campaign statistics for a specific date range') with zero wasted words. It's appropriately sized for a straightforward tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 required parameters, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks behavioral details, usage context, and output information, which are crucial for an agent to use it effectively without annotations or output schema to fill the gaps.

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, clearly documenting all three parameters (campaign_id, start_date, end_date) with their types and formats. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline score of 3 where the schema does the heavy lifting.

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 ('Fetch') and resource ('campaign statistics') with a specific scope ('for a specific date range'), making the purpose unambiguous. However, it doesn't differentiate from similar siblings like 'smartlead_get_campaign_analytics_by_date' or 'smartlead_get_campaign_top_level_analytics_by_date', which appear to serve overlapping functions, so it falls short of a perfect score.

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. With multiple sibling tools that seem related (e.g., 'smartlead_get_campaign_analytics_by_date'), there's no indication of differences in scope, granularity, or context, leaving the agent to guess based on names 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