Flag churn risk and competitor talk in customer calls
Reads recent Gong call transcripts, scores churn risk and flags competitor and pricing talk with Jev, and posts the risky calls to Slack.
Outcome
A table of the calls recorded since the last run, with each one's type, churn-risk level, flags and Jev's confidence.
A Slack post for each customer call at or above your risk level, with what was said and a drafted next step.
How it works
- 1
Pull the transcripts
Gong
Get the transcripts of calls recorded from
sinceto now. Keep each call's ID and its transcript as speaker turns, and look up each call's title and which speakers are from your company, a read-only call, so every turn is marked rep or customer. - 2
Read each call
TypeSafe AISend each transcript as the state, with a choice
call_typeof renewal_or_check_in, onboarding, support, new_business and internal, a scorechurn_riskon four levels (no risk; frustrated; weighing a downgrade or another tool; says they will leave), a noulcompetitor_mentioned, a noulpricing_pushbackand a noulnext_step_agreed. Keep every answer with its confidence or probability. - 3
Check the unsure ones with the user
Your agentBefore filtering, show the user every renewal, check-in, onboarding or support call whose
call_typeorchurn_riskconfidence is belowmin_confidence, and keep what the user decides. Keep the renewal_or_check_in, onboarding and support calls whose most likelychurn_risklevel isrisk_levelor higher. - 4
Write the next steps
Your agentFor each risky call, draft two lines: the concern in the customer's own words, and one next step. Show them to the user.
- 5
Alert customer success
SlackPost each risky call to
cs_channelwith its title and call ID, the churn-risk level, whether a competitor or pricing pushback came up and a next step was agreed, and the two drafted lines.
You'll be asked for
When the last run started, so only newer calls are read
e.g. 2026-09-22T09:00:00Z
The lowest churn-risk level that counts as at risk
e.g. weighing a downgrade or another tool
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 Slack channel customer success watches
e.g. #renewals
The file your agent runs
customer-call-risk.md
Flag churn risk and competitor talk in customer calls
Reads recent Gong call transcripts, scores churn risk and flags competitor and pricing talk with Jev, and posts the risky calls to Slack.
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 the calls recorded since the last run, with each one's type, churn-risk level, flags and Jev's confidence.
- A Slack post for each customer call at or above your risk level, with what was said and a drafted next step.
Inputs
Ask the user for these before you start.
since: when the last run started, so only newer calls are read, e.g. 2026-09-22T09:00:00Zrisk_level: the lowest churn-risk level that counts as at risk, e.g. weighing a downgrade or another toolmin_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 itcs_channel: the Slack channel customer success watches, e.g. #renewals
Set up
Get call transcripts (Gong, tool:gong/get-call-transcripts)
Use the API.
- Base URL: https://{company}.api.gong.io
- Endpoint:
POST /v2/calls/transcript - Auth: send the header
Authorization: Basic $GONG_API_KEY - Get a key: https://app.gong.io/company/api
Note: {company} is your API host prefix from Gong's API settings, as in company-17.api.gong.io. GONG_API_KEY holds the base64 of <access key>:<secret>; 3 calls a second, 10,000 a day.
Note: When more records remain, repeat the request with the returned cursor. OAuth apps need the api:calls:read:transcript scope.
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.
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 the transcripts with Get call transcripts (Gong). Get the transcripts of calls recorded from
sinceto now. Keep each call's ID and its transcript as speaker turns, and look up each call's title and which speakers are from your company, a read-only call, so every turn is marked rep or customer. - Read each call with Answer typed questions (TypeSafe AI). Send each transcript as the state, with a choice
call_typeof renewal_or_check_in, onboarding, support, new_business and internal, a scorechurn_riskon four levels (no risk; frustrated; weighing a downgrade or another tool; says they will leave), a noulcompetitor_mentioned, a noulpricing_pushbackand a noulnext_step_agreed. Keep every answer with its confidence or probability. - Check the unsure ones with the user yourself. Before filtering, show the user every renewal, check-in, onboarding or support call whose
call_typeorchurn_riskconfidence is belowmin_confidence, and keep what the user decides. Keep the renewal_or_check_in, onboarding and support calls whose most likelychurn_risklevel isrisk_levelor higher. - Write the next steps yourself. For each risky call, draft two lines: the concern in the customer's own words, and one next step. Show them to the user.
- Alert customer success with Post a message (Slack). Post each risky call to
cs_channelwith its title and call ID, the churn-risk level, whether a competitor or pricing pushback came up and a next step was agreed, and the two drafted lines.
Notes
Gong's trackers flag topics across calls; this adds a churn-risk level with a confidence, which separates "we're looking at a few options" from "we're renewing, just checking prices". Look first at calls with a competitor in them and no agreed next step.
Run it weekly with since set to the time the previous run started.
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.
