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

How-to guide

How to Build a GTM Agent (on Claude)

Connect one MCP server, write your ICP in CLAUDE.md, add one skill, then run it with a records cap. About 30 minutes.

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

TL;DR

  • A GTM agent on Claude is four small parts: Claude Code, a CLAUDE.md that holds your ICP, one skill file, and a data source over MCP.
  • It takes about 30 minutes. The example run spends about 13 of your 1,000 free LeadOcean records. Sizing and lookups of filters cost nothing.
  • Claude has no live company data of its own. The MCP server is the part that decides whether the output is right, so connect it first.

Prerequisites

  • A LeadOcean account from app.leadocean.io. The free plan has no card and 1,000 records, one-off.
  • Claude Code installed, signed in, and a folder for the agent (mkdir gtm-agent && cd gtm-agent).
  • For the optional REST check: curl, jq and your key in the shell as $LEADOCEAN_API_KEY.
bash
export LEADOCEAN_API_KEY="paste-your-key-here"

Step 1: Connect the data source

Add LeadOcean as an HTTP MCP server. Claude Code's docs give the form claude mcp add --transport http <name> <url>.

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

Claude's training data is a snapshot from before a cutoff date. People change jobs and companies change size, so an agent that writes from memory will address the wrong person. The MCP server lets the agent fetch a current record in the middle of a task.

Run /mcp inside a session and approve the OAuth sign-in. No key is pasted into the chat. The server exposes 13 tools. Seven never spend records: count leads, count companies, filter list, enum list, account, get export and list exports.

Step 2: Write your ICP in CLAUDE.md

CLAUDE.md is where Claude Code reads persistent instructions at the start of every session. Keep it under 200 lines, as the docs advise, and write rules you can check.

Save this as CLAUDE.md in the agent folder. Acme is a placeholder for your own company, so swap in yours.

markdown
GTM agent for Acme (project management software)

## ICP
- Buyer: VP of Sales, US, at software companies with 51 to 200 staff.
- Exclude: agencies, anyone whose title contains "assistant" or "intern".

## Data rules
- Use the leadocean MCP server for every fact about a person or company.
- Always call leadocean_count_leads before any tool that spends records.
- Never search more than 10 people per run. Never call get_lead on more than 3.
- If a value is not in a tool result, write "unknown". Do not guess.

## Output
- Write drafts to drafts/YYYY-MM-DD.md. Do not send anything.

Plain rules beat clever prompts here. The cap lives in the file on purpose. The agent reads it on every run, so a loose prompt cannot overspend.

Step 3: Size the ICP for free

Count before you search. The tool call below is free, and it returns facets so you can see where the audience sits.

text
Use leadocean_count_leads with jobLevel ["VP"], jobFunction ["Sales & Business Development"],
country ["US"], industry ["Software Development"], employeeRange ["51-200"].
Report the total and say which email statuses it counted.

The same count over REST is a search with count=true as a query parameter and limit at 1. It returns meta.total and no rows.

bash
curl -s "https://api.leadocean.io/v1/people/search?count=true" \
  -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": 1
  }' | jq '.meta | {total, totalIsExact}'

Enum values are exact strings. If a count comes back as 0, resolve the value with leadocean_list_enum_values before you change anything else.

Step 4: Add the skill

A skill is a markdown file the agent loads when it runs. Claude Code's docs say a skill body loads only when used, so long procedures cost almost nothing until then. Save this as .claude/skills/account-brief/SKILL.md.

markdown
---
description: Finds ICP buyers, checks the top three, and drafts one first email each. Use when asked for an account brief or a morning run.
---

## Steps

1. Read the ICP in CLAUDE.md.
2. Call leadocean_count_leads with the ICP filters. Report the total.
3. Call leadocean_search_leads with the ICP filters and limit 10.
4. Pick the 3 people whose title best matches "VP Sales" and whose email_status is verified.
5. Call leadocean_get_lead once for each of the 3.
6. For each, write: name, title, company, one fact from the record, and a first email of
   60 words or fewer. Quote only fields that came back in the tool result.
7. Save everything to drafts/YYYY-MM-DD.md and print the records used.

Two choices matter here. Step 4 picks on email_status, so the agent spends full lookups only on people you can mail. Step 6 forbids facts that are not in the record, which is what stops invented openers.

Step 5: Run it with a spend cap

Run it from the agent folder. Interactive first, so you see each tool call.

text
claude
/account-brief

Once the output looks right, run it unattended. Claude Code's docs describe claude -p for scripted runs and --allowedTools to pre-approve tools. List the tools by name. Anything off the list stays unapproved.

bash
claude -p "/account-brief" \
  --allowedTools "mcp__leadocean__leadocean_count_leads,mcp__leadocean__leadocean_search_leads,mcp__leadocean__leadocean_get_lead,Write"

Check the balance afterwards. GET /v1/account is free.

bash
curl -s https://api.leadocean.io/v1/account -H "x-api-key: $LEADOCEAN_API_KEY" | jq

The run searches 10 people (10 records) and looks up 3 (3 records). That is about 13 records. A person returned counts one record, and a get_lead that finds nobody costs nothing.

