Skip to main content
Glama

create_lead_list

Generate targeted lead lists for email campaigns by organizing contacts with custom names and descriptions to streamline outreach efforts.

Instructions

Create a new lead list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoList description
nameYesList name

Implementation Reference

  • The handler function that implements the core logic for the 'create_lead_list' tool. It validates input, builds the API request to POST /lead-lists, and formats the MCP response.
    async function handleCreateLeadList(args: any, apiKey: string) { console.error('[Instantly MCP] 📋 Executing create_lead_list...'); if (!args.name) { throw new McpError(ErrorCode.InvalidParams, 'Name is required for create_lead_list'); } // Build list data with official API v2 parameters const listData: any = { name: args.name }; if (args.has_enrichment_task !== undefined) listData.has_enrichment_task = args.has_enrichment_task; if (args.owned_by) listData.owned_by = args.owned_by; console.error(`[Instantly MCP] 📤 Creating lead list with data: ${JSON.stringify(listData, null, 2)}`); const createResult = await makeInstantlyRequest('/lead-lists', { method: 'POST', body: listData }, apiKey); return { content: [ { type: 'text', text: JSON.stringify({ success: true, lead_list: createResult, message: 'Lead list created successfully' }, null, 2) } ] }; }
  • The tool registration in the leadTools array, defining name, description, input schema, and annotations for the MCP server.
    { name: 'create_lead_list', title: 'Create Lead List', description: 'Create list. Set has_enrichment_task=true for auto-enrich.', annotations: { destructiveHint: false }, inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'List name' }, has_enrichment_task: { type: 'boolean' }, owned_by: { type: 'string', description: 'Owner UUID' } }, required: ['name'] } },
  • Zod schema for validating inputs to the create_lead_list tool.
    export const CreateLeadListSchema = z.object({ name: z.string().min(1, { message: 'Lead list name cannot be empty' }), has_enrichment_task: z.boolean().optional(), owned_by: z.string().optional() });
  • Validation function specifically for create_lead_list inputs using the Zod schema.
    export function validateCreateLeadListData(args: unknown): z.infer<typeof CreateLeadListSchema> { return validateWithSchema(CreateLeadListSchema, args, 'create_lead_list'); }
  • Switch case in handleLeadTool that routes 'create_lead_list' calls to the handler function.
    case 'create_lead_list': return handleCreateLeadList(args, apiKey);

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