Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_add_client

Add a new client to the Smartlead email marketing system with configurable permissions and optional white-label branding settings.

Instructions

Add a new client to the system, optionally with white-label settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail address of the client
logoNoLogo text or identifier
logo_urlNoURL to the client's logo image
nameYesName of the client
passwordYesPassword for the client's account
permissionYesArray of permissions to grant to the client. Use ["full_access"] for full permissions.

Implementation Reference

  • Core handler function that validates input parameters using isAddClientParams, creates a SmartLead API client proxy, performs POST request to '/client/save' endpoint with retry logic, and returns formatted API response or error.
    async function handleAddClient(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isAddClientParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_add_client'
        );
      }
    
      try {
        const smartLeadClient = createSmartLeadClient(apiClient);
        
        const response = await withRetry(
          async () => smartLeadClient.post('/client/save', args),
          'add client'
        );
    
        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,
        };
      }
    }
  • TypeScript interface defining input parameters for smartlead_add_client and runtime type guard (isAddClientParams) for validation.
    export interface AddClientParams {
      name: string;
      email: string;
      permission: ClientPermission[];
      logo?: string;
      logo_url?: string | null;
      password: string;
    }
    
    // Fetch all clients
    export interface FetchAllClientsParams {
      // This endpoint doesn't require specific parameters beyond the API key
      // which is handled at the API client level
    }
    
    // Type guards
    export function isAddClientParams(args: unknown): args is AddClientParams {
      if (typeof args !== 'object' || args === null) return false;
      
      const params = args as Partial<AddClientParams>;
      
      return (
        typeof params.name === 'string' &&
        typeof params.email === 'string' &&
        Array.isArray(params.permission) &&
        params.permission.every(perm => typeof perm === 'string') &&
        typeof params.password === 'string' &&
        (params.logo === undefined || typeof params.logo === 'string') &&
        (params.logo_url === undefined || params.logo_url === null || typeof params.logo_url === 'string')
      );
    }
  • MCP tool definition including JSON input schema for smartlead_add_client parameters.
    export const ADD_CLIENT_TOOL: CategoryTool = {
      name: 'smartlead_add_client',
      description: 'Add a new client to the system, optionally with white-label settings.',
      category: ToolCategory.CLIENT_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the client',
          },
          email: {
            type: 'string',
            description: 'Email address of the client',
          },
          permission: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of permissions to grant to the client. Use ["full_access"] for full permissions.',
          },
          logo: {
            type: 'string',
            description: 'Logo text or identifier',
          },
          logo_url: {
            type: ['string', 'null'],
            description: 'URL to the client\'s logo image',
          },
          password: {
            type: 'string',
            description: 'Password for the client\'s account',
          },
        },
        required: ['name', 'email', 'permission', 'password'],
      },
    };
  • src/index.ts:226-229 (registration)
    Registers the clientManagementTools array (including smartlead_add_client) to the tool registry if clientManagement category is enabled.
    // Register client management tools if enabled
    if (enabledCategories.clientManagement) {
      toolRegistry.registerMany(clientManagementTools);
    }
  • Dispatcher function for client management tools that routes 'smartlead_add_client' calls to the specific handleAddClient implementation.
    export async function handleClientManagementTool(
      toolName: string,
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      switch (toolName) {
        case 'smartlead_add_client': {
          return handleAddClient(args, apiClient, withRetry);
        }
        case 'smartlead_fetch_all_clients': {
          return handleFetchAllClients(args, apiClient, withRetry);
        }
        default:
          throw new Error(`Unknown Client Management tool: ${toolName}`);
      }
    }
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 an 'Add' operation (implying creation/mutation) but doesn't describe what happens on success/failure, whether it's idempotent, permission requirements beyond the 'permission' parameter, or rate limits. The mention of 'white-label settings' is vague and doesn't clarify behavioral impact. This is inadequate for a mutation tool with zero annotation coverage.

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 purpose. It avoids redundancy and wastes no words, though it could be slightly more informative without losing conciseness. The structure is clear but minimal.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context: what the tool returns (e.g., client ID, success status), error conditions, authentication needs, and how it fits into the broader system. The 100% schema coverage helps with parameters, but overall completeness is poor given the tool's complexity and lack of structured metadata.

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 fully documents all 6 parameters. The description adds no parameter-specific information beyond implying that 'white-label settings' might relate to some parameters (e.g., logo, logo_url), but this is not explicit. Baseline 3 is appropriate when the schema does the heavy lifting, though the description could have clarified parameter interactions.

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 action ('Add a new client') and resource ('to the system'), and mentions optional white-label settings. It doesn't explicitly differentiate from sibling tools like 'smartlead_fetch_all_clients', but the verb 'Add' versus 'fetch' provides implicit distinction. The purpose is specific but could be more precise about what 'client' means in this context.

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. It doesn't mention prerequisites (e.g., authentication requirements), when not to use it, or how it relates to sibling tools like 'smartlead_fetch_all_clients' for viewing clients. The optional white-label mention is minimal context, not usage guidance.

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