Invite NPS promoters with specific praise to a case study
Pulls 9s and 10s from your Typeform NPS survey, picks promoters whose praise names a result with Jev, and emails each a case-study invite.
Outcome
A table of every recent promoter with whether their praise is specific, whether they also named a problem, and Jev's probabilities.
An approved case-study invite sent to each promoter with specific praise and no open problem.
The promoters who also named a problem, listed for customer success instead.
How it works
- 1
Pull promoters
TypeformRead the responses to
surveyfrom the lastlookback_days. Keep those with ascore_fieldof 9 or 10, with the email fromemail_field, the score and thecomment_fieldanswer. - 2
Read their praise
TypeSafe AISend each comment as the state, with a noul
specific_praise(names a feature, a result or a number), a noulnames_a_problem(also mentions something that went wrong) and a scoreenthusiasmon three levels (satisfied; happy; delighted). Keep each answer. - 3
Pick who to invite
Your agentKeep the promoters whose
specific_praiseis yes and whosenames_a_problemis no, leaving out anyone indo_not_contact, by most likely enthusiasm level. Show the user the ones where either answer is unsure, and keep what the user decides. List the promoters who named a problem for customer success. - 4
Write the invites
Your agentDraft a subject line and three sentences per promoter: thank them, quote the part of their comment that names what they liked, and invite them to a 20-minute interview for a customer story at
interview_link. Show the drafts to the user. - 5
Send
ResendAfter the user approves, send each invite from
from_address, with an idempotency key per promoter.
You'll be asked for
The Typeform NPS survey, by name
e.g. Quarterly NPS
The ref of its 0 to 10 question
e.g. nps_score
The ref of its open question
e.g. nps_reason
The ref of the email question, or the name of the hidden field that carries the email
e.g. email
How far back to read responses
e.g. 14
The booking link for a 20-minute customer-story interview
e.g. https://cal.com/you/customer-story
The email addresses that asked not to be contacted
e.g. an export of your unsubscribes
The verified Resend sender the invites come from
e.g. Sam at Acme <sam@acme.com>
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 file your agent runs
promoter-case-studies.md
Invite NPS promoters with specific praise to a case study
Pulls 9s and 10s from your Typeform NPS survey, picks promoters whose praise names a result with Jev, and emails each a case-study invite.
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 recent promoter with whether their praise is specific, whether they also named a problem, and Jev's probabilities.
- An approved case-study invite sent to each promoter with specific praise and no open problem.
- The promoters who also named a problem, listed for customer success instead.
Inputs
Ask the user for these before you start.
survey: the Typeform NPS survey, by name, e.g. Quarterly NPSscore_field: the ref of its 0 to 10 question, e.g. nps_scorecomment_field: the ref of its open question, e.g. nps_reasonemail_field: the ref of the email question, or the name of the hidden field that carries the email, e.g. emaillookback_days: how far back to read responses, e.g. 14interview_link: the booking link for a 20-minute customer-story interview, e.g. https://cal.com/you/customer-storydo_not_contact: the email addresses that asked not to be contacted, e.g. an export of your unsubscribesfrom_address: the verified Resend sender the invites come from, e.g. Sam at Acme sam@acme.commin_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 it
Set up
Retrieve responses (Typeform, tool:typeform/retrieve-responses)
Use the API.
- Base URL: https://api.typeform.com
- Endpoint:
GET /forms/{form_id}/responses - Auth: send the header
Authorization: Bearer $TYPEFORM_API_KEY - Get a key: https://admin.typeform.com/user/tokens
Note: Forms with more than 1,000 responses need narrower since and until ranges or the before and after cursors. Responses from the last 30 minutes or so may be missing: use a webhook for real-time leads.
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.
Send an email (Resend, tool:resend/send-email)
Use the first option your agent supports.
Note: Pass an Idempotency-Key header (--idempotency-key on the CLI) so a retry never sends it twice; keys expire after 24 hours.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "resend": { "url": "https://mcp.resend.com/mcp" } } }
Call the MCP tool send-email.
CLI (official)
Install the command, then confirm it runs.
npm install -g resend-cli
resend --version
Run resend emails send.
Set $RESEND_API_KEY in your environment first (get a key: https://resend.com/api-keys).
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 promoters with Retrieve responses (Typeform). Read the responses to
surveyfrom the lastlookback_days. Keep those with ascore_fieldof 9 or 10, with the email fromemail_field, the score and thecomment_fieldanswer. - Read their praise with Answer typed questions (TypeSafe AI). Send each comment as the state, with a noul
specific_praise(names a feature, a result or a number), a noulnames_a_problem(also mentions something that went wrong) and a scoreenthusiasmon three levels (satisfied; happy; delighted). Keep each answer. - Pick who to invite yourself. Keep the promoters whose
specific_praiseis yes and whosenames_a_problemis no, leaving out anyone indo_not_contact, by most likely enthusiasm level. Show the user the ones where either answer is unsure, and keep what the user decides. List the promoters who named a problem for customer success. - Write the invites yourself. Draft a subject line and three sentences per promoter: thank them, quote the part of their comment that names what they liked, and invite them to a 20-minute interview for a customer story at
interview_link. Show the drafts to the user. - Send with Send an email (Resend). After the user approves, send each invite from
from_address, with an idempotency key per promoter.
Notes
A promoter who wrote "the Salesforce sync saved us a day a week" has already named a result; the interview adds the detail and their approval to publish it. Show them the final text before it goes live, and if you thank them with anything of value, say so in the story.
It invites promoters to a case study rather than a public review, because many review sites, Google among them, forbid asking only happy customers for reviews. To grow reviews, ask every respondent. Run it after each survey wave.
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.
