find_leads
Search LinkedIn for professionals discussing burnout, stress, or exhaustion to identify potential leads for outreach and engagement.
Instructions
Search LinkedIn for leads posting about burnout, stress, or exhaustion. Uses Playwright to scrape LinkedIn posts matching burnout keywords. Requires an active LinkedIn session (run setup-session first).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Simulate without actually scraping |
Implementation Reference
- src/index.ts:263-303 (handler)The handler function for the 'find_leads' tool, which runs the 'find-leads-v2.js' script and processes the results.
async ({ dry_run }) => { if (!fs.existsSync(SESSION_DIR)) { return { isError: true, content: [{ type: "text" as const, text: "LinkedIn session not found. Run setup-session.js first to log in." }], }; } const args = dry_run ? ["--dry-run"] : []; const result = await runScript("find-leads-v2.js", args, 300_000); if (result.code !== 0) { return { isError: true, content: [{ type: "text" as const, text: `Lead search failed (code ${result.code}):\n${result.stderr}` }], }; } const leads = getLeads(); const summary = (leads as { summary?: { p1?: number; p2?: number; p3?: number; total?: number } }).summary; return { content: [ { type: "text" as const, text: [ "Lead search completed!", summary ? `P1-hot: ${summary.p1 || 0} | P2-warm: ${summary.p2 || 0} | P3-nurture: ${summary.p3 || 0} | Total: ${summary.total || 0}` : "", "", result.stdout.slice(-2000), ].join("\n"), }, ], }; }, ); // ─── Tool 2: score_lead ───────────────────────────────────────── server.registerTool( "score_lead", - src/index.ts:250-262 (registration)Registration of the 'find_leads' tool in the MCP server.
server.registerTool( "find_leads", { title: "Find LinkedIn Leads", description: "Search LinkedIn for leads posting about burnout, stress, or exhaustion. " + "Uses Playwright to scrape LinkedIn posts matching burnout keywords. " + "Requires an active LinkedIn session (run setup-session first).", inputSchema: { dry_run: z.boolean().default(false).optional().describe("Simulate without actually scraping"), }, annotations: { readOnlyHint: false, openWorldHint: true, destructiveHint: false }, },