Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_webhooks_publish_summary

Retrieve a summary of webhook publish events for a specific email campaign within a defined time period to monitor delivery and engagement data.

Instructions

Get a summary of webhook publish events (Private Beta feature).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesID of the campaign to get webhook publish summary for
fromTimeNoStart date/time in ISO 8601 format (e.g. 2025-03-21T00:00:00Z)
toTimeNoEnd date/time in ISO 8601 format (e.g. 2025-04-04T23:59:59Z)

Implementation Reference

  • The core handler function that implements the tool logic: validates input parameters using isGetWebhooksPublishSummaryParams, constructs the SmartLead API endpoint /campaigns/{campaign_id}/webhooks/summary with optional fromTime and toTime query parameters, performs the GET request with retry logic, and returns the JSON response or formatted error.
    async function handleGetWebhooksPublishSummary(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isGetWebhooksPublishSummaryParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_webhooks_publish_summary'
        );
      }
    
      try {
        const smartLeadClient = createSmartLeadClient(apiClient);
        const { campaign_id, fromTime, toTime } = args;
        
        let url = `/campaigns/${campaign_id}/webhooks/summary`;
        const queryParams = new URLSearchParams();
        
        if (fromTime) {
          queryParams.append('fromTime', fromTime);
        }
        
        if (toTime) {
          queryParams.append('toTime', toTime);
        }
        
        if (queryParams.toString()) {
          url += `?${queryParams.toString()}`;
        }
        
        const response = await withRetry(
          async () => smartLeadClient.get(url),
          'get webhooks publish summary'
        );
    
        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 MCP tool schema including name, description, category, and inputSchema for parameter validation in the MCP protocol.
    export const GET_WEBHOOKS_PUBLISH_SUMMARY_TOOL: CategoryTool = {
      name: 'smartlead_get_webhooks_publish_summary',
      description: 'Get a summary of webhook publish events (Private Beta feature).',
      category: ToolCategory.WEBHOOKS,
      inputSchema: {
        type: 'object',
        properties: {
          campaign_id: {
            type: 'string',
            description: 'ID of the campaign to get webhook publish summary for',
          },
          fromTime: {
            type: 'string',
            description: 'Start date/time in ISO 8601 format (e.g. 2025-03-21T00:00:00Z)',
          },
          toTime: {
            type: 'string',
            description: 'End date/time in ISO 8601 format (e.g. 2025-04-04T23:59:59Z)',
          },
        },
        required: ['campaign_id'],
      },
    };
  • src/index.ts:221-224 (registration)
    Registers the webhook tools (including smartlead_get_webhooks_publish_summary) to the tool registry if the webhooks category is enabled by license.
    // Register webhook tools if enabled
    if (enabledCategories.webhooks) {
      toolRegistry.registerMany(webhookTools);
    }
  • Runtime type guard function for validating tool input parameters matching the schema.
    export function isGetWebhooksPublishSummaryParams(args: unknown): args is GetWebhooksPublishSummaryParams {
      if (typeof args !== 'object' || args === null) return false;
      
      const params = args as Partial<GetWebhooksPublishSummaryParams>;
      
      return (
        typeof params.campaign_id === 'string' &&
        (params.fromTime === undefined || typeof params.fromTime === 'string') &&
        (params.toTime === undefined || typeof params.toTime === 'string')
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Private Beta feature' which is useful context about availability/status, but doesn't describe what the summary contains, whether it's paginated, what format the response takes, or any rate limits or authentication requirements. 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 communicates the core purpose and adds one valuable piece of context (Private Beta feature). There's no wasted language or unnecessary elaboration. It's appropriately sized for what it conveys.

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 this is a data retrieval tool with no annotations and no output schema, the description should do more to explain what the summary contains, its format, and typical use cases. The mention of 'Private Beta feature' is helpful but insufficient for a tool that presumably returns structured data about webhook events. The agent lacks critical context about what to expect from this 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?

Schema description coverage is 100%, so the schema already documents all three parameters (campaign_id, fromTime, toTime) with clear descriptions. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('Get') and resource ('summary of webhook publish events'), making the purpose understandable. It also mentions this is a 'Private Beta feature', which provides useful context. However, it doesn't explicitly differentiate from sibling tools like 'smartlead_fetch_webhooks_by_campaign' or explain what distinguishes a 'summary' from other webhook-related operations.

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. There's no mention of prerequisites, when this summary is appropriate versus detailed webhook data, or how it differs from 'smartlead_fetch_webhooks_by_campaign' which appears to be a related sibling tool. The agent receives no usage context beyond the basic purpose.

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