Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_campaign_top_level_analytics_by_date

Retrieve campaign analytics including key metrics for a specified date range to track performance and measure email marketing effectiveness.

Instructions

Fetch campaign top level analytics for a specific date range.

Input Schema

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

Implementation Reference

  • Core execution logic for the tool: validates input with isCampaignTopLevelAnalyticsByDateParams, calls Smartlead API /campaigns/{campaign_id}/top-level-analytics-by-date with date range params, returns JSON data or error.
    async function handleCampaignTopLevelAnalyticsByDate(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isCampaignTopLevelAnalyticsByDateParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_campaign_top_level_analytics_by_date'
        );
      }
    
      const { campaign_id, start_date, end_date } = args;
    
      try {
        const response = await withRetry(
          async () => apiClient.get(`/campaigns/${campaign_id}/top-level-analytics-by-date`, {
            params: {
              start_date,
              end_date
            }
          }),
          'get campaign top level analytics 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,
        };
      }
    }
  • Tool definition including name, description, category (CAMPAIGN_STATISTICS), and input schema specifying required parameters: campaign_id (number), start_date/end_date (strings in YYYY-MM-DD).
    export const CAMPAIGN_TOP_LEVEL_ANALYTICS_BY_DATE_TOOL: CategoryTool = {
      name: 'smartlead_get_campaign_top_level_analytics_by_date',
      description: 'Fetch campaign top level analytics for a specific date range.',
      category: ToolCategory.CAMPAIGN_STATISTICS,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'number',
            description: 'ID of the campaign to fetch analytics 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:211-214 (registration)
    Conditionally registers the statisticsTools array (containing this tool's definition) into the central ToolRegistry instance.
    // Register campaign statistics tools if enabled
    if (enabledCategories.campaignStatistics) {
      toolRegistry.registerMany(statisticsTools);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral information. It doesn't disclose whether this is a read-only operation, what permissions are needed, how data is returned, or any rate limits. The description implies a fetch operation but lacks crucial context for safe usage.

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 with zero wasted words. It's appropriately sized for a straightforward fetch operation and front-loads the essential information.

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 insufficient. It doesn't explain what 'top level analytics' includes, how results are structured, or any behavioral constraints. Given the complexity implied by 'top level analytics' and lack of structured metadata, more context is needed.

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%, so the schema fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema - it mentions 'date range' which is already covered by start_date and end_date parameters in the schema. Baseline 3 is appropriate when 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 top level analytics') with a specific scope ('for a specific date range'). It distinguishes from some siblings like 'smartlead_get_campaign_analytics_by_date' by specifying 'top level' analytics, though the distinction could be more explicit.

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 like 'smartlead_get_campaign_analytics_by_date' or 'smartlead_get_campaign_statistics_by_date'. It lacks context about what 'top level' means or when this specific analytics view is 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