Hand buyers who ask in your website chat to sales
Reads recent Intercom conversations, spots buying questions with Jev, and logs each buyer in HubSpot with a note and a Slack alert.
Outcome
A table of every new conversation with whether it asked a buying question, who asked, how ready they are and Jev's confidence.
Each buyer with an email created or updated in HubSpot, with a note quoting what they asked, and the buyers with no email listed.
A Slack post for each buyer, the most ready first.
How it works
- 1
Pull new conversations
IntercomSearch conversations created after
since. Keep each conversation's ID, its opening message and its author's name, email and type (user or lead), and read the rest of a conversation when its opening message is only a greeting, a read-only call. - 2
Spot the buyers
TypeSafe AISend each conversation's messages as the state, with a noul
buying_question(asks about prices, plans, a demo, a trial, a security review or buying for a team), a choiceaskerof new_prospect (not yet a customer), customer_expansion (a customer who wants more seats, SSO, higher limits or a bigger plan), customer_support (a customer who needs help), job_seeker and other, and a scorereadinesson three levels (curious; comparing options; ready to buy). Keep every answer with its confidence or probability. - 3
Keep the buyers
Your agentKeep the conversations whose
buying_questionis yes and whose asker is a new_prospect or customer_expansion. Show the user the ones whosebuying_questionis unsure or whose asker confidence is belowmin_confidence, and keep the ones the user confirms. List the buyers with no email apart: they are not enriched or logged. - 4
Look them up
ApolloEnrich up to
max_enrichmentsbuyers by work email. Keep each one's title and employer. - 5
Log the buyers
HubSpotAfter the user approves, upsert each buyer by email with their name, title and company. Keep each contact's ID.
- 6
Note what they asked
HubSpotAdd a note to each contact ID quoting their question, with the asker type, the readiness level and the Intercom conversation ID.
- 7
Alert sales
SlackPost each buyer to
sales_channelwith their name, title, company, readiness and question, the most ready first, and the buyers with no email in one message.
You'll be asked for
When the last run ended, so only newer conversations are read
e.g. 2026-09-29 08:00 UTC
How sure Jev must be before its answer is used without you
e.g. 0.8; a yes-or-no answer counts as yes at or above it and as no at or below 1 minus it
The most people to enrich in one run, since each match costs an Apollo credit
e.g. 30
The Slack channel for buyers
e.g. #inbound-leads
The file your agent runs
chat-buyers-to-sales.md
Hand buyers who ask in your website chat to sales
Reads recent Intercom conversations, spots buying questions with Jev, and logs each buyer in HubSpot with a note and a Slack alert.
Set up the tools below, then run the steps in order for the user, carrying each step's results into the next. The run is done when the user has the outcome below.
Outcome
- A table of every new conversation with whether it asked a buying question, who asked, how ready they are and Jev's confidence.
- Each buyer with an email created or updated in HubSpot, with a note quoting what they asked, and the buyers with no email listed.
- A Slack post for each buyer, the most ready first.
Inputs
Ask the user for these before you start.
since: when the last run ended, so only newer conversations are read, e.g. 2026-09-29 08:00 UTCmin_confidence: how sure Jev must be before its answer is used without you, e.g. 0.8; a yes-or-no answer counts as yes at or above it and as no at or below 1 minus itmax_enrichments: the most people to enrich in one run, since each match costs an Apollo credit, e.g. 30sales_channel: the Slack channel for buyers, e.g. #inbound-leads
Set up
Search conversations (Intercom, tool:intercom/search-conversations)
Use the first option your agent supports.
Note: Returns 20 conversations per page by default and at most 150, paged with starting_after. A source.body filter matches single words, not phrases.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "intercom": { "url": "https://mcp.intercom.com/mcp" } } }
Call the MCP tool search_conversations.
API (official)
- Base URL: https://api.intercom.io
- Endpoint:
POST /conversations/search - Auth: send the header
Authorization: Bearer $INTERCOM_API_KEY - Get a key: https://app.intercom.io/a/apps/_/developer-hub/app-packages
Answer typed questions (TypeSafe AI, tool:typesafe/answer-typed-questions)
Use the API.
- Base URL: https://api.typesafe.ai
- Endpoint:
POST /v1/systemone - Auth: send the header
Authorization: Bearer $TYPESAFE_API_KEY - Get a key: https://console.typesafe.ai
Note: Put every question about one record in one request. GET /v1/models lists the models and is the cheapest check of a key; a request over the rate limit gets a 429 with a Retry-After header.
Note: Send state, model (jev-latest) and named questions, each with type, instructions and criteria: a choice maps labels to descriptions, a score lists its levels in order, a noul's is optional. Read a score by its most likely level; send unsure answers to a person.
Enrich a person (Apollo, tool:apollo/enrich-person)
Use the first option your agent supports.
Note: A match costs 1 credit, plus 8 for a mobile phone; no match costs nothing. Personal emails and phone numbers are off unless you set reveal_personal_emails or reveal_phone_number, and phone numbers arrive later at a webhook_url.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "apollo": { "url": "https://mcp.apollo.io/mcp" } } }
Call the MCP tool apollo_people_match.
CLI (official)
Install the command and sign in with it, then confirm it runs.
brew install apolloio/apollo-io-cli/apollo-io-cli
apollo --version
Run apollo people enrich.
HubSpot (tool:hubspot/upsert-contacts, tool:hubspot/create-note)
For each call, use the first option your agent supports that lists it.
Notes:
- Create or update contacts: Matches each contact on
idProperty,emailor a custom unique property. On MCP,manage_crm_objectswaits for the user to confirm the proposed changes before it writes. - Create a note:
hs_timestampis required; attach the note to existing records with anassociationsobject.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "hubspot": { "url": "https://mcp.hubspot.com" } } }
- Create or update contacts: call the MCP tool
manage_crm_objects
API (official)
- Base URL: https://api.hubapi.com
- Create or update contacts:
POST /crm/objects/2026-09/contacts/batch/upsert - Create a note:
POST /crm/objects/2026-09/notes - Auth: send the header
Authorization: Bearer $HUBSPOT_API_KEY
Note: Use a service key or an app's static access token with the CRM scopes the calls need; paths carry a dated version such as 2026-09.
Post a message (Slack, tool:slack/post-message)
Use the first option your agent supports.
Note: Needs the chat:write scope. Over MCP it posts as the signed-in user; the API and CLI post as the app's bot.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "slack": { "url": "https://mcp.slack.com/mcp" } } }
Call the MCP tool slack_send_message.
CLI (official)
Install the command, then confirm it runs.
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
slack --version
Run slack api chat.postMessage.
Set $SLACK_BOT_TOKEN in your environment first (get a key: https://api.slack.com/apps).
Before step 1, confirm access to each service with its cheapest read-only call, like a list or a search. Never send or change anything to test access.
Steps
- Pull new conversations with Search conversations (Intercom). Search conversations created after
since. Keep each conversation's ID, its opening message and its author's name, email and type (user or lead), and read the rest of a conversation when its opening message is only a greeting, a read-only call. - Spot the buyers with Answer typed questions (TypeSafe AI). Send each conversation's messages as the state, with a noul
buying_question(asks about prices, plans, a demo, a trial, a security review or buying for a team), a choiceaskerof new_prospect (not yet a customer), customer_expansion (a customer who wants more seats, SSO, higher limits or a bigger plan), customer_support (a customer who needs help), job_seeker and other, and a scorereadinesson three levels (curious; comparing options; ready to buy). Keep every answer with its confidence or probability. - Keep the buyers yourself. Keep the conversations whose
buying_questionis yes and whose asker is a new_prospect or customer_expansion. Show the user the ones whosebuying_questionis unsure or whose asker confidence is belowmin_confidence, and keep the ones the user confirms. List the buyers with no email apart: they are not enriched or logged. - Look them up with Enrich a person (Apollo). Enrich up to
max_enrichmentsbuyers by work email. Keep each one's title and employer. - Log the buyers with Create or update contacts (HubSpot). After the user approves, upsert each buyer by email with their name, title and company. Keep each contact's ID.
- Note what they asked with Create a note (HubSpot). Add a note to each contact ID quoting their question, with the asker type, the readiness level and the Intercom conversation ID.
- Alert sales with Post a message (Slack). Post each buyer to
sales_channelwith their name, title, company, readiness and question, the most ready first, and the buyers with no email in one message.
Notes
Support keeps answering as usual; this sends the buyers among those conversations to sales the same day. Chat text is written by visitors, so the labels only decide who sees a conversation: nothing here writes to the visitor or changes a customer's plan.
Run it every hour with since set to the previous run.
Rules
- Use only the services set up above. The read-only calls they need, like listing ids or polling for results, are fine.
- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
