manage_lead
Update lead status and add notes in the LinkedIn prospection pipeline to track engagement progress.
Instructions
Update a lead's status in the pipeline. Use this to mark leads as contacted, replied, not_interested, or to add notes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Lead name (partial match supported) | |
| status | Yes | New status | |
| notes | No | Optional notes about the lead |
Implementation Reference
- src/index.ts:572-632 (handler)The `manage_lead` tool registration and handler implementation. It updates a lead's status and notes in the daily prospection log.
server.registerTool( "manage_lead", { title: "Manage Lead Status", description: "Update a lead's status in the pipeline. Use this to mark leads as contacted, " + "replied, not_interested, or to add notes.", inputSchema: { name: z.string().describe("Lead name (partial match supported)"), status: z.enum([ "pending_invitation", "invitation_sent", "connection_accepted", "dm_sent", "replied", "meeting_booked", "not_interested", "removed", ]).describe("New status"), notes: z.string().optional().describe("Optional notes about the lead"), }, annotations: { readOnlyHint: false, openWorldHint: false, destructiveHint: false }, }, async ({ name, status, notes }) => { const logPath = getDailyLogPath(); const log = getDailyLog() as { leads_p1?: Array<Record<string, unknown>>; leads_p2?: Array<Record<string, unknown>>; }; const nameLower = name.toLowerCase(); let found = false; let matchedName = ""; for (const pool of [log.leads_p1 || [], log.leads_p2 || []]) { for (const lead of pool) { if ((lead.name as string || "").toLowerCase().includes(nameLower)) { lead.status = status; if (notes) lead.notes = notes; lead.updated_at = new Date().toISOString(); found = true; matchedName = lead.name as string; break; } } if (found) break; } if (!found) { return { isError: true, content: [{ type: "text" as const, text: `Lead "${name}" not found in pipeline.` }], }; } fs.writeFileSync(logPath, JSON.stringify(log, null, 2)); return { content: [ { type: "text" as const, text: `Updated ${matchedName} → status: ${status}${notes ? ` | notes: ${notes}` : ""}`, }, ], }; }, );