Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_sender_accounts

Retrieve all sender accounts configured for a specific spam test to analyze email deliverability and sender reputation.

Instructions

Get the list of all sender accounts selected for a specific spam test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the spam test to get the sender accounts for

Implementation Reference

  • Main handler function that validates arguments using isSenderAccountsParams, creates a SmartDelivery API client, performs a GET request to retrieve sender accounts for the given spam_test_id, and returns the formatted JSON response or error.
    async function handleGetSenderAccounts( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isSenderAccountsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_get_sender_accounts' ); } try { const smartDeliveryClient = createSmartDeliveryClient(apiClient); const { spam_test_id } = args; const response = await withRetry( async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/sender-accounts`), 'get sender accounts' ); 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 (SMART_DELIVERY), and input schema requiring 'spam_test_id' as integer.
    export const GET_SENDER_ACCOUNTS_TOOL: CategoryTool = { name: 'smartlead_get_sender_accounts', description: 'Get the list of all sender accounts selected for a specific spam test.', category: ToolCategory.SMART_DELIVERY, inputSchema: { type: 'object', properties: { spam_test_id: { type: 'integer', description: 'ID of the spam test to get the sender accounts for', }, }, required: ['spam_test_id'], }, };
  • src/index.ts:217-219 (registration)
    Registers the array of smartDeliveryTools (which includes smartlead_get_sender_accounts) to the tool registry if smartDelivery category is enabled.
    if (enabledCategories.smartDelivery) { toolRegistry.registerMany(smartDeliveryTools); }
  • Type guard function for validating input parameters matching SenderAccountsParams interface (spam_test_id: number).
    export function isSenderAccountsParams(args: unknown): args is SenderAccountsParams { return ( typeof args === 'object' && args !== null && 'spam_test_id' in args && typeof (args as SenderAccountsParams).spam_test_id === 'number' ); }
  • Switch case in handleSmartDeliveryTool that routes the tool call to the specific handleGetSenderAccounts implementation.
    case 'smartlead_get_sender_accounts': { return handleGetSenderAccounts(args, apiClient, withRetry); }

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