MCP server
Deal tools
Deals and their stages.
| Tool | Who | Level | Confirms | What it does |
|---|---|---|---|---|
list_deals | Admins, reps and clients | read | no | Lists deals with the lead, campaign, stage, owner, value and days since the stage last changed, oldest stage change first. |
create_deal | Admins and reps | write | no | Opens a deal on a lead in a campaign's pipeline, owned by the caller, so it shows on the deals board. |
move_deal | Admins and reps | write | no | Moves a deal to another stage of its campaign's pipeline, including Won or Lost. |
edit_deal_stages | Admins | write | no | Adds, renames, moves or removes a stage in a campaign's deal pipeline. |
do_not_email_list | Admins and reps | read | no | Every lead in the workspace that must not be cold emailed, a page at a time, for an outside script to check before it sends: signed clients (a deal in a won stage, Pending Onboarding or Contracted, or the lead's own stage Won), leads marked do not contact, leads with a phone on the do not call list, and every address on the do not email list, also those that belong to no lead. |
Conventions for every tool are on the overview. The order to call them in is on workflows.
Tools
list_deals
Who: Admins, reps and clients. Level: read. Confirms: no.
Lists deals with the lead, campaign, stage, owner, value and days since the stage last changed, oldest stage change first. By default only open deals. Filter by campaign, stage, owner, or deals stuck for at least N days.
| Argument | Type | Required | Accepts, default and limits |
|---|---|---|---|
campaign | string | no | Campaign name or id. |
stage | string | no | Stage key or stage name, ignoring case, e.g. "interested" or "Interested". Applied after the limit, see notes. |
owner | string | no | Rep name (partial), email, id, or "me". Matches deals.owner_agent_id. |
stale_days | number | no | A number of days. Only used when above 0. Not rounded. Only deals whose stage_changed_at is older than now minus that many days. |
include_closed | boolean | no | True or false. Default: false. Without it, deals in closed_won and closed_lost are left out. |
limit | number | no | A number. Default: 50. Clamped to 1 to 100. |
Returns: data is an array: id, lead {id, name, phone}, campaign (name), stage (key), stage_name (the campaign's own name for it), owner (full name or null), value_cents, days_in_stage, created_at, closed_at, close_reason.
Changes: None, read only
Good to know:
- The stage filter runs on the rows already fetched (up to limit, oldest stage change first). With many deals, matching deals beyond the limit are missed; raise limit to 100 or add campaign to narrow it.
- A stage that matches nothing returns an empty list, not an error.
- value_cents is in cents; 250000 is $2,500. It can be null when no value was set.
- Closed stage keys are closed_won and closed_lost.
| When | Message | What to do |
|---|---|---|
| campaign matches nothing | No campaign "<ref>" in this workspace. | Call list_campaigns and use an exact name or id. |
| a partial campaign name matches more than one | "<ref>" matches several campaigns: <names>. Use the exact name or id. | Use the exact name or the id. |
| the person matches nobody | Nobody called "<ref>" in this workspace. | Call list_team (admins and reps) and use an email or id. |
| a name matches several people | "<ref>" matches several people: <names>. Be more specific. | Use the email or id. |
Example call:
{
"name": "list_deals",
"arguments": {
"stale_days": 14,
"owner": "me"
}
}
Example result:
[
{
"id": "d3a1-0000-4000-8000-000000000042",
"lead": {
"id": "9a8b7c6d-0000-4111-8222-333344445555",
"name": "Lone Star Roofing",
"phone": "+12145550123"
},
"campaign": "Dallas roofers Q4",
"stage": "quote_sent",
"stage_name": "Quote sent",
"owner": "Sara Khan",
"value_cents": 250000,
"days_in_stage": 17,
"created_at": "2026-11-10T15:00:00Z",
"closed_at": null,
"close_reason": null
}
]
create_deal
Who: Admins and reps. Level: write. Confirms: no.
Opens a deal on a lead in a campaign's pipeline, owned by the caller, so it shows on the deals board. A lead has at most one open deal: if one exists on any campaign, it is reported back and no second deal is made. It starts in the campaign's first working stage unless another working stage is named.
| Argument | Type | Required | Accepts, default and limits |
|---|---|---|---|
lead | string | yes | Lead id, phone number, exact name, or a part of the name that matches only one lead. Looked up with findLead: an id first, then a phone (normalised to +digits), then an exact name ignoring case, then a unique partial name. |
campaign | string | no | Campaign name or id. Optional only when the lead has exactly one live enrollment (queued, in_progress or paused) on an active campaign. |
stage | string | no | A working stage, by key (exact) or name (ignoring case). Default: The campaign's first open stage, or interested if it has none.. A Won or Lost stage is refused; open the deal then use move_deal. |
value | number | no | Dollars, e.g. 2500. Rounded to cents. Wins over value_cents when both are sent. |
value_cents | number | no | Cents, e.g. 250000 for $2,500. A negative or non numeric value is saved as null (unknown). |
Returns: data.done is the one line message of what happened, data.can_undo says if an undo was stored. When it was, the server adds data.action_id and data.undo_with: "undo_action". When the lead already has an open deal, data.done is "Already has an open deal at <stage>[ on <campaign>] (deal <id>)." and can_undo is false.
Changes: Inserts one deal (owner and creator are the caller). Sends nothing.
Undo: Yes, for a new deal: undo_action deletes it, but only while it is still in the stage it started in, not closed, and not linked to a call.
Good to know:
- The existing open deal check happens after the stage is checked, so a bad stage errors even when an open deal exists.
- When an open deal exists the call does not fail; read data.done for the deal id and use move_deal.
- With no value the deal value stays null (unknown), not $0.
| When | Message | What to do |
|---|---|---|
| no lead matches | No lead "<ref>" in this workspace. | Find it with search_leads and pass its id. |
| a name matches more than one lead | "<ref>" matches several leads: <name (id); ...>. Use the id. | Pass one of the listed ids. |
| an id is given that is not in this workspace | No lead with id <id> in this workspace. | Check the id with search_leads. |
| campaign matches nothing | No campaign "<ref>" in this workspace. | Call list_campaigns and use an exact name or id. |
| a partial campaign name matches more than one | "<ref>" matches several campaigns: <names>. Use the exact name or id. | Use the exact name or the id. |
| the lead was deleted between lookup and action | That account no longer exists | Look the lead up again. |
| no campaign given and the lead has no live enrollment on an active campaign | <lead> is not in a live campaign. Name the campaign (list_campaigns shows them). | Pass campaign. |
| no campaign given and the lead is live on several | <lead> is in several live campaigns: <names>. Name one. | Pass campaign. |
| the stage is not in the campaign's pipeline | "<stage>" is not a stage in this campaign's pipeline. Open stages: <names> | Use a name from get_campaign pipeline. |
| the stage is Won or Lost | "<name>" is a closed stage. Open the deal in a working stage, then move it there. | Open in a working stage, then call move_deal. |
Example call:
{
"name": "create_deal",
"arguments": {
"lead": "Lone Star Roofing",
"campaign": "Dallas roofers Q4",
"stage": "Quote sent",
"value": 2500
}
}
Example result:
{
"done": "Opened a deal at Quote sent.",
"can_undo": true,
"action_id": "a1b2c3d4-0000-4000-8000-000000000018",
"undo_with": "undo_action"
}
move_deal
Who: Admins and reps. Level: write. Confirms: no.
Moves a deal to another stage of its campaign's pipeline, including Won or Lost. Use the stage key or name from get_campaign.
| Argument | Type | Required | Accepts, default and limits |
|---|---|---|---|
deal_id | string | yes | A deal id from list_deals or get_lead. |
stage | string | yes | Stage key (exact) or name (ignoring case). |
Returns: data.done is the one line message of what happened, data.can_undo says if an undo was stored. When it was, the server adds data.action_id and data.undo_with: "undo_action".
Changes: Updates the deal's stage. Database triggers may stamp stage_changed_at and the close time. Sends nothing.
Undo: Yes, when it moved: undo_action puts the old stage back, only if the deal is still in the stage this call set. If it was already there the call returns "Already at <name>." with no undo.
Good to know:
- There is no close reason argument; a won or lost reason cannot be set here.
- Stage keys for closed stages are closed_won and closed_lost; their names can be renamed per campaign.
| When | Message | What to do |
|---|---|---|
| deal_id is unknown | That deal no longer exists | Take the id from list_deals. |
| the deal's lead is in another workspace | That account is in another workspace | Use a deal from this workspace. |
| the stage is not in that campaign's pipeline | "<stage>" is not a stage in this campaign's pipeline | Check stages with get_campaign. |
| stage or deal_id is empty | No stage named / No deal named | Pass both. |
Example call:
{
"name": "move_deal",
"arguments": {
"deal_id": "d3a1-0000-4000-8000-000000000042",
"stage": "Won"
}
}
Example result:
{
"done": "Moved the deal to Won.",
"can_undo": true,
"action_id": "a1b2c3d4-0000-4000-8000-000000000019",
"undo_with": "undo_action"
}
edit_deal_stages
Who: Admins. Level: write. Confirms: no.
Adds, renames, moves or removes a stage in a campaign's deal pipeline. Won and Lost are in every pipeline and can only be renamed. A stage with deals in it is only removed when move_deals_to says where its deals go. Admins only.
| Argument | Type | Required | Accepts, default and limits |
|---|---|---|---|
campaign | string | yes | Campaign name or id. |
action | string | yes | Add, rename, move or remove. Enum: add, rename, move, remove. |
stage | string | yes | Add: the new stage's name. rename, move, remove: the stage by key, name (ignoring case) or stage id. Add: 1 to 60 characters. |
new_name | string | no | Rename: the new name. 1 to 60 characters. Must not match another stage's key or name. |
before | string | no | Add or move: a stage key or name to go just before. Before Won or Lost means the end of the working stages. Do not send with after. |
after | string | no | Add or move: a stage key or name to go just after. After Won or Lost is refused. |
kind | string | no | Open only. Default: open. Enum: open. |
probability | number | no | Add or rename: chance of winning at this stage. 0 to 100, rounded. Ignored for move and remove. |
move_deals_to | string | no | Remove: the stage key or name to move this stage's deals to. Required only when the stage has deals. Can be any other stage, Won or Lost included. |
Returns: add: data.added {key, name} and data.stages [{key, name, kind, position}] in the new order. rename: data {key, old_name, name}. move: data.stages in the new order. remove: data {removed (the key), deals_moved}.
Changes: Changes the campaign_deal_stages rows: inserts, renames, renumbers working stage positions to 10, 20, 30 in order, or deletes. remove with move_deals_to also moves every deal in that stage. Sends nothing.
Good to know:
- The new stage's key is made by the database from the name; read it from data.added.key.
- Stage lookup matches the key against the lowercased input, so a key is matched in lower case.
- Rename changes only the name; deals keep the key, so nothing moves.
- Deals moved by remove are updated directly and get no undo.
| When | Message | What to do |
|---|---|---|
| campaign matches nothing | No campaign "<ref>" in this workspace. | Call list_campaigns and use an exact name or id. |
| a partial campaign name matches more than one | "<ref>" matches several campaigns: <names>. Use the exact name or id. | Use the exact name or the id. |
| the caller is not an admin | Only a workspace admin can do this. | Ask an admin. |
| a named stage does not exist | "<ref>" is not a stage on <campaign>. Its stages: <names>. | Use a name or key from the list. |
| add with an empty or long name | A stage name must be 1 to 60 characters. | Shorten the name. |
| add with kind other than open | Only working (open) stages can be added; Won and Lost are already in every pipeline. | Leave kind out. |
| add with a name already used | <campaign> already has a stage called "<name>". | Pick another name. |
| both before and after given | Give before or after, not both. | Send one. |
| after names Won or Lost | Won and Lost stay at the end of the pipeline, so nothing goes after "<name>". | Use before Won, or leave both out to place it last. |
| move a stage relative to itself | A stage cannot be placed relative to itself. | Name a different stage. |
| rename with an empty or long new_name | new_name must be 1 to 60 characters. | Send a valid new_name. |
| move or remove Won or Lost | "<name>" stays at the end of the pipeline; only working stages move. / Won and Lost are part of every pipeline. "<name>" can be renamed, not removed. | Only rename them. |
| move without before or after | Say where it goes: before or after another stage. | Send before or after. |
| remove the last working stage | A pipeline needs at least one working stage. | Add another stage first. |
| remove a stage that has deals without move_deals_to | "<name>" has <n> deal(s) in it, so it was not removed. Call again with move_deals_to set to the stage they should go to (<names>). | Call again with move_deals_to. |
| move_deals_to is the same stage | move_deals_to must be a different stage. | Name another stage. |
| probability outside 0 to 100 | probability must be 0 to 100. | Send 0 to 100. |
| an unknown action | action must be add, rename, move or remove. | Use one of those. |
Example call:
{
"name": "edit_deal_stages",
"arguments": {
"campaign": "Dallas roofers Q4",
"action": "add",
"stage": "Site visit",
"after": "Interested",
"probability": 40
}
}
Example result:
{
"added": {
"key": "site_visit",
"name": "Site visit"
},
"stages": [
{
"key": "interested",
"name": "Interested",
"kind": "open",
"position": 10
},
{
"key": "site_visit",
"name": "Site visit",
"kind": "open",
"position": 20
},
{
"key": "quote_sent",
"name": "Quote sent",
"kind": "open",
"position": 30
},
{
"key": "closed_won",
"name": "Won",
"kind": "won",
"position": 900
}
]
}
do_not_email_list
Who: Admins and reps. Level: read. Confirms: no.
Every lead in the workspace that must not be cold emailed, a page at a time, for an outside script to check before it sends: signed clients (a deal in a won stage, Pending Onboarding or Contracted, or the lead's own stage Won), leads marked do not contact, leads with a phone on the do not call list, and every address on the do not email list, also those that belong to no lead. With each: company, domain, every email and phone, and the reasons with since when.
| Argument | Type | Required | Accepts, default and limits |
|---|---|---|---|
stages | array of strings | no | Deal stage names or keys that mean a client, any case, for example ["Won", "Pending Onboarding", "Contracted"]. Default: won stages, Pending Onboarding, Contracted. Up to 50. Replaces the default list. "Won" (or "won") also covers every stage of kind won in any pipeline and the lead stage Won. Leaving out Won leaves out the lead stage Won too. Do not contact and do not email reasons are always included. |
limit | number | no | Rows a page. Default: 100. 1 to 500. |
offset | number | no | Where the page starts. Default: 0. Use next_offset from the previous page. |
Returns: total (every row, all pages), offset, rows, stages (what was matched), next_offset (only while more remain). Each row: company, company_id, domain (from the website, without www; null when there is none), emails (the company address and every contact address, lower case), phones (the company phone and every contact phone and mobile), archived, reasons (each {reason, since}), since (the earliest). Reasons read 'deal stage: <stage name>', 'lead stage: Won', 'do not contact', 'phone on the do not call list (<number>)' or 'email on the do not email list (<address>, <bounce|unsubscribe|invalid|...>)'. A do not email address that belongs to no lead is a row with company and company_id null, its domain and the address in emails. Rows run newest reason first.
Changes: None, read only.
Good to know:
- Deal stages belong to each campaign's pipeline: a deal matches by its stage key in its own campaign's stages (a deal with no campaign by the key alone), and the stage name or key is compared with any case.
- Do not contact means the lead was marked do not call (its status dnc) or one of its phones (company phone, contact phone or mobile) is on the workspace's do not call list.
- For a sender: refuse an address that is in any row's emails, and treat a row's domain as taken (a client's colleague shares it). Read every page with next_offset; with limit 500 a workspace of a few thousand rows is a handful of calls.
- Admins and reps; not shown to clients. A read level personal token is enough: see Workflows, Keep an outside sender off clients.
Example call:
{
"name": "do_not_email_list",
"arguments": {
"limit": 500
}
}
Example result:
{
"total": 2,
"offset": 0,
"rows": [
{
"company": "Peachtree Pain Clinic",
"company_id": "c1b2c3d4-0000-4000-8000-000000000041",
"domain": "peachtreepain.com",
"emails": [
"office@peachtreepain.com",
"dr.lee@peachtreepain.com"
],
"phones": [
"+14045550100"
],
"archived": false,
"reasons": [
{
"reason": "deal stage: Pending Onboarding",
"since": "2026-11-28T15:02:11+00:00"
}
],
"since": "2026-11-28T15:02:11+00:00"
},
{
"company": null,
"company_id": null,
"domain": "example-billing.com",
"emails": [
"ap@example-billing.com"
],
"phones": [],
"reasons": [
{
"reason": "email on the do not email list (unsubscribe)",
"since": "2026-11-20T09:00:00+00:00"
}
],
"since": "2026-11-20T09:00:00+00:00"
}
],
"stages": "won stages, Pending Onboarding, Contracted"
}