Tell sales when an account's usage passes your threshold
Finds accounts over your weekly-active-user threshold in Amplitude, marks and notes them in Attio, and posts each one to Slack for sales.
Outcome
Every account over your usage threshold marked expansion-ready in Attio, with a note on the metric and the week.
A Slack post for sales about each of those accounts.
The domains that have no Attio record.
How it works
AFind accounts over the line, by Query product analytics by Amplitude
In
amplitude_project_id, query weekly active users grouped byaccount_property, for each full week in the lastlookback_days. Keep each domain with a week at or aboveusage_threshold, with the number and the week.
AFind their records, by List records by Attio
For each domain, find the company record. Keep its record ID and name; note the domains with no record.
AMark them, by Update a record by Attio
Set
ready_attributeto true on each record ID.
ANote the reason, by Create a note by Attio
Add a note to each record with the weekly active users and the week.
STell sales, by Post a message by Slack
Post one message per account to
sales_channelwith its name, the metric and the week.
You'll be asked for
The Amplitude project to query
The Amplitude user property that holds each account's domain
e.g. company_domain
The weekly active users that signal a bigger team
e.g. 25
The window to check, in full weeks
e.g. 14
The Attio company checkbox, set up once, that marks expansion-ready accounts
e.g. expansion_ready
The Slack channel to post in
e.g. #expansion
product-qualified-expansion.mdView markdown
Tell sales when an account's usage passes your threshold
Finds accounts over your weekly-active-user threshold in Amplitude, marks and notes them in Attio, and posts each one to Slack for sales.
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
- Every account over your usage threshold marked expansion-ready in Attio, with a note on the metric and the week.
- A Slack post for sales about each of those accounts.
- The domains that have no Attio record.
Inputs
Ask the user for these before you start.
amplitude_project_id: the Amplitude project to queryaccount_property: the Amplitude user property that holds each account's domain, e.g. company_domainusage_threshold: the weekly active users that signal a bigger team, e.g. 25lookback_days: the window to check, in full weeks, e.g. 14ready_attribute: the Attio company checkbox, set up once, that marks expansion-ready accounts, e.g. expansion_readysales_channel: the Slack channel to post in, e.g. #expansion
Set up
Query product analytics (Amplitude, tool:amplitude/query-analytics)
Use the MCP server. Add it to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "amplitude": { "url": "https://mcp.amplitude.com/mcp" } } }
Call the MCP tool query_amplitude_data.
Note: Call get_amplitude_context with the project id first, so the query uses the project's time zone and metric definitions.
Attio (tool:attio/list-records, tool:attio/update-record, tool:attio/create-note)
Use the first option your agent supports.
Notes:
- Create a note: Needs the record's object as
parent_object, such aspeople, and itsparent_record_id. The title is plain text only.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "attio": { "url": "https://mcp.attio.com/mcp" } } }
- List records: call the MCP tool
list-records - Update a record: call the MCP tool
update-record - Create a note: call the MCP tool
create-note
API (official)
- Base URL: https://api.attio.com
- List records:
POST /v2/objects/{object}/records/query - Update a record:
PATCH /v2/objects/{object}/records/{record_id} - Create a note:
POST /v2/notes - Auth: send the header
Authorization: Bearer $ATTIO_API_KEY - Get a key: https://attio.com/help/reference/apps/generating-an-api-key
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
- Find accounts over the line with Query product analytics (Amplitude). In
amplitude_project_id, query weekly active users grouped byaccount_property, for each full week in the lastlookback_days. Keep each domain with a week at or aboveusage_threshold, with the number and the week. - Find their records with List records (Attio). For each domain, find the company record. Keep its record ID and name; note the domains with no record.
- Mark them with Update a record (Attio). Set
ready_attributeto true on each record ID. - Note the reason with Create a note (Attio). Add a note to each record with the weekly active users and the week.
- Tell sales with Post a message (Slack). Post one message per account to
sales_channelwith its name, the metric and the week.
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.
