Skip to main content
Glama
bcharleson

Instantly MCP Server

update_lead

Modify lead details including name, company information, and custom fields to maintain accurate and current contact records in email campaigns.

Instructions

Update a lead

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyNoCompany name
custom_fieldsNoCustom fields as key-value pairs
first_nameNoFirst name
last_nameNoLast name
lead_idYesLead ID

Implementation Reference

  • Core handler function executing the update_lead tool: validates lead_id, builds PATCH payload from args, calls Instantly API /leads/{lead_id}, formats MCP response.
    async function handleUpdateLead(args: any, apiKey: string) {
      console.error('[Instantly MCP] ✏️ Executing update_lead...');
    
      if (!args.lead_id) {
        throw new McpError(ErrorCode.InvalidParams, 'Lead ID is required for update_lead');
      }
    
      // Build update data with all supported parameters from Instantly.ai API v2
      const updateData: any = {};
    
      // Core lead information
      if (args.personalization !== undefined) updateData.personalization = args.personalization;
      if (args.website !== undefined) updateData.website = args.website;
      if (args.last_name !== undefined) updateData.last_name = args.last_name;
      if (args.first_name !== undefined) updateData.first_name = args.first_name;
      if (args.company_name !== undefined) updateData.company_name = args.company_name;
      if (args.phone !== undefined) updateData.phone = args.phone;
    
      // Advanced parameters
      if (args.lt_interest_status !== undefined) updateData.lt_interest_status = args.lt_interest_status;
      if (args.pl_value_lead !== undefined) updateData.pl_value_lead = args.pl_value_lead;
      if (args.assigned_to !== undefined) updateData.assigned_to = args.assigned_to;
    
      // Custom variables
      if (args.custom_variables !== undefined) updateData.custom_variables = args.custom_variables;
    
      console.error(`[Instantly MCP] 📤 Updating lead ${args.lead_id} with data: ${JSON.stringify(updateData, null, 2)}`);
    
      const updateResult = await makeInstantlyRequest(`/leads/${args.lead_id}`, { method: 'PATCH', body: updateData }, apiKey);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              lead: updateResult,
              message: 'Lead updated successfully'
            }, null, 2)
          }
        ]
      };
    }
  • MCP tool registration in leadTools array: defines name, title, description, inputSchema for update_lead.
    {
      name: 'update_lead',
      title: 'Update Lead',
      description: 'Update lead (partial). ⚠️ custom_variables replaces entire object.',
      annotations: { destructiveHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          lead_id: { type: 'string', description: 'Lead UUID' },
          personalization: { type: 'string' },
          website: { type: 'string' },
          last_name: { type: 'string' },
          first_name: { type: 'string' },
          company_name: { type: 'string' },
          phone: { type: 'string' },
          lt_interest_status: { type: 'number' },
          pl_value_lead: { type: 'string' },
          assigned_to: { type: 'string' },
          custom_variables: { type: 'object', description: 'Replaces all - include existing!' }
        },
        required: ['lead_id']
      }
    },
  • Zod schema (UpdateLeadSchema) for input validation of update_lead tool parameters, used by validateUpdateLeadData.
    export const UpdateLeadSchema = z.object({
      lead_id: z.string().min(1, { message: 'Lead ID cannot be empty' }),
      personalization: z.string().optional(),
      website: z.string().url().optional(),
      last_name: z.string().optional(),
      first_name: z.string().optional(),
      company_name: z.string().optional(),
      phone: z.string().optional(),
      lt_interest_status: z.number().int().min(-3).max(4).optional(),
      pl_value_lead: z.string().optional(),
      assigned_to: z.string().optional(),
      custom_variables: z.record(z.string(), z.any()).optional()
    });
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. 'Update a lead' implies a mutation operation, but it doesn't describe what happens during the update (e.g., whether it overwrites or merges fields, if custom_fields are additive or replace existing ones), what permissions are required, or what the response looks like (especially since there's no output schema). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise at just three words ('Update a lead'), with zero wasted language. It's front-loaded with the core action and resource, making it easy to parse quickly. While it may be overly brief for a mutation tool, it earns full marks for conciseness as every word contributes directly to the purpose.

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 (a mutation tool with 5 parameters including nested objects), lack of annotations, and no output schema, the description is incomplete. It doesn't address key contextual aspects like what the update does behaviorally, how to handle custom_fields, what happens on success/failure, or how it differs from sibling tools. For a tool that modifies data, this minimal description leaves too many gaps for reliable agent 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 schema description coverage is 100%, with all 5 parameters clearly documented in the schema (e.g., lead_id as required, company, custom_fields, first_name, last_name). The description adds no additional parameter information beyond what's in the schema, such as examples or constraints. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description, which applies here.

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 'Update a lead' clearly states the verb (update) and resource (lead), making the basic purpose understandable. However, it doesn't specify what aspects of a lead can be updated or differentiate this tool from sibling tools like 'update_account' or 'update_campaign' that also perform updates on different resources. The purpose is clear but lacks specificity about scope and distinction from alternatives.

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., needing an existing lead ID), when not to use it (e.g., for creating new leads, which is handled by 'create_lead'), or compare it to similar tools like 'update_account'. Without any usage context, agents must infer everything from the tool name and schema 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/bcharleson/Instantly-MCP'

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