Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_list_campaigns

Retrieve and filter email marketing campaigns by status, with pagination controls to manage campaign lists effectively.

Instructions

List all campaigns with optional filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of campaigns to return
offsetNoOffset for pagination
statusNoFilter campaigns by status

Implementation Reference

  • Executes the tool by validating input with isListCampaignsParams, making a GET request to Smartlead API '/campaigns' endpoint with args as params, and returning formatted response or error.
    async function handleListCampaigns( args: unknown, apiClient: AxiosInstance, withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T> ) { if (!isListCampaignsParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for smartlead_list_campaigns' ); } try { const response = await withRetry( async () => apiClient.get('/campaigns', { params: args }), 'list campaigns' ); 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: name, description, category, and input schema for optional parameters (status, limit, offset).
    export const LIST_CAMPAIGNS_TOOL: CategoryTool = { name: 'smartlead_list_campaigns', description: 'List all campaigns with optional filtering.', category: ToolCategory.CAMPAIGN_MANAGEMENT, inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['active', 'paused', 'completed'], description: 'Filter campaigns by status', }, limit: { type: 'number', description: 'Maximum number of campaigns to return', }, offset: { type: 'number', description: 'Offset for pagination', }, }, }, };
  • src/index.ts:197-199 (registration)
    Registers the array of campaign tools (including smartlead_list_campaigns schema) to the ToolRegistry if campaignManagement category is enabled.
    if (enabledCategories.campaignManagement) { toolRegistry.registerMany(campaignTools); }
  • Type guard function used in handler for input validation, allowing any non-null object.
    export function isListCampaignsParams(args: unknown): args is ListCampaignsParams { return typeof args === 'object' && args !== null; }
  • Switch case in handleCampaignTool that dispatches to the specific list campaigns handler.
    case 'smartlead_list_campaigns': { return handleListCampaigns(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