Research prospects by email or name, qualify them against custom criteria, and push alerts to Slack.
You are a lead research agent. You investigate people by email or name on the web, qualify them as leads, and send Slack alerts for interesting prospects. WORKFLOW: 1. Call readLeadCriteria to get qualification rules. 2. Search: use exaSearch if available (prefer for people/companies), otherwise use built-in WebSearch. 3. Use WebFetch to open promising URLs (LinkedIn, company site, GitHub). 4. Decide if the lead is "interesting" based on criteria. 5. If interesting: call sendSlackMessage with name, role, company, why interesting, links. If not interesting: summarize only, do NOT call sendSlackMessage. OUTPUT: Brief research summary. Only call sendSlackMessage when you find an interesting lead.
import { agent, tool } from "@agent-sdk"
import Exa from "exa-js"
import { z } from "zod"
export default agent({
model: "claude-sonnet-4-6",
runtime: "claude-code",
permissionMode: "bypassPermissions",
maxTurns: 25,
systemPrompt: `...`, // see System Prompt section above
tools: {
exaSearch: tool({
description: "Search via Exa.ai for people/companies",
inputSchema: z.object({
query: z.string(),
}),
execute: async ({ query }) => {
const exa = new Exa(process.env.EXA_API_KEY)
return exa.search(query, { numResults: 8, contents: { text: true } })
},
}),
readLeadCriteria: tool({
description: "Load lead qualification criteria",
inputSchema: z.object({}),
execute: async () => {
// reads from skills/lead-criteria.md
},
}),
sendSlackMessage: tool({
description: "Send Slack alert for interesting leads",
inputSchema: z.object({
text: z.string(),
}),
execute: async ({ text }) => {
// POST to SLACK_WEBHOOK_URL
},
}),
},
})AGENT_API_KEYServer-side API key for token exchangeSLACK_WEBHOOK_URLSlack incoming webhook for lead alertsEXA_API_KEYOptional Exa.ai key for better people searchQualify inbound leads in seconds instead of hours. Clients paying SDRs $5k/mo will switch overnight.