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);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'optional filtering' but doesn't specify pagination behavior (implied by limit/offset), rate limits, authentication requirements, or what 'list all' entails (e.g., completeness guarantees). For a read operation with no annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('List all campaigns') and adds a qualifying detail ('with optional filtering'). There's no wasted verbiage, though it could be slightly more informative without losing conciseness.

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 no annotations and no output schema, the description is incomplete for a tool with 3 parameters and many sibling alternatives. It lacks behavioral context (e.g., pagination details, error handling), usage differentiation, and output expectations, making it inadequate for an agent to confidently invoke this tool in a complex environment.

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%, with clear descriptions for limit, offset, and status (including enum values). The description adds minimal value beyond the schema by noting 'optional filtering', which aligns with the status parameter but doesn't provide additional context or examples. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('List') and resource ('campaigns') with optional filtering, which clarifies the basic purpose. However, it doesn't differentiate from sibling tools like 'smartlead_get_campaign' or 'smartlead_get_campaigns_by_lead', leaving ambiguity about when to use this specific list operation versus other campaign retrieval tools.

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. With many sibling tools related to campaigns (e.g., 'smartlead_get_campaign', 'smartlead_get_campaigns_by_lead'), there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

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