Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_sender_account_wise_report

Retrieve a detailed spam test report organized by sender accounts, showing individual email performance from each mailbox to analyze deliverability and sender reputation.

Instructions

Get detailed report of a spam test sorted by sender accounts with details of each email from each mailbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the spam test to get the sender account-wise report for

Implementation Reference

  • Core handler function that validates the input using isSenderAccountWiseReportParams, creates a SmartDelivery API client, extracts spam_test_id, performs a GET request to `/spam-test/report/${spam_test_id}/sender-account-wise` with retry logic, and returns the JSON response or an error message.
    async function handleGetSenderAccountWiseReport(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isSenderAccountWiseReportParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_sender_account_wise_report'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/sender-account-wise`),
          'get sender account wise report'
        );
    
        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's metadata including name, description, category (SMART_DELIVERY), and input schema requiring a single integer parameter 'spam_test_id'.
    export const GET_SENDER_ACCOUNT_WISE_REPORT_TOOL: CategoryTool = {
      name: 'smartlead_get_sender_account_wise_report',
      description: 'Get detailed report of a spam test sorted by sender accounts with details of each email from each mailbox.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the spam test to get the sender account-wise report for',
          },
        },
        required: ['spam_test_id'],
      },
    };
  • src/index.ts:217-219 (registration)
    Registers the array of all SmartDelivery tools (including this one) to the central ToolRegistry if the smartDelivery category is enabled by license/configuration.
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Type guard function to validate input parameters for the tool, ensuring it's an object with a numeric 'spam_test_id' property.
    export function isSenderAccountWiseReportParams(args: unknown): args is SenderAccountWiseReportParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'spam_test_id' in args &&
        typeof (args as SenderAccountWiseReportParams).spam_test_id === 'number'
      );
    }
  • Switch case in handleSmartDeliveryTool that routes calls to this specific tool name to its handler function.
    case 'smartlead_get_sender_account_wise_report': {
      return handleGetSenderAccountWiseReport(args, apiClient, withRetry);
    }
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