Tutorial

How to Build an Outbound Agent with Claude Code and Scavio

Use Claude Code's agent loop and Scavio's SERP and Reddit endpoints to build a personalized outbound agent that researches and drafts emails.

r/AIAgents 2026 is full of posts about outbound agents built on Claude Code. The recipe: Claude Code as the reasoning loop, Scavio as the research backend, and a CRM write-back. This tutorial ships the minimum viable outbound agent with prospect-triggered research.

Prerequisites

  • Claude Code latest
  • A Scavio API key
  • An email/CRM destination (Gmail, HubSpot)
  • Node.js 20+

Walkthrough

Step 1: Register Scavio MCP in Claude Code

Gives Claude Code tool access to Scavio search.

JSON
{
  "mcpServers": {
    "scavio": { "command": "scavio-mcp", "env": { "SCAVIO_API_KEY": "sk_live_..." } }
  }
}

Step 2: Write the research skill

A Claude Code skill that triggers on new prospects.

// ~/.claude/skills/outbound-research.md
Instructions: For each prospect, use scavio to search:
1. Company recent news
2. Prospect LinkedIn activity
3. Reddit threads about their industry
Return a 3-bullet brief.

Step 3: Draft personalized email

Pipe the brief into an email template in Claude Code.

Text
// Claude Code prompt
> Using the brief from outbound-research for {prospect_name} at {company}, draft a 3-sentence cold email referencing the most recent specific signal.

Step 4: Queue for send

Save drafts to Gmail API or a review folder.

// ~/.claude/skills/queue-draft.md
After drafting, call the Gmail create_draft tool to queue for human review.

Step 5: Run on a schedule

A cron or GitHub Action triggers the agent for each new prospect.

Bash
# cron
0 9 * * * cd ~/projects/outbound && claude-code run ./agent.md

Python Example

Python
import os, requests

API_KEY = os.environ['SCAVIO_API_KEY']

def research(prospect):
    queries = [
        f'"{prospect["company"]}" news',
        f'site:linkedin.com/posts "{prospect["name"]}"',
        f'{prospect["industry"]} pain points'
    ]
    out = []
    for q in queries:
        r = requests.post('https://api.scavio.dev/api/v1/search',
            headers={'x-api-key': API_KEY},
            json={'query': q, 'num_results': 3})
        out.append(r.json().get('organic_results', []))
    return out

print(research({'name': 'Jane Doe', 'company': 'Acme', 'industry': 'saas'}))

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
export async function research(prospect) {
  const queries = [`"${prospect.company}" news`, `site:linkedin.com/posts "${prospect.name}"`];
  const out = [];
  for (const q of queries) {
    const r = await fetch('https://api.scavio.dev/api/v1/search', {
      method: 'POST',
      headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
      body: JSON.stringify({ query: q, num_results: 3 })
    });
    out.push(((await r.json()).organic_results || []).slice(0, 3));
  }
  return out;
}

Expected Output

JSON
Per-prospect research brief + email draft in Gmail drafts ready for human send. Typical run: 45s per prospect, $0.02 in Scavio credits.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Claude Code latest. A Scavio API key. An email/CRM destination (Gmail, HubSpot). Node.js 20+. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Use Claude Code's agent loop and Scavio's SERP and Reddit endpoints to build a personalized outbound agent that researches and drafts emails.