How to build lead lists in Claude Code with gtmcli
Building lead lists used to mean toggling between LinkedIn, a spreadsheet, an email finder, and a validation tool. You would spend hours copying names, guessing email patterns, and cleaning up bad data. Most of the time, you ended up with a CSV full of gaps and bounces.
There is a faster way. Connect gtmcli as an MCP server inside claude code, describe your ideal customer profile in plain English, and let the agent build your list. It finds contacts, discovers emails, validates them in real time, and exports a clean CSV. The whole process takes minutes, not hours.
This guide walks through the full workflow. By the end, you will have a repeatable process for building verified lead lists without leaving your terminal.
What you need before you start
Three things. First, claude code installed and working on your machine. If you can run claude in your terminal and get a response, you are good. Second, a gtmcli account. Sign up at gtmcli.com and grab your API key from the dashboard. Third, Node.js 18 or later. That is it.
You do not need a CRM, a sales engagement platform, or any other SaaS tool. Everything happens in your terminal.
Step 1: Install gtmcli
Install the CLI globally with npm.
npm install -g gtmcli
Verify the install.
gtmcli --version # 1.4.2
Authenticate with your API key. You only need to do this once.
gtmcli auth login # Paste your API key when prompted # ✓ Authenticated as jeff@company.com
Step 2: Connect gtmcli as an MCP server
MCP (Model Context Protocol) lets claude code call external tools directly. When you add gtmcli as an MCP server, the agent can find emails, validate addresses, and check your credit balance without you writing any glue code.
Add this to your ~/.claude/settings.json file.
{
"mcpServers": {
"gtmcli": {
"command": "gtmcli",
"args": ["mcp", "serve"]
}
}
}Restart claude code. You should see gtmcli listed when you run /mcp inside a session. The agent now has access to these tools:
gtmcli_find_email — Find an email for a person at a company gtmcli_validate_email — Validate a single email address gtmcli_enrich_company — Get firmographic data for a domain gtmcli_check_credits — Check remaining credit balance gtmcli_batch_find — Find emails for a batch of contacts gtmcli_batch_validate — Validate a batch of email addresses gtmcli_export_csv — Export results to CSV
Step 3: Describe your ideal customer profile
Open claude code and tell the agent who you are looking for. Be specific. The more detail you give, the better the list.
> I need a lead list of VP of Sales and Head of Revenue > at B2B SaaS companies with 50-200 employees. > Focus on companies that sell to enterprise. > I need their full name, title, company, company domain, > and a verified work email. > Start with 25 contacts.
That is the entire prompt. No configuration files. No workflow builder. No drag-and-drop. Just plain text describing what you need.
The agent reads your ICP, plans the research, and starts executing. You can watch it work in real time.
Step 4: Watch the agent build your list
Here is what happens behind the scenes. The agent breaks your request into discrete steps and executes them using the MCP tools.
Phase 1: Research
The agent identifies companies matching your criteria. It uses web search and its own knowledge to compile a target account list. For each company, it pulls the domain and basic firmographic data using gtmcli_enrich_company.
Tool: gtmcli_enrich_company
Input: { "domain": "gong.io" }
Result: {
"name": "Gong",
"domain": "gong.io",
"industry": "Sales Intelligence",
"employees": 800,
"funding": "Series E",
"description": "Revenue intelligence platform"
}Phase 2: Contact discovery
For each target company, the agent identifies people matching your title criteria. Then it finds their work email using gtmcli_find_email. The tool checks multiple data sources and returns the best match with a confidence score.
Tool: gtmcli_find_email
Input: {
"first_name": "Sarah",
"last_name": "Chen",
"domain": "gong.io"
}
Result: {
"email": "sarah.chen@gong.io",
"confidence": 97,
"sources": 3,
"credits_used": 1
}Phase 3: Validation
Every email gets validated before it hits your list. The agent calls gtmcli_validate_email for each address. This runs a full SMTP handshake to confirm the mailbox exists and can receive mail.
Tool: gtmcli_validate_email
Input: { "email": "sarah.chen@gong.io" }
Result: {
"email": "sarah.chen@gong.io",
"status": "valid",
"catch_all": false,
"disposable": false,
"credits_used": 1
}Invalid emails get flagged and excluded from the final list. If the agent finds too many invalid addresses at a company, it notes the pattern (often a catch-all domain) and moves on to the next target.
Phase 4: Export
Once the agent has enough verified contacts, it exports the list to CSV.
Tool: gtmcli_export_csv
Input: { "filename": "vp-sales-saas-25.csv" }
Result: {
"file": "vp-sales-saas-25.csv",
"contacts": 25,
"valid_emails": 23,
"invalid_emails": 2,
"columns": ["first_name", "last_name", "title",
"company", "domain", "email", "status"]
}25 contacts. 23 verified emails. Total time: about 4 minutes. Total credits used: roughly 50 (one for each find, one for each validate).
Scaling up: batch operations
For larger lists, the agent automatically switches to batch mode. Instead of calling gtmcli_find_email one at a time, it groups contacts and uses gtmcli_batch_find.
Tool: gtmcli_batch_find
Input: {
"contacts": [
{ "first_name": "Sarah", "last_name": "Chen", "domain": "gong.io" },
{ "first_name": "Marcus", "last_name": "Rivera", "domain": "outreach.io" },
{ "first_name": "Priya", "last_name": "Patel", "domain": "salesloft.com" },
// ... up to 100 per batch
]
}
Result: {
"found": 87,
"not_found": 13,
"credits_used": 100,
"results": [...]
}Batching is faster because the API processes contacts in parallel on the server side. A batch of 100 contacts takes roughly the same time as 5 individual lookups.
Using gtmcli directly from the command line
You do not always need the agent. gtmcli works as a standalone CLI for quick lookups and batch jobs.
# Find a single email gtmcli find-email --first "Sarah" --last "Chen" --domain "gong.io" # Validate a single email gtmcli validate sarah.chen@gong.io # Batch find from a CSV gtmcli batch-find --input contacts.csv --output results.csv # Batch validate from a CSV gtmcli batch-validate --input emails.csv --output validated.csv # Check your credit balance gtmcli credits
The CLI is useful when you already have a list of names and domains and just need emails. Feed it a CSV with first_name, last_name, and domain columns and it does the rest.
Prompt patterns that work
After building hundreds of lists with this workflow, certain prompt patterns consistently produce better results. Here are the ones that work best.
Be specific about titles
"Decision makers" is vague. "VP of Engineering or CTO at companies with 50-200 engineers" is precise. The agent works better when it knows exactly which titles to target.
Include company criteria
Industry, employee count, funding stage, geography. The more constraints you give, the tighter the list. A prompt like "Series B+ fintech companies in the US with 100-500 employees" gives the agent clear boundaries to work within.
Specify the output format
Tell the agent what columns you need. "Include first name, last name, title, company, domain, email, LinkedIn URL, and employee count" ensures you get everything you need in one pass.
Set a quantity
Always tell the agent how many contacts you want. "Start with 25" keeps costs predictable and lets you validate the quality before scaling up. If the first 25 look good, follow up with "Now get me 200 more like those."
Advanced example: multi-persona list
Real outbound campaigns often target multiple personas at the same company. Here is how to prompt for that.
> Build a lead list for 20 B2B SaaS companies > with 200-1000 employees. For each company, > find 3 contacts: > 1. VP/Director of Sales > 2. VP/Director of Marketing > 3. Head of Revenue Operations > > Include verified emails only. > Export to multi-persona-list.csv with columns: > company, domain, employee_count, contact_name, > title, email, validation_status
This produces a 60-row CSV (20 companies x 3 contacts) with verified emails for each persona. The agent handles the complexity of finding the right person for each role at each company. Credit cost: roughly 120 credits (60 finds + 60 validates).
What it costs
gtmcli uses a credit system. Email finding costs 1 credit. Email validation costs 1 credit. Company enrichment costs 1 credit. New accounts start with 100 free credits.
Here is what typical list-building jobs cost:
25 contacts → ~50 credits (find + validate each) 100 contacts → ~200 credits 500 contacts → ~1,000 credits 1000 contacts → ~2,000 credits With company enrichment add ~1 credit per unique company.
At $0.008 per email find and $0.002 per validation, a 500-contact list with verified emails costs about $5. Compare that to the hours of manual work or the monthly subscription to a data vendor.
Troubleshooting common issues
Agent does not see gtmcli tools
Make sure settings.json is in the right location (~/.claude/settings.json) and that you have restarted claude code after adding the config. Run gtmcli mcp serve manually to check for errors.
Low email find rate
Some companies are harder to find emails for, especially small startups with non-standard email patterns. If you are seeing find rates below 70%, try targeting larger companies (100+ employees) where email patterns are more established.
Catch-all domains
Some domains accept any email address (catch-all). gtmcli flags these so you know the validation is inconclusive. The email might still be correct, but you cannot confirm it via SMTP. The agent will note these in your export with a catch_all status.
The complete workflow in 60 seconds
Here is the whole process, start to finish:
1. npm install -g gtmcli 2. gtmcli auth login 3. Add MCP config to ~/.claude/settings.json 4. Open claude code 5. Describe your ICP in plain English 6. Agent builds, validates, and exports the list 7. Import CSV into your CRM or outbound tool
No GUI. No drag-and-drop. No monthly seat fees. Just a prompt and a CSV. The agent handles the research, the email finding, the validation, and the formatting. You review the output and decide what to do with it.
This is what lead list building looks like when you treat it as an engineering problem instead of a manual task.
Try gtmcli
100 free credits. No credit card.