Skip to main content
Glama
bcharleson

Instantly MCP Server

create_lead

Add new leads to email campaigns by providing essential contact information and custom fields for targeted outreach.

Instructions

Create a new lead

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyNameNoCompany name
custom_fieldsNoCustom fields as key-value pairs
emailYesLead email address
firstNameNoFirst name
lastNameNoLast name
personalizationNoPersonalization field
websiteNoCompany website

Implementation Reference

  • Core handler function that executes the create_lead tool logic: builds lead data from args and makes POST request to Instantly.ai /leads endpoint.
    async function handleCreateLead(args: any, apiKey: string) {
      console.error('[Instantly MCP] 👤 Executing create_lead...');
    
      // Build lead data with all supported parameters from Instantly.ai API v2
      const leadData: any = {};
    
      // Core lead information
      if (args.campaign) leadData.campaign = args.campaign;
      if (args.email) leadData.email = args.email;
      if (args.first_name) leadData.first_name = args.first_name;
      if (args.last_name) leadData.last_name = args.last_name;
      if (args.company_name) leadData.company_name = args.company_name;
      if (args.phone) leadData.phone = args.phone;
      if (args.website) leadData.website = args.website;
      if (args.personalization) leadData.personalization = args.personalization;
    
      // Advanced parameters
      if (args.lt_interest_status !== undefined) leadData.lt_interest_status = args.lt_interest_status;
      if (args.pl_value_lead) leadData.pl_value_lead = args.pl_value_lead;
      if (args.list_id) leadData.list_id = args.list_id;
      if (args.assigned_to) leadData.assigned_to = args.assigned_to;
    
      // Skip conditions
      if (args.skip_if_in_workspace !== undefined) leadData.skip_if_in_workspace = args.skip_if_in_workspace;
      if (args.skip_if_in_campaign !== undefined) leadData.skip_if_in_campaign = args.skip_if_in_campaign;
      if (args.skip_if_in_list !== undefined) leadData.skip_if_in_list = args.skip_if_in_list;
    
      // Verification and blocklist
      if (args.blocklist_id) leadData.blocklist_id = args.blocklist_id;
      if (args.verify_leads_for_lead_finder !== undefined) leadData.verify_leads_for_lead_finder = args.verify_leads_for_lead_finder;
      if (args.verify_leads_on_import !== undefined) leadData.verify_leads_on_import = args.verify_leads_on_import;
    
      // Custom variables
      if (args.custom_variables) leadData.custom_variables = args.custom_variables;
    
      console.error(`[Instantly MCP] 📤 Creating lead with data: ${JSON.stringify(leadData, null, 2)}`);
    
      const createResult = await makeInstantlyRequest('/leads', { method: 'POST', body: leadData }, apiKey);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              lead: createResult,
              message: 'Lead created successfully'
            }, null, 2)
          }
        ]
      };
    }
  • MCP tool registration/definition including name, description, annotations, and inputSchema for create_lead.
    {
      name: 'create_lead',
      title: 'Create Lead',
      description: 'Create lead with custom variables. Use skip_if_in_campaign to prevent duplicates.',
      annotations: { destructiveHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          campaign: { type: 'string', description: 'Campaign UUID' },
          email: { type: 'string', description: 'Required' },
          first_name: { type: 'string' },
          last_name: { type: 'string' },
          company_name: { type: 'string' },
          phone: { type: 'string' },
          website: { type: 'string' },
          personalization: { type: 'string' },
          lt_interest_status: { type: 'number', description: '-3 to 4' },
          pl_value_lead: { type: 'string' },
          list_id: { type: 'string' },
          assigned_to: { type: 'string' },
          skip_if_in_workspace: { type: 'boolean' },
          skip_if_in_campaign: { type: 'boolean', description: 'Recommended' },
          skip_if_in_list: { type: 'boolean' },
          blocklist_id: { type: 'string' },
          verify_leads_on_import: { type: 'boolean' },
          custom_variables: { type: 'object', description: 'Match campaign field names' }
        }
      }
    },
  • Zod schema for validating create_lead input parameters, matching the tool's inputSchema.
    export const CreateLeadSchema = z.object({
      // Core lead information
      campaign: z.string().optional(),
      email: z.string().email().optional(),
      first_name: z.string().optional(),
      last_name: z.string().optional(),
      company_name: z.string().optional(),
      phone: z.string().optional(),
      website: z.string().url().optional(),
      personalization: z.string().optional(),
    
      // Advanced parameters
      lt_interest_status: z.number().int().min(-3).max(4).optional(),
      pl_value_lead: z.string().optional(),
      list_id: z.string().optional(),
      assigned_to: z.string().optional(),
    
      // Skip conditions
      skip_if_in_workspace: z.boolean().optional(),
      skip_if_in_campaign: z.boolean().optional(),
      skip_if_in_list: z.boolean().optional(),
    
      // Verification and blocklist
      blocklist_id: z.string().optional(),
      verify_leads_for_lead_finder: z.boolean().optional(),
      verify_leads_on_import: z.boolean().optional(),
    
      // Custom variables
      custom_variables: z.record(z.string(), z.any()).optional()
    });
  • Validation wrapper function that applies CreateLeadSchema to input args for create_lead tool.
    export function validateCreateLeadData(args: unknown): z.infer<typeof CreateLeadSchema> {
      return validateWithSchema(CreateLeadSchema, args, 'create_lead');
    }
  • Dispatch case in handleLeadTool switch statement that routes create_lead calls to the handler function.
    case 'create_lead':
      return handleCreateLead(args, apiKey);
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. 'Create a new lead' implies a write operation, but it doesn't disclose behavioral traits like required permissions, whether the operation is idempotent, rate limits, or what happens on success/failure. This leaves significant gaps for an agent to understand how to use it effectively.

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

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for its purpose, making it easy to parse quickly.

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 the complexity of a creation tool with 7 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'lead' is, what happens after creation, or any error conditions, leaving the agent with insufficient context for reliable use.

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?

The input schema has 100% description coverage, so parameters like 'email' (required) and others are documented in the schema. The description adds no additional meaning beyond the schema, such as explaining relationships between fields or usage examples, which aligns with the baseline score for high schema coverage.

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 'Create a new lead' clearly states the verb ('Create') and resource ('lead'), which is better than a tautology. However, it doesn't distinguish this tool from its sibling 'update_lead' or specify what constitutes a 'lead' in this context, making it somewhat vague.

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 like 'update_lead' or 'create_lead_list'. It doesn't mention prerequisites, such as needing an email address, or contextual factors like when leads should be created versus updated.

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/bcharleson/Instantly-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server