qualify_leads
Score and qualify LinkedIn leads using rule-based criteria for fit, intent, and urgency to identify promising prospects.
Instructions
Score and qualify all unscored leads from the latest search. Uses the rule-based scoring engine (fit + intent + urgency).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max leads to score |
Implementation Reference
- src/index.ts:354-396 (handler)The handler logic for the qualify_leads tool, which scores leads using a rule-based engine and returns a summary report.
async ({ limit }) => { const leadsData = getLeads() as { leads?: LeadInput[] }; const leads = leadsData.leads || []; if (leads.length === 0) { return { content: [{ type: "text" as const, text: "No leads found. Run find_leads first." }] }; } const maxLeads = limit ?? 50; const toScore = leads.slice(0, maxLeads); const scored = toScore.map(scoreLead); const p1 = scored.filter((l) => l.priority === "P1-hot"); const p2 = scored.filter((l) => l.priority === "P2-warm"); const p3 = scored.filter((l) => l.priority === "P3-nurture"); const p4 = scored.filter((l) => l.priority === "P4-cold"); const lines = [ `Qualified ${scored.length} leads:`, ` P1-hot: ${p1.length}`, ` P2-warm: ${p2.length}`, ` P3-nurture: ${p3.length}`, ` P4-cold: ${p4.length}`, "", ]; if (p1.length > 0) { lines.push("--- P1 HOT LEADS ---"); p1.forEach((l) => { lines.push(` ${l.name} (${l.total_score}/100) — ${l.title || "?"} — ${l.reasoning}`); }); lines.push(""); } if (p2.length > 0) { lines.push("--- P2 WARM LEADS ---"); p2.forEach((l) => { lines.push(` ${l.name} (${l.total_score}/100) — ${l.title || "?"} — ${l.reasoning}`); }); } return { content: [{ type: "text" as const, text: lines.join("\n") }] }; }, - src/index.ts:349-351 (schema)The input schema for the qualify_leads tool, defining the optional limit for batch processing.
inputSchema: { limit: z.number().min(1).max(100).default(50).optional().describe("Max leads to score"), }, - src/index.ts:342-353 (registration)The registration of the qualify_leads tool within the MCP server configuration.
server.registerTool( "qualify_leads", { title: "Qualify Leads (Batch)", description: "Score and qualify all unscored leads from the latest search. " + "Uses the rule-based scoring engine (fit + intent + urgency).", inputSchema: { limit: z.number().min(1).max(100).default(50).optional().describe("Max leads to score"), }, annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false }, },