Step 6: Read the first run and tighten it

Open drafts/ and check three things before you schedule anything. Did every fact in an email appear in a tool result? Did the agent stay under the cap? Did it skip people with a bad email_status?

Fix problems in the files, not in the chat. A wrong title match goes into CLAUDE.md as an exclude rule. A weak opener goes into the skill as a stricter instruction. The agent then behaves the same way tomorrow.

markdown
## Exclude (added after run 1)
- Titles containing "sales operations", "sales enablement" or "revenue operations".
- Companies with fewer than 51 staff even if the range says otherwise.

Step 7: Move from people to accounts

The recipe above starts from people. To start from companies, add one line to the skill and let the agent search accounts first. search_companies returns one record per company. The REST path for a known account is GET /v1/companies/{domain}/people, which stops at 10,000 rows.

bash
curl -s "https://api.leadocean.io/v1/companies/acme.com/people?limit=5" \
  -H "x-api-key: $LEADOCEAN_API_KEY" | jq '.meta'

Keep the same rule: count first, search small, look up only the few you will write to. A GTM agent that reads every record it can reach will spend your records quickly and write worse emails.

What you get

Step 3 gave real numbers. On 21 October 2026 the free MCP count tool returned the block below for the ICP in Step 2, trimmed.

json
{
  "total": 1649,
  "totalIsExact": true,
  "totalAll": 4141,
  "distinctCompanies": 1125,
  "defaults": "Counted only addresses worth sending to (emailStatus: verified or catch_all_valid or catch_all)",
  "facets": {
    "country": [{ "value": "US", "count": 1649 }],
    "industry": [{ "value": "Software Development", "count": 1649 }],
    "seniority": [{ "value": "vp", "count": 1649 }],
    "company_size": [{ "value": "51-200", "count": 1649 }]
  }
}

That is 1,649 VPs of Sales at 1,125 US software companies of 51 to 200 staff. The count covers mailable people only: verified, catch_all_valid or catch_all email. With no email condition the same filters match 4,141. Dropping the industry and size filters, the mailable VP Sales count across all US companies was 129,494 on the same day.

A search page has a different shape. This is the response shape from the API reference, with placeholder values.

json
{
  "data": [
    {
      "profile_data": { "...": "name, headline, location" },
      "contact_data": { "has_email": true, "email_status": "verified", "email_type": "work", "...": "current role and company" },
      "meta": {}
    }
  ],
  "meta": { "count": 10, "limit": 10, "total": null, "nextCursor": "<opaque cursor>" }
}

The agent's own output is a file of three drafts. Each has a name, title, company, one fact from the record and a short first email. Its quality depends on the instructions in Steps 2 and 4, so read the first run line by line.

The search call returns thin records: profile, role and contact flags, with no addresses. The full lookup on the top three is where the agent gets what it needs to write. Since 17 October 2026 it includes career history in resume_data: past roles, education and skills, each when we hold it. This is why the skill spends 10 records to find people and 3 more to read them in full.

Troubleshooting

ErrorCauseFix
401Missing, wrong or revoked key (REST steps)Re-copy the key from app.leadocean.io and export $LEADOCEAN_API_KEY again.
429Above the plan's rate limit: 5 requests a second on Free, 50 on Solo, 200 on AgencyWait the Retry-After seconds. A single agent run rarely gets near it.
402Free plan: the 1,000 records are spentCheck GET /v1/account. Free records do not reset, so move to Solo ($97 a month) or Agency ($497) to continue.
400, or a count of 0A filter value outside the catalogue, such as industry: "Software"Resolve the exact string with leadocean_list_enum_values or GET /v1/enums/<name>.
400 export_limit_rowsYou moved the same filters into an export above 50,000 rows (exports need a paid plan)Split the audience by country or headcount band and run several exports.

FAQ

Do I need Claude Code, or will Claude on the web work?

Claude Code is the runtime for this recipe because it reads CLAUDE.md and skills from a folder and can run unattended with claude -p. The same MCP URL works in other MCP clients. See how to build a Claude Code sales agent for the longer version.

How do I stop the agent overspending records?

Put the cap in CLAUDE.md, call the free count first, and pre-approve only the tools the run needs. Each person returned counts one record, so a search limit of 10 is a ceiling of 10 records.

Can the agent run on a schedule?

Yes. claude -p is a normal command, so cron or any job runner can call it. Keep the cap in CLAUDE.md and check GET /v1/account after the first few runs, so a loose filter shows up as spend early.

Does the agent send emails?

No. This build writes drafts to a file and sends nothing. Add a sending step only after you have read several runs. LeadOcean is a data source and sends nothing itself.

What does it cost to run daily?

A daily run of this size spends about 13 records, so the free 1,000 covers a few weeks of test runs. Paid plans have no credits and no per-record price. Solo is $97 a month for one person, and Agency is $497 a month for teams, each with a fair-use pace. See pricing.

Where do I go from here?

Read the Claude GTM masterclass for the wider build and how to build your Claude sales team for B2B GTM for the multi-agent version. More recipes live in the blog hub.

Give your GTM agent live B2B data today

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

Get your free API key →