Pre-Black Friday: 20% off, for as long as you stayEARLYBFon Solo and AgencyEnds Nov 28Start free

How-to guide

How to Build an AI Sales Agent With Claude (GTM Masterclass)

Five steps with real queries and real output. Size the market for free, pull ten rows, enrich three, and cap the spend in code.

Get your free API key →Free to start. No credit card. 1,000 records to spend whenever you like.

TL;DR

  • A Claude sales agent needs three things: data it can query, rules it cannot talk itself out of, and a spend cap that lives in code, not in the prompt.
  • It takes about 40 minutes. One run spends about 13 of your 1,000 free LeadOcean records: 10 search rows and 3 enrichments.
  • You size the audience for free first. The agent drafts. A human sends.

Prerequisites

  • A LeadOcean account from app.leadocean.io. The free plan has no card and 1,000 records, one-off, at 5 requests a second.
  • Claude Code installed. Step 1 uses it for the MCP connection.
  • curl and jq. REST calls read your key from $LEADOCEAN_API_KEY.
bash
export LEADOCEAN_API_KEY="paste-your-key-here"

Step 1: Connect the data

Most Claude GTM tutorials start with prompts. Start with data. An agent without a data source invents leads.

LeadOcean runs a hosted MCP server at https://api.leadocean.io/mcp with 13 tools. Add it to Claude Code as an HTTP server, then run /mcp to sign in. The Claude Code MCP docs, September 2026, describe both commands.

bash
claude mcp add --transport http leadocean https://api.leadocean.io/mcp
claude mcp list

Sign-in is OAuth, so no key is pasted. Seven of the 13 tools spend nothing: count_leads, count_companies, list_filters, list_enum_values, get_account, get_export and list_exports.

Step 2: Write the rules before the prompt

The rules do more work than the prompt. Put them in a project CLAUDE.md, which Claude Code loads each session.

markdown
SALES AGENT RULES

- You draft. A human sends. You have no email tool.
- Count before you pull. Report the total and the filters you used.
- Say what a count measures. The default count is mailable people.
- Resolve every enum with leadocean_list_enum_values. Never guess.
- Stop at 25 records per run. Report how many you spent.
- Use only fields that came back in a row. Never invent a fact.

The fourth rule matters most. Industry has 534 values and country has 254, and a guessed value returns an empty list that looks like a thin market.

Step 3: Size the ICP for free

Ask Claude in plain English, then check what it sent. The ICP here is VPs of Sales at US software companies with 51 to 200 staff.

text
Use leadocean_count_leads for: jobLevel VP, jobFunction
"Sales & Business Development", country US, industry
"Software Development", employeeRange 51-200. Report the
total, totalAll and distinctCompanies, and say what the
default email filter does to the number.

On 21 October 2026 the count tool returned this. It spent no records.

json
{
  "total": 1649,
  "totalIsExact": true,
  "totalAll": 4141,
  "distinctCompanies": 1125,
  "credits": 0,
  "defaults": "Counted only addresses worth sending to (emailStatus: verified or catch_all_valid or catch_all)"
}

1,649 is the mailable audience. 4,141 is everyone matching the other filters. An agent that reports 1,649 as "all the VPs" is wrong, which is why rule three exists.

Step 4: Pull a sample over REST

Now spend 10 records. The search body is flat JSON and every filter is an array. The limit runs from 1 to 100.

bash
curl -s https://api.leadocean.io/v1/people/search \
  -H "x-api-key: $LEADOCEAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "jobLevel": ["VP"],
    "jobFunction": ["Sales & Business Development"],
    "country": ["US"],
    "industry": ["Software Development"],
    "employeeRange": ["51-200"],
    "limit": 10
  }' | jq '.meta'

Page through more with the cursor from meta. One search pages to 10,000 rows, then meta.depthCapped turns true and the cursor stops. Narrow the filters instead of walking the index.

Step 5: Enrich three and cap the spend

Pick three rows and enrich each by person_id. Enrich takes exactly one of linkedin_url, email, phone or person_id. Set reveal_email to get the address.

bash
curl -s https://api.leadocean.io/v1/people/enrich \
  -H "x-api-key: $LEADOCEAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{"person_id": "PERSON_ID_FROM_STEP_4", "reveal_email": true}' \
  | jq '{name: .data.profile_data.profile_full_name, role: .data.contact_data.contact_current_experiences, history: .data.resume_data.experiences}'

Since October 2026, enrich returns career history in resume_data: past roles, education and certifications. That gives the agent something true to write about. A person we hold nothing for returns 404 and costs nothing.

If you build the loop with the Claude Agent SDK, wrap these calls as custom tools, September 2026. Keep the counter in your code.

python
RECORD_CAP = 25
spent = 0

def allow(n):
    global spent
    if spent + n > RECORD_CAP:
        return False
    spent += n
    return True

A model can ignore a rule in a prompt. It cannot spend past a counter it does not control.

What you get

A run ends with three drafts and a spend line. The count in step 3 is real output from 21 October 2026. A search or enrich row looks like this, a response shape from the API reference with placeholder values.

json
{
  "success": true,
  "data": [
    {
      "profile_data": { "profile_full_name": "Jane Doe" },
      "contact_data": {
        "has_email": true,
        "email_status": "verified",
        "contact_current_experiences": [
          { "company_name": "Acme", "company_domain": "acme.com", "job_title": "VP of Sales" }
        ]
      },
      "resume_data": {},
      "meta": {}
    }
  ],
  "meta": { "count": 10, "limit": 10, "nextCursor": "..." }
}

Check your balance with GET /v1/account, which is free.

Troubleshooting

ErrorCauseFix
401Missing or wrong x-api-keyRe-export $LEADOCEAN_API_KEY and check for trailing spaces.
429Above the plan's rate limit (5 a second on Free, 200 on Agency)Wait for Retry-After, then retry once.
402The plan has no records leftStop the run. The 1,000 Free records are one-off.
Empty dataA filter value is not an exact enum stringResolve it with leadocean_list_enum_values.
404 on enrichNobody matched the inputSkip the row. It cost nothing.
Export refusedOver 50,000 rows a request or 500,000 a daySplit the export. Bulk CSV is not on Free.

FAQ

Do I need Claude Code, or can I use the Claude app?

Either works for steps 1 to 3. The MCP server is the same. Claude Code is better for steps 4 and 5 because it runs curl and reads project rules.

How many records does a test run cost?

About 13: 10 search rows and 3 enrichments. Counting and enrich misses are free. The free plan covers dozens of runs.

Why not let the agent send the emails?

A drafting agent is safe to run unattended. A sending agent is not. LeadOcean has no sequencer, so you review drafts and send from your own tool.

Where does pricing start?

Free is $0 for 1,000 records. Solo is $97 a month and Agency is $497 a month. Paid plans use a fair-use pace, not credits. See pricing.

Where do I go next?

Build your Claude GTM agent on real B2B data

Free to start. No credit card. 1,000 records to spend whenever you like.

Get your free API key →