conduyt-mcp 4.110.0 → 4.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -237,6 +237,11 @@ Text it is `conduyt_send_sms` with `invoiceId` (and `resend`).
237
237
  | `conduyt_create_status_metadata` | Create a row (`stageId`, `code`, `bucket` slugs, `lifecycleStage`, drip fields, `isTerminal`, `notes`) |
238
238
  | `conduyt_update_status_metadata` | Update a row; `expectedUpdatedAt` refuses a row changed or moved since (409 `metadata_changed` with the current row); 404 `status_metadata_not_found` |
239
239
  | `conduyt_delete_status_metadata` | Delete a row (`expectedUpdatedAt` as above) |
240
+ | `conduyt_list_drip_tracks` / `conduyt_get_drip_track` | Read the drip tracks (the sequences status metadata names by `dripTrackId`) with their steps |
241
+ | `conduyt_create_drip_track` / `conduyt_update_drip_track` / `conduyt_delete_drip_track` | Manage a track (`name` slug, `label`, `channel`, `complianceProfile`, `steps`, `exitConditions`, `reEntryAllowed`, `isActive`); a delete clears the track from the status metadata rows that named it |
242
+ | `conduyt_list_booking_routing_forms` / `conduyt_get_booking_routing_form` / `conduyt_create_booking_routing_form` / `conduyt_update_booking_routing_form` / `conduyt_delete_booking_routing_form` | Booking routing forms (the questions a visitor answers before a booking page); reads need calendar:view, writes an owner / admin key; a passed `steps` list replaces the stored one |
243
+ | `conduyt_list_automation_folders` / `conduyt_create_automation_folder` / `conduyt_update_automation_folder` / `conduyt_delete_automation_folder` | Automation folders (name 1-80, `colorIndex` 0-5, 50 per account); a delete returns the folder's automations to Unfiled, never deletes them |
244
+ | `conduyt_import_drip_track_steps` | Replace the step list of up to 200 tracks by `trackName` (owner / admin key); read `errors[]` even on a 200 |
240
245
  | `conduyt_import_status_metadata` | Set-based import (max 1000; `merge` or `replace`); read `errors[]` even on a 200; 409 `pipeline_archived` when an item names a stage of an archived pipeline |
241
246
 
242
247
  ### Mailchimp (API key scope `integrations`)
@@ -395,6 +400,9 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
395
400
  |------|-------------|
396
401
  | `conduyt_dashboard` | Full CRM dashboard (pipeline, activities, metrics, follow-ups) |
397
402
 
403
+ ### Custom reports: calculated columns
404
+ `conduyt_create_report`, `conduyt_update_report` and `conduyt_preview_report` take `calculatedColumns` (contacts and deals reports): `[{ key, label, expression, format? }]`, at most 10, each a per-row number worked out at read, used as the field `calc:<key>` in `columns`, `sortBy`, `measureField`, pivot measures and `columnLabels` (never a filter or a group). The expression is the formula-field language, numeric subset: `+ - * /`, parentheses, numbers, `ROUND(x[, 0..10])`, `MIN`, `MAX`, `COALESCE`, `{value}` / `{callCount}` (built-in number fields), `{cf_<key>}` (number custom fields), `{calc_<key>}` (another calculated column, no cycles). The tools check the API's shape rules before sending (key `^[a-z][a-z0-9_]{0,39}$` and unique, label 1-120 characters after trimming, expression not blank and at most 500 characters, format `number` / `currency` / `percent` or null); the grammar, the fields and the base are the API's, refused with 422 `invalid_calculated_column` and its sentence, passed through verbatim. On update: omitted = unchanged, an array replaces the list, `null` or `[]` removes it. `conduyt_get_report` / `conduyt_list_reports` return `calculatedColumns`; `conduyt_run_report` rows carry each value under `calc:<key>`.
405
+
398
406
  ### AI Extended
399
407
  | Tool | Description |
400
408
  |------|-------------|
@@ -28,6 +28,9 @@ import { registerCalendlyTools } from "./tools/calendly.js";
28
28
  import { registerBoardSettingsTools } from "./tools/board-settings.js";
29
29
  import { registerMailchimpTools } from "./tools/mailchimp.js";
30
30
  import { registerStatusMetadataTools } from "./tools/status-metadata.js";
31
+ import { registerDripTrackTools } from "./tools/drip-tracks.js";
32
+ import { registerBookingRoutingFormTools } from "./tools/booking-routing-forms.js";
33
+ import { registerAutomationFolderTools } from "./tools/automation-folders.js";
31
34
  import { registerNotificationTools } from "./tools/notifications.js";
32
35
  import { registerChatTools } from "./tools/chat.js";
33
36
  import { registerAiTeammateConnectTools } from "./tools/ai-teammate-connect.js";
@@ -48,6 +51,10 @@ import { registerProductTools } from "./tools/products.js";
48
51
  import { registerTaxRateTools } from "./tools/tax-rates.js";
49
52
  import { registerTemplateTools } from "./tools/templates.js";
50
53
  import { registerDashboardTools } from "./tools/dashboard.js";
54
+ import { registerNoteTools } from "./tools/notes.js";
55
+ import { registerMemberGroupTools } from "./tools/member-groups.js";
56
+ import { registerQuickNoteTools } from "./tools/quick-notes.js";
57
+ import { registerQuickConnectTools } from "./tools/quick-connects.js";
51
58
  import { registerAiExtendedTools } from "./tools/ai-extended.js";
52
59
  import { registerWorkflowSandboxTools } from "./tools/workflow-sandbox.js";
53
60
  import { registerPrivacyTools } from "./tools/privacy.js";
@@ -100,6 +107,9 @@ export function registerAllTools(server, client) {
100
107
  registerBoardSettingsTools(server, client);
101
108
  registerMailchimpTools(server, client);
102
109
  registerStatusMetadataTools(server, client);
110
+ registerDripTrackTools(server, client);
111
+ registerBookingRoutingFormTools(server, client);
112
+ registerAutomationFolderTools(server, client);
103
113
  registerNotificationTools(server, client);
104
114
  registerChatTools(server, client);
105
115
  registerAiTeammateConnectTools(server, client);
@@ -120,6 +130,10 @@ export function registerAllTools(server, client) {
120
130
  registerTaxRateTools(server, client);
121
131
  registerTemplateTools(server, client);
122
132
  registerDashboardTools(server, client);
133
+ registerNoteTools(server, client);
134
+ registerMemberGroupTools(server, client);
135
+ registerQuickNoteTools(server, client);
136
+ registerQuickConnectTools(server, client);
123
137
  registerAiExtendedTools(server, client);
124
138
  registerWorkflowSandboxTools(server, client);
125
139
  registerPrivacyTools(server, client);
@@ -43,6 +43,7 @@ export const TOOL_ANNOTATIONS = {
43
43
  conduyt_delete_deal: destroy("Delete Deal"),
44
44
  conduyt_import_deals: create("Import Deals"),
45
45
  conduyt_add_deal_tags: update("Add Deal Tags"),
46
+ conduyt_remove_deal_tag: update("Remove Deal Tag"), // like conduyt_remove_contact_collaborator: a membership, re-added by conduyt_add_deal_tags; the tag and every other deal keep it; the end state is the same on a repeat (DELETE /deals/{id}/tags/{tagId})
46
47
  conduyt_list_deal_views: ro("List Deal Views"),
47
48
  conduyt_get_deal_view: ro("Get Deal View"),
48
49
  conduyt_create_deal_view: create("Create Deal View"),
@@ -74,6 +75,7 @@ export const TOOL_ANNOTATIONS = {
74
75
  conduyt_reorder_stages: update("Reorder Stages"),
75
76
  conduyt_delete_stage: destroy("Delete Stage"),
76
77
  conduyt_list_activities: ro("List Activities"),
78
+ conduyt_get_account_readiness: ro("Get Account Readiness"),
77
79
  conduyt_get_contact_timeline: ro("Get Contact Timeline"),
78
80
  conduyt_export_activities_csv: row("Export Activities to CSV File", false, true, false), // writes a LOCAL file, so not read-only; destructive because overwrite: true replaces an existing regular file (MCP: destructiveHint false is additive-only); a repeat writes a new export, so not idempotent
79
81
  conduyt_create_activity: create("Create Activity"),
@@ -83,6 +85,10 @@ export const TOOL_ANNOTATIONS = {
83
85
  conduyt_create_automation: create("Create Automation"),
84
86
  conduyt_update_automation: row("Update Automation", false, true, false), // webhook secret rotate/clear revokes the old credential; every config write bumps configRevision (automations/[id]/route.ts:248-275,726-739,1576-1579)
85
87
  conduyt_publish_automation: row("Publish Automation", false, false, false), // each repeat can publish another numbered version (automations/[id]/publish/route.ts:218,291)
88
+ conduyt_recover_automation_execution: row("Recover Automation Execution", false, true, false), // skip rewrites the failed step as skipped for good and retry / resume can re-run an action (POST /automation-executions/{id}/recover); a repeat can duplicate a send
89
+ conduyt_list_automation_step_logs: ro("List Automation Step Logs"),
90
+ conduyt_test_automation_node: ro("Test Automation Node"), // POST only to carry the body: a pure simulation (app/api/v1/automations/[id]/test-node/route.ts has no write and no send), rate-limited 30/min
91
+ conduyt_get_automation_failures_drilldown: ro("Get Automation Failures Drilldown"),
86
92
  conduyt_cancel_automation_run: destroy("Cancel Automation Run"), // tears down ONE run's waiting steps for good (a cancelled run never resumes); a repeat answers 200 changed false (POST /automation-executions/{id}/cancel)
87
93
  conduyt_resolve_names: ro("Resolve Names to IDs"),
88
94
  conduyt_list_sequences: ro("List Sequences"),
@@ -124,6 +130,7 @@ export const TOOL_ANNOTATIONS = {
124
130
  conduyt_search_dialer_history: ro("Search Dialer History"),
125
131
  conduyt_search_dialer_calls: ro("Search Dialer Calls"),
126
132
  conduyt_count_unknown_callers: ro("Count Unknown Callers"),
133
+ conduyt_list_lead_rings: ro("List Lead Rings"),
127
134
  conduyt_link_call: update("Link Call"),
128
135
  conduyt_get_call: ro("Get Call"),
129
136
  conduyt_get_post_call_insight: ro("Get Post Call Insight"),
@@ -158,6 +165,23 @@ export const TOOL_ANNOTATIONS = {
158
165
  conduyt_list_company_related: ro("List Company Related Records"),
159
166
  conduyt_create_company: create("Create Company"),
160
167
  conduyt_update_company: row("Update Company", false, false, false), // every identical PATCH creates a new company_updated Activity and re-dispatches the update fan-out (companies/[id]/route.ts:362-375)
168
+ conduyt_list_notes: ro("List Notes"),
169
+ conduyt_get_note: ro("Get Note"),
170
+ conduyt_create_note: create("Create Note"), // fires note.created (event, webhooks, automations) and adds a note on every call (POST /notes)
171
+ conduyt_update_note: row("Update Note", false, true, false), // a new body REPLACES the text for good (only the first 200 characters survive on the timeline entry); every successful call, a repeat included, moves updatedAt and writes a best-effort audit row
172
+ conduyt_delete_note: destroy("Delete Note"), // gone from every read, no API restore; a repeat answers 404
173
+ conduyt_list_quick_notes: ro("List Quick Notes"),
174
+ conduyt_create_quick_note: create("Create Quick Note"), // every call adds a note (cap 500)
175
+ conduyt_update_quick_note: row("Update Quick Note", false, true, false), // a new body replaces the text for good; repeating pinned / done resets pinnedAt / doneAt and every call changes updatedAt; the write commits before the read-back, so a 500 can follow it
176
+ conduyt_delete_quick_note: destroy("Delete Quick Note"), // the note and its reminder notifications; a repeat answers 404
177
+ conduyt_list_quick_connects: ro("List Quick Connects"),
178
+ conduyt_create_quick_connect: create("Create Quick Connect"), // a repeat of the same number is refused 409
179
+ conduyt_update_quick_connect: row("Update Quick Connect", false, true, false), // replaces the name and phone for good (the audit entry keeps only redacted metadata) and every call, repeats included, writes another audit row
180
+ conduyt_delete_quick_connect: destroy("Delete Quick Connect"), // gone for good (audited); a repeat answers 404
181
+ conduyt_list_member_groups: ro("List Member Groups"),
182
+ conduyt_create_member_group: create("Create Member Group"), // a repeat of the same name is refused 409
183
+ conduyt_update_member_group: row("Update Member Group", false, false, false), // every successful call, a repeat included, moves updatedAt and writes a best-effort audit row
184
+ conduyt_delete_member_group: destroy("Delete Member Group"), // refused 409 while a booking page, routing rule, workflow or Smart View points at it; members are only un-grouped
161
185
  conduyt_list_tags: ro("List Tags"),
162
186
  conduyt_create_tag: create("Create Tag"),
163
187
  conduyt_update_tag: update("Update Tag"),
@@ -210,6 +234,11 @@ export const TOOL_ANNOTATIONS = {
210
234
  conduyt_create_webhook: create("Create Webhook"),
211
235
  conduyt_update_webhook: update("Update Webhook"),
212
236
  conduyt_delete_webhook: destroy("Delete Webhook"),
237
+ conduyt_get_webhook: ro("Get Webhook"),
238
+ conduyt_test_webhook: create("Test Webhook"), // really sends a signed sample request to the receiver and writes a test delivery row every call (POST /webhooks/manage/{id}/test)
239
+ conduyt_list_webhook_deliveries: ro("List Webhook Deliveries"),
240
+ conduyt_list_webhook_replay: ro("List Webhook Replay Candidates"),
241
+ conduyt_replay_webhook_deliveries: create("Replay Webhook Deliveries"), // re-arms deliveries and the retry worker re-sends the STORED body: the receiver can get an event twice (POST /webhooks/replay)
213
242
  conduyt_cancel_webhook_log: destroy("Cancel Webhook Log"),
214
243
  conduyt_get_form_intake_status: ro("Get Form Intake Status"),
215
244
  conduyt_list_form_intakes: ro("List Form Intakes"),
@@ -244,6 +273,21 @@ export const TOOL_ANNOTATIONS = {
244
273
  conduyt_update_status_metadata: row("Update Status Metadata", false, false, false), // every successful write advances the concurrency version (status-metadata/[id]/route.ts:201)
245
274
  conduyt_delete_status_metadata: destroy("Delete Status Metadata"),
246
275
  conduyt_import_status_metadata: row("Import Status Metadata", false, true, false), // replace mode deletes and recreates rows with new ids; merge mode advances updatedAt (the concurrency version) on every call
276
+ conduyt_list_drip_tracks: ro("List Drip Tracks"),
277
+ conduyt_get_drip_track: ro("Get Drip Track"),
278
+ conduyt_create_drip_track: create("Create Drip Track"),
279
+ conduyt_update_drip_track: row("Update Drip Track", false, true, false), // a steps list REPLACES the stored one ({ steps: [] } erases every step) and every successful call appends an audit row
280
+ conduyt_delete_drip_track: destroy("Delete Drip Track"), // clears dripTrackId on the status metadata rows that named it
281
+ conduyt_import_drip_track_steps: row("Import Drip Track Steps", false, true, false), // replaces each named track's whole step list; every call appends a steps_imported audit row
282
+ conduyt_list_booking_routing_forms: ro("List Booking Routing Forms"),
283
+ conduyt_get_booking_routing_form: ro("Get Booking Routing Form"),
284
+ conduyt_create_booking_routing_form: create("Create Booking Routing Form"),
285
+ conduyt_update_booking_routing_form: row("Update Booking Routing Form", false, true, false), // a steps list REPLACES the stored questions ({ steps: [] } erases them) and every successful call appends an audit row
286
+ conduyt_delete_booking_routing_form: destroy("Delete Booking Routing Form"), // the form's public link stops working
287
+ conduyt_list_automation_folders: ro("List Automation Folders"),
288
+ conduyt_create_automation_folder: create("Create Automation Folder"),
289
+ conduyt_update_automation_folder: row("Update Automation Folder", false, false, false), // every successful call writes again and appends an audit row
290
+ conduyt_delete_automation_folder: destroy("Delete Automation Folder"), // never deletes an automation: they return to Unfiled
247
291
  conduyt_list_notifications: ro("List Notifications"),
248
292
  conduyt_create_notification: create("Create Notification"),
249
293
  conduyt_list_chat_channels: update("List Chat Channels"),
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /**
4
+ * Automation folders (app: /api/v1/automation-folders): the named, coloured folders the Automations list groups workflows in.
5
+ * Reads need automations:view, create automations:create, rename / recolor / delete automations:edit (a key restricted to
6
+ * some pipelines cannot write: 403). A folder holds no data of its own: deleting one never deletes an automation.
7
+ */
8
+ export declare const AUTOMATION_FOLDER_MAX_NAME = 80;
9
+ export declare const AUTOMATION_FOLDER_COLORS = 6;
10
+ export declare const AUTOMATION_FOLDER_MAX = 50;
11
+ export declare function registerAutomationFolderTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ import { strictInput } from "./strict.js";
4
+ /**
5
+ * Automation folders (app: /api/v1/automation-folders): the named, coloured folders the Automations list groups workflows in.
6
+ * Reads need automations:view, create automations:create, rename / recolor / delete automations:edit (a key restricted to
7
+ * some pipelines cannot write: 403). A folder holds no data of its own: deleting one never deletes an automation.
8
+ */
9
+ export const AUTOMATION_FOLDER_MAX_NAME = 80;
10
+ export const AUTOMATION_FOLDER_COLORS = 6;
11
+ export const AUTOMATION_FOLDER_MAX = 50;
12
+ const FOLDER_ERRORS = "Refusals are the server's: 400 for a name that is empty or over 80 characters, a colorIndex outside 0-5, nothing to update, or the 50-folder cap; 403 for a key restricted to some pipelines; 404 'Folder not found'.";
13
+ export function registerAutomationFolderTools(server, client) {
14
+ strictInput(server.tool("conduyt_list_automation_folders", "List the account's automation folders (GET /api/v1/automation-folders; automations:view), oldest first, each { id, name, colorIndex, automationCount, createdAt, updatedAt }. automationCount leaves out deleted automations.", {}, async () => formatResult(await client.get("/api/v1/automation-folders"))));
15
+ strictInput(server.tool("conduyt_create_automation_folder", "Create an automation folder (POST /api/v1/automation-folders; automations:create, active billing). name is 1-80 characters; colorIndex (integer 0-5) defaults to the next colour in turn. At most 50 folders per account. " + FOLDER_ERRORS, {
16
+ name: z.string().trim().min(1).max(AUTOMATION_FOLDER_MAX_NAME).describe("Folder name, 1-80 characters"),
17
+ colorIndex: z.number().int().min(0).max(AUTOMATION_FOLDER_COLORS - 1).optional().describe("Colour index 0-5"),
18
+ }, async ({ name, colorIndex }) => formatResult(await client.post("/api/v1/automation-folders", { name, colorIndex }))));
19
+ strictInput(server.tool("conduyt_update_automation_folder", "Rename and / or recolor an automation folder (PATCH /api/v1/automation-folders/{id}; automations:edit, active billing). Send name and / or colorIndex; neither is a 400. " + FOLDER_ERRORS, {
20
+ id: z.string().uuid().describe("Folder UUID"),
21
+ name: z.string().trim().min(1).max(AUTOMATION_FOLDER_MAX_NAME).optional().describe("New name, 1-80 characters"),
22
+ colorIndex: z.number().int().min(0).max(AUTOMATION_FOLDER_COLORS - 1).optional().describe("New colour index 0-5"),
23
+ }, async ({ id, name, colorIndex }) => formatResult(await client.patch(`/api/v1/automation-folders/${id}`, { name, colorIndex }))));
24
+ strictInput(server.tool("conduyt_delete_automation_folder", "Delete an automation folder (DELETE /api/v1/automation-folders/{id}; automations:edit, not gated by billing). The folder's automations are NEVER deleted: they return to Unfiled. Answers { id, deleted: true, automationsUnfiled }. " + FOLDER_ERRORS, {
25
+ id: z.string().uuid().describe("Folder UUID"),
26
+ }, async ({ id }) => formatResult(await client.del(`/api/v1/automation-folders/${id}`))));
27
+ }
@@ -1,4 +1,4 @@
1
- import { WEBHOOK_NAME_TAG_DOC } from "./user-fields-doc.js";
1
+ import { ANSWER_USERS_DOC, WEBHOOK_NAME_TAG_DOC } from "./user-fields-doc.js";
2
2
  import { z } from "zod";
3
3
  import { formatResult, formatToolError } from "../client.js";
4
4
  import { strictInput } from "./strict.js";
@@ -11,7 +11,7 @@ export const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {
11
11
  /** (parity64, app batonaudit64, live OpenAPI POST /automations/{id}/publish) publish judges a baton step's configured stages by the rule the run applies */
12
12
  export const BATON_STAGE_REFUSED_NOTE = " Publish checks a baton step's configured stages by the rule the run applies (app batonaudit64): a handoff_and_keep stageId that is a Won, Lost, holding or finished-work stage, or a handoff_and_keep or credit_baton_source parkedStageId that is a Won, Lost or holding stage or one without Finished work, is a publish ERROR with code baton_stage_refused (422; the key in `field`, naming the stage and the reason, in data.errors), unless that same setting (the same step, the same action, the same stage) was already live in the published graph: then it is a WARNING with the same code (in data.warnings), so the automation stays editable.";
13
13
  /** (handoffkeep55, app) the baton hand-off actions; the catalog does not carry action config */
14
- export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it." + BATON_STAGE_REFUSED_NOTE;
14
+ export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it. Hand Off Deal, the two-card hand-off (app handoff_deal): handoff_deal config {pipelineId (required, the target pipeline), stageId (default the target pipeline's first stage), assignedTo (a user id of an active member: the new card is assigned to them, and the step is refused when they are not one; blank = the new card is unassigned unless keepSourceOwner is true; a hand-off into the workspace's Post-Close pipeline ignores it: that card takes the originating card's owner, or is unassigned when that card has no owner or its owner is no longer an active member; whether the target is the Post-Close pipeline is read from the workspace settings when the step starts, so a settings change in that moment can apply the other rule to that one card), keepSourceOwner (true gives the new card the source card's owner as it is when the card is created, or leaves it unassigned when that card has no owner or its owner is no longer an active member; used only when assignedTo is blank and the target is not the Post-Close pipeline; default false), copyNotes (default true), listDocuments (default true), source (default the current card's source, else the contact's source, else \"Unknown (created via deal hand-off)\")}: opens a NEW card for the contact in another pipeline and the current card keeps its own outcome (unlike handoff_and_keep it is not moved to a finished-work stage)." + BATON_STAGE_REFUSED_NOTE;
15
15
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
16
16
  export const AUTOMATION_KEY_REFUSALS_NOTE = " Unknown action keys are refused, never ignored: an action config key the action does not read (a typo such as `laneSoruce`) answers code `unknown_action_config_key` with the node, the key and, when one is close, a suggestion (\"Did you mean `laneSource`?\"); an action `type` no registry entry defines answers `unknown_action_type` (with 'Did you mean' when a registered type is close). Create and update answer 400 (an update that does not write `actions` is never refused for a key stored earlier), conduyt_workflow_validate answers 200 with valid false and the `errors` list (nodeId, field, code, message), and publish / a version restore answer 422 (the preflight refusal wraps `data.message`, `data.errors`, `data.warnings`). Read the suggestion, fix the key and send again; a stored workflow is never refused on read. A trigger condition or trigger node naming a deal MIRROR key (deal.customFields.<key>) answers 422 mirror_not_triggerable (#1292): trigger on the source field's own change (Contact Updated / Company Updated).";
17
17
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
@@ -136,6 +136,69 @@ export function registerAutomationTools(server, client) {
136
136
  const result = await client.post(`/api/v1/automation-executions/${encodeURIComponent(executionId)}/cancel`, { ...(reason !== undefined ? { reason } : {}) });
137
137
  return formatResult(result);
138
138
  }));
139
+ // (small88, live OpenAPI POST /automation-executions/{id}/recover) the recovery actions of a failed run
140
+ strictInput(server.tool("conduyt_recover_automation_execution", "Recover ONE failed run of an automation (POST /api/v1/automation-executions/{id}/recover; the id is the run's execution id). Only an owner or an admin may call it (403 for anyone else); another account's run, an unknown id and (for a key without the deals scope) a deal-bound run are all 404. action is required and is one of: retry (run the failed step's action again; it is QUEUED, not run in the request: answers 202 { queued: true, retryId, nextAt } and runs within a minute; refused with 422 when the run has no action step to run, e.g. a linear run, and with 409 for a branching step, which is never retried on its own), skip (give up on the failed step and carry on with the next one), resume (carry on from the failed step's continuation; skip and resume run inside the request and park durably at its deadline), recreate_carrier (a run that died before it started because its carrier could not be created: the carrier is re-created from the saved trigger, once, never twice), reconcile (a step whose retry already ran its action but whose recovery mark did not land: records it as recovered WITHOUT running anything again). retry, skip and resume work only on a run in status failed or completed_with_errors (otherwise 409 \"execution is not in a recoverable state\"; a stale call on a run whose only failed step was already recovered by its retry answers 200 { alreadyRecovered } and does nothing). Other 409 refusals, each with a code: automatic_retry_pending (the step is still retrying by itself; wait, answer carries nextRetryAt), retry_queued (a manual Retry is already queued), source_mark_unconfirmed (the step's retry ran its action but its mark did not land: use reconcile, never retry, skip or resume), nothing_to_reconcile, node_id_carrier_reencode_required. A run whose steps changed under the call answers 409 too: read it again and retry. AFTER THE CALL: skip and resume answer { ok, action, executed, reason, ambiguousEffects }. ambiguousEffects true, and a 500 \"Recovery ran but the execution could not be settled\", mean the step may already have sent something: inspect the run and its step log and reconcile; do NOT call retry, skip or resume again blindly (a repeat can duplicate an email, a text or a stage move). Not read-only and skip is irreversible (the failed step is rewritten as skipped): retry can run the step's action a second time (a text, an e-mail, a stage move), so check the run's step log before choosing. A recovery that completes is audited (automation_execution.recovered, best effort); the settlement-failure 500 below returns before that line. To stop a run instead, use conduyt_cancel_automation_run.", {
141
+ executionId: z.string().uuid().describe("The automation run (execution log) UUID to recover"),
142
+ action: z.enum(["retry", "skip", "resume", "recreate_carrier", "reconcile"]).describe("retry | skip | resume | recreate_carrier | reconcile (see the description)"),
143
+ }, async ({ executionId, action }) => {
144
+ const result = await client.post(`/api/v1/automation-executions/${encodeURIComponent(executionId)}/recover`, { action });
145
+ return formatResult(result);
146
+ }));
147
+ // (small90, parity47 planned) the step logs, one tool for both routes
148
+ strictInput(server.tool("conduyt_list_automation_step_logs", "List the step logs of automation runs (GET /api/v1/automations/{automationId}/step-logs with automationId, else GET /api/v1/automations/step-logs account-wide). One row = one action node run for one contact in one run, with the execution's contact name and email. Filters (each sent only when given): status (a stored step status such as pending, running, completed, failed or skipped; matched as given), actionType (the action type key, e.g. send_email), search (fuzzy match on the contact's name or email, or the automation name account-wide), dateFrom / dateTo (ISO dates on startedAt; dateTo runs to the end of that day), limit (default 50, at most 200) and offset. Answers { steps, total, limit, offset, has_more } (account-wide also nextCursor). THE TWO BRANCHES DIFFER: with automationId the rows come OLDEST first (by startedAt then createdAt) and page by offset only (cursor is refused with automationId), and an automation that does not exist, or a deal automation hidden from a key without the deals scope, is 404; without automationId (account-wide) the rows come NEWEST first and page by offset or by cursor: pass the previous answer's nextCursor as cursor (a cursor ignores offset; a malformed one is 400). Read only. Needs the automations view permission AND contacts.view_all (403 without it: the rows carry contact details); a key without the deals scope sees no step of a deal automation. Secure custom-field values are masked." + ANSWER_USERS_DOC, {
149
+ automationId: z.string().uuid().optional().describe("Only this automation's step logs (UUID); left out: every automation's"),
150
+ status: z.string().min(1).optional().describe("Step status, e.g. completed, failed, skipped, pending, running (the stored value is matched as given)"),
151
+ actionType: z.string().min(1).optional().describe("Action type key, e.g. send_email"),
152
+ search: z.string().optional().describe("Fuzzy match on the contact's name or email (account-wide also the automation name)"),
153
+ dateFrom: z.string().refine((v) => !Number.isNaN(Date.parse(v)), "dateFrom must be a parseable ISO date").optional().describe("startedAt on or after this ISO date (an unparseable value is refused here: the app would silently ignore it and widen the query)"),
154
+ dateTo: z.string().refine((v) => !Number.isNaN(Date.parse(v)), "dateTo must be a parseable ISO date").optional().describe("startedAt up to the end of this ISO date (an unparseable value is refused here)"),
155
+ limit: z.number().int().min(1).max(200).optional().describe("Rows per page (default 50, at most 200)"),
156
+ offset: z.number().int().min(0).optional().describe("Rows to skip"),
157
+ cursor: z.string().min(1).optional().describe("Account-wide only: the previous page's nextCursor (refused together with automationId)"),
158
+ }, async ({ automationId, ...filters }) => {
159
+ if (automationId !== undefined && filters.cursor !== undefined)
160
+ return formatToolError("cursor is only for the account-wide list: leave automationId out, or page this automation with offset");
161
+ const params = new URLSearchParams();
162
+ for (const [k, v] of Object.entries(filters))
163
+ if (v !== undefined && v !== "")
164
+ params.set(k, String(v));
165
+ const result = automationId
166
+ ? await client.get(`/api/v1/automations/${encodeURIComponent(automationId)}/step-logs?${params}`)
167
+ : await client.get(`/api/v1/automations/step-logs?${params}`);
168
+ return formatResult(result);
169
+ }));
170
+ strictInput(server.tool("conduyt_test_automation_node", "Test ONE node of a workflow against a real contact and see what it WOULD do (POST /api/v1/automations/{automationId}/test-node). It is a pure simulation: nothing is sent, no contact or deal is changed and no run is created, so it is read-only and safe to repeat; the ONLY state it touches is the operational per-user rate-limit counter (30 calls a minute, 429 beyond it), which is not CRM data. Only graph (v2) workflows can be tested (422 otherwise; 422 also for a malformed saved graph or one with no trigger occurrence to simulate). nodeId is required (404 when the graph has no such node). contactId names the subject contact (a contact you may not see is 404); triggerNodeId picks which trigger occurrence to simulate; dealId (needed for a deal-triggered occurrence, refused with 400 for one that is not), companyId (company-triggered), previousStageId / previousPipelineId (a simulated deal move's origin), executionId (replay a stored run's payload; owner or admin only) and appointmentId (needs the calendar view permission) complete the occurrence. Answers { automationId, nodeId, contactId, triggerEvent, triggerNodeId, step } where step says the outcome (e.g. would run, would fail, skipped) and why. 409 means the test cannot judge it honestly (the trigger's filter rejects this sample, a find step or a step output decides it, a needed subject is missing); the message says which. Needs the automations view permission; a hidden deal automation is 404. As a POST it needs a write-tier API key (a read-tier key is refused at the scope gate, although the test changes nothing). It never runs the workflow for real." + ANSWER_USERS_DOC, {
171
+ automationId: z.string().uuid().describe("The workflow's UUID"),
172
+ nodeId: z.string().min(1).max(100).describe("The node to test (its id in the workflow graph)"),
173
+ contactId: z.string().uuid().optional().describe("The subject contact (UUID)"),
174
+ triggerNodeId: z.string().min(1).max(100).optional().describe("Which trigger occurrence to simulate, by the trigger node's id"),
175
+ dealId: z.string().uuid().optional().describe("The subject deal (needed for a deal-triggered occurrence)"),
176
+ companyId: z.string().uuid().optional().describe("The company (for a company-triggered occurrence)"),
177
+ previousStageId: z.string().uuid().optional().describe("The stage a simulated deal move came from"),
178
+ previousPipelineId: z.string().uuid().optional().describe("The pipeline a simulated deal move came from"),
179
+ executionId: z.string().uuid().optional().describe("A stored run whose payload the test replays (owner or admin only)"),
180
+ appointmentId: z.string().uuid().optional().describe("The appointment to test against (needs the calendar view permission)"),
181
+ }, async ({ automationId, ...body }) => {
182
+ const sent = Object.fromEntries(Object.entries(body).filter(([, v]) => v !== undefined));
183
+ const result = await client.post(`/api/v1/automations/${encodeURIComponent(automationId)}/test-node`, sent);
184
+ return formatResult(result);
185
+ }));
186
+ strictInput(server.tool("conduyt_get_automation_failures_drilldown", "Drill into what is stuck or failing across all automations (GET /api/v1/automations/failures/drilldown). kind is required and is one of: stale_drip_batches (drip batches claimed but not released), long_running_executions (runs that have been going too long), pending_import_side_effects and failed_import_side_effects (import follow-up work waiting or failed), failed_ledger_sends (sends that failed). limit (default 50, at most 100), offset and cursor (the keyset cursor from the previous page's nextCursor; prefer it to offset for deep paging) are optional. Answers { kind, rows, total, limit, offset, has_more, nextCursor }; an unknown kind is 400. Read only. Needs the automations view permission AND contacts.view_all (403 without it: rows carry contact details); a key without the deals scope sees no deal-bound rows. Secure custom-field values are masked." + ANSWER_USERS_DOC, {
187
+ kind: z.enum(["stale_drip_batches", "long_running_executions", "pending_import_side_effects", "failed_import_side_effects", "failed_ledger_sends"]).describe("What to list"),
188
+ limit: z.number().int().min(1).max(100).optional().describe("Rows per page (default 50, at most 100)"),
189
+ offset: z.number().int().min(0).optional().describe("Rows to skip"),
190
+ cursor: z.string().min(1).optional().describe("The previous page's nextCursor"),
191
+ }, async ({ kind, limit, offset, cursor }) => {
192
+ const params = new URLSearchParams({ kind });
193
+ if (limit !== undefined)
194
+ params.set("limit", String(limit));
195
+ if (offset !== undefined)
196
+ params.set("offset", String(offset));
197
+ if (cursor !== undefined)
198
+ params.set("cursor", cursor);
199
+ const result = await client.get(`/api/v1/automations/failures/drilldown?${params}`);
200
+ return formatResult(result);
201
+ }));
139
202
  server.tool("conduyt_resolve_names", "Resolve human-readable names to UUIDs. Use this before creating automations — converts tag names, pipeline names, user names, and custom field labels to their UUIDs.", {
140
203
  tags: z.array(z.string()).optional().describe("Tag names to resolve (e.g. ['new-lead', 'hot'])"),
141
204
  pipelines: z.array(z.string()).optional().describe("Pipeline names to resolve (e.g. ['Sales Pipeline'])"),
@@ -0,0 +1,12 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /**
4
+ * Booking routing forms (app: /api/v1/booking-routing-forms): the question forms a visitor answers before the booking page
5
+ * they are sent to. Reads need calendar:view; writes need an owner / admin key and active billing. The public page that
6
+ * serves a form (/public/booking/routing/{slug}) is keyless and is not a tool.
7
+ */
8
+ export declare const ROUTING_STEP_TYPES: readonly ["select", "radio", "text"];
9
+ /** the server's own slug rule (lib/booking.ts normalizeSlug): the bound is judged on the NORMALISED value, so "---" (empty after
10
+ * normalising) is refused here and "a b" (-> "a-b") is accepted, exactly as the route does */
11
+ export declare function normalizeRoutingSlug(raw: string): string;
12
+ export declare function registerBookingRoutingFormTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,72 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ import { strictInput } from "./strict.js";
4
+ /**
5
+ * Booking routing forms (app: /api/v1/booking-routing-forms): the question forms a visitor answers before the booking page
6
+ * they are sent to. Reads need calendar:view; writes need an owner / admin key and active billing. The public page that
7
+ * serves a form (/public/booking/routing/{slug}) is keyless and is not a tool.
8
+ */
9
+ export const ROUTING_STEP_TYPES = ["select", "radio", "text"];
10
+ /** the server's own slug rule (lib/booking.ts normalizeSlug): the bound is judged on the NORMALISED value, so "---" (empty after
11
+ * normalising) is refused here and "a b" (-> "a-b") is accepted, exactly as the route does */
12
+ export function normalizeRoutingSlug(raw) {
13
+ return raw.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64);
14
+ }
15
+ const slugField = z.string().refine((s) => normalizeRoutingSlug(s).length >= 3, "slug must be at least 3 characters once normalised (letters, numbers or hyphens)");
16
+ /** the route ignores a blank title on PATCH (a silent success) and refuses it on create: refuse it here for both */
17
+ const nonBlank = z.string().trim().min(1, "must not be blank");
18
+ const optionSchema = z.object({
19
+ label: z.string().min(1).describe("Option text shown to the visitor"),
20
+ value: z.string().min(1).describe("Option value"),
21
+ routeTo: z.string().optional().describe("Where this answer routes (a booking page slug or path)"),
22
+ }).strict();
23
+ const stepSchema = z.object({
24
+ id: z.string().min(1).describe("Step id (unique within the form)"),
25
+ question: z.string().min(1).describe("The question text"),
26
+ type: z.enum(ROUTING_STEP_TYPES).describe("select, radio or text"),
27
+ options: z.array(optionSchema).optional().describe("The choices of a select / radio step"),
28
+ required: z.boolean().optional().describe("Required (default true)"),
29
+ }).strict();
30
+ const STEPS_NOTE = "The server keeps at most 50 steps and silently drops a step with no id, no question or a type outside select / radio / text, and an option with no label or value; read the answer to see what was stored.";
31
+ const FORM_ERRORS = "Refusals are the server's: 400 'title is required' / 'slug is required' / 'slug must be at least 3 characters', 403 for a key that is not owner / admin, 404 'Routing form not found', 409 'A routing form with this slug already exists'.";
32
+ export function registerBookingRoutingFormTools(server, client) {
33
+ strictInput(server.tool("conduyt_list_booking_routing_forms", "List the account's booking routing forms (GET /api/v1/booking-routing-forms; calendar:view), newest first, answered { data: [form], meta: { page, per_page, total, has_more } }. Each form has id, slug, title, description, isActive and steps.", {
34
+ search: z.string().optional().describe("Matches title, slug or description (case-insensitive)"),
35
+ isActive: z.boolean().optional().describe("Only active (true) or inactive (false) forms"),
36
+ page: z.number().int().min(1).optional().describe("Page, from 1"),
37
+ perPage: z.number().int().min(1).max(200).optional().describe("Rows per page (default 50, max 200)"),
38
+ }, async ({ search, isActive, page, perPage }) => {
39
+ const qs = new URLSearchParams();
40
+ if (search !== undefined)
41
+ qs.set("search", search);
42
+ if (isActive !== undefined)
43
+ qs.set("is_active", String(isActive));
44
+ if (page !== undefined)
45
+ qs.set("page", String(page));
46
+ if (perPage !== undefined)
47
+ qs.set("per_page", String(perPage));
48
+ const q = qs.toString();
49
+ return formatResult(await client.get("/api/v1/booking-routing-forms" + (q ? "?" + q : "")));
50
+ }));
51
+ strictInput(server.tool("conduyt_get_booking_routing_form", "Get one booking routing form with its steps (GET /api/v1/booking-routing-forms/{id}; calendar:view). 404 'Routing form not found'.", {
52
+ id: z.string().uuid().describe("Routing form UUID"),
53
+ }, async ({ id }) => formatResult(await client.get(`/api/v1/booking-routing-forms/${id}`))));
54
+ strictInput(server.tool("conduyt_create_booking_routing_form", "Create a booking routing form (POST /api/v1/booking-routing-forms; owner / admin key, active billing). title and slug are required; the slug is normalised (lowercase letters, numbers and hyphens, at least 3 characters) and is unique across the product. isActive defaults to true. " + STEPS_NOTE + " " + FORM_ERRORS, {
55
+ title: nonBlank.describe("Form title"),
56
+ slug: slugField.describe("URL slug, e.g. 'find-your-consult' (normalised by the server)"),
57
+ description: z.string().nullable().optional().describe("Description, or null"),
58
+ isActive: z.boolean().optional().describe("Active (default true)"),
59
+ steps: z.array(stepSchema).max(50).optional().describe("The ordered questions"),
60
+ }, async ({ title, slug, description, isActive, steps }) => formatResult(await client.post("/api/v1/booking-routing-forms", { title, slug, description, isActive, steps }))));
61
+ strictInput(server.tool("conduyt_update_booking_routing_form", "Update a booking routing form (PATCH /api/v1/booking-routing-forms/{id}; owner / admin key, active billing). Only the fields you pass change; a passed steps list REPLACES the stored steps (an empty list clears them). " + STEPS_NOTE + " " + FORM_ERRORS, {
62
+ id: z.string().uuid().describe("Routing form UUID"),
63
+ title: nonBlank.optional().describe("Form title"),
64
+ slug: slugField.optional().describe("URL slug (normalised; 409 if taken)"),
65
+ description: z.string().nullable().optional().describe("Description, or null to clear"),
66
+ isActive: z.boolean().optional().describe("Active"),
67
+ steps: z.array(stepSchema).max(50).optional().describe("The full ordered question list (replaces the stored one)"),
68
+ }, async ({ id, title, slug, description, isActive, steps }) => formatResult(await client.patch(`/api/v1/booking-routing-forms/${id}`, { title, slug, description, isActive, steps }))));
69
+ strictInput(server.tool("conduyt_delete_booking_routing_form", "Delete a booking routing form (DELETE /api/v1/booking-routing-forms/{id}; owner / admin key, active billing). Answers { deleted: true }. The form's public link stops working. 404 'Routing form not found'.", {
70
+ id: z.string().uuid().describe("Routing form UUID"),
71
+ }, async ({ id }) => formatResult((await client.del(`/api/v1/booking-routing-forms/${id}`)) ?? { deleted: true, id })));
72
+ }
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
+ import { strictInput } from "./strict.js";
3
4
  /** Where a call's audio is fetched (no tool carries the bytes: a binary stream does not belong in a tool result). */
4
5
  export const RECORDING_DOWNLOAD_NOTE = "AUDIO is not returned by any tool: GET {API base}/api/v1/dialer/call/{id}/media?type=recording (or type=voicemail) streams it, with the header `Authorization: Bearer <the same API key>`; add `&download=1` (or `download=true`) for a `Content-Disposition: attachment` file named `<Contact or number>_<date>_<time>_<callId8>.mp3` (the same authorisation and the same stream; a call with no media is a 404). The conduyt CLI does this: `conduyt dialer recording download <callId> [--voicemail] [-o file]`.";
5
6
  /** (#1262) PATCH /dialer/call/{id}: the saved outcome of a call, and how a Callback is set up. */
@@ -139,6 +140,22 @@ export function registerCallTools(server, client) {
139
140
  const result = await client.get(`/api/v1/calls/unknown-callers?${params}`);
140
141
  return formatResult(result);
141
142
  });
143
+ // (mcprings71 r1 P2) strict: an unknown key (a typo such as contactID) is refused, never stripped into an unfiltered list
144
+ strictInput(server.tool("conduyt_list_lead_rings", "List the \"Ring the team for this lead\" rings, newest first (GET /api/v1/lead-rings, app shotgun50): who was rung, who answered, when. Each row: { id, contactId, dealId (null to a key without the deals scope), automationId (the automation that rang the team), status (open | won | expired: expired = ended without a winner, i.e. nobody answered in time, the lead could not be assigned, nobody could be rung, or the run stopped; an open ring past its time reads expired), answeredBy (the user who answered, or null), answeredAt, rung (the user ids rung), notRung ([{ userId, reason }]: the step's people left out BEFORE the ring was placed and why, e.g. not available, today's limit reached, over the ring limit; a leg that then failed to place, or was still waiting to be placed when the ring closed or ran out of time, is not listed here (nor in rung; a leg whose placement completed is in rung, even when it completed after the ring closed), so notRung is not the complete inverse of rung), createdAt, endsAt (null while the ring is still being placed), cancelFailed (true: cancelling the other phones failed at its bound, they rang on until the ring time was up) }. Owners and admins see every ring; anyone else sees only the rings that rang them. Filters: contactId (one lead), status, limit 1-100 (default 25). Read-only; requires dialer:view. Answering a ring is a person's softphone only (an API key cannot answer).", {
145
+ contactId: z.string().uuid().optional().describe("Only this lead's rings (contact UUID)"),
146
+ status: z.enum(["open", "won", "expired"]).optional().describe("open (still ringing), won (someone answered) or expired (ended without a winner: nobody answered in time, the lead could not be assigned, nobody could be rung, or the run stopped)"),
147
+ limit: z.number().int().min(1).max(100).optional().describe("Rows, 1-100 (default 25)"),
148
+ }, async ({ contactId, status, limit }) => {
149
+ const params = new URLSearchParams();
150
+ if (contactId)
151
+ params.set("contactId", contactId);
152
+ if (status)
153
+ params.set("status", status);
154
+ if (limit !== undefined)
155
+ params.set("limit", String(limit));
156
+ const result = await client.get(`/api/v1/lead-rings?${params}`);
157
+ return formatResult(result);
158
+ }));
142
159
  server.tool("conduyt_link_call", "Link a contact-less call to an existing contact (the unknown-caller prompt's 'Search a contact' + Attach). attachNumber=true also writes the call's number into the contact's next free phone slot (empty primary, then phone_2, phone_3 ...; never overwrites; already there = no write). dryRun=true answers exactly what the request would do (attached.slot, alreadyOnContact, alreadyLinked, or the same refusal) and writes nothing: call it first to tell a human what will happen. Refusals write nothing: 409 call_already_linked, no_free_phone_slot, number_on_another_contact (another contact has it as its primary phone), number_owner_undecidable (too many contacts share the number's last seven digits to prove who owns it: link without attachNumber); 403 contact_not_editable (attach needs edit rights on the contact); 404 call_not_found / contact_not_found; 422 number_unusable. A repeat of a successful link is idempotent (alreadyLinked=true). To create a NEW lead from the call instead, use conduyt_create_contact with callId. Requires dialer:create, plus contacts:edit when attachNumber is true.", {
143
160
  id: z.string().uuid().describe("Call UUID (a contact-less call, e.g. from conduyt_list_calls)"),
144
161
  contactId: z.string().uuid().describe("The contact to link the call to"),
@@ -1,7 +1,12 @@
1
1
  import { formatResult } from "../client.js";
2
+ import { strictInput } from "./strict.js";
2
3
  export function registerDashboardTools(server, client) {
3
4
  server.tool("conduyt_dashboard", "Get a full CRM dashboard summary — pipeline stages with deal values, recent activities, contact/deal/task counts, admin metrics (overdue tasks, stale deals, unassigned items, team workload), billing summary, contacts needing follow-up, and overdue tasks. (batch60, stageparked53) The open counts, the pipeline value, the per-rep workload and the stage breakdown count open WORK: a card in a finished-work stage (isParked, status open) is left out, and the breakdown lists no such stage.", {}, async () => {
4
5
  const result = await client.get("/api/v1/dashboard");
5
6
  return formatResult(result);
6
7
  });
8
+ strictInput(server.tool("conduyt_get_account_readiness", "Get the account's setup checklist (GET /api/v1/account/readiness): { score, requiredReady, requiredTotal, readyTotal, total, actionCount, warningCount, canManageSetup, onboardingComplete, onboardingWizardCompleted, items: [{ id, label, description, status (ready | action | warning | info), href, cta, detail, required }], nextItem }. nextItem is the first item that needs action, else the first warning, else null. Read only: it changes nothing and takes no arguments. WHO CAN CALL IT: a signed-in session or a legacy unrestricted API key. The `account` route domain is not grantable to a scoped API key, so a modern scoped key is refused with 403 at the scope gate; nothing is granted here. What a caller sees: owners and admins get the full checklist; anyone else gets either the same shape with the setup details hidden (items show ready or info, nextItem null) or, for a user with no visible modules, a reduced answer { score: null, status: \"info\", canManageSetup, onboardingComplete, onboardingWizardCompleted, items: [], nextItem: null, message: \"Account setup is managed by your admin.\" }. Setting the company name (POST /account/company-name) is not part of this tool.", {}, async () => {
9
+ const result = await client.get("/api/v1/account/readiness");
10
+ return formatResult(result);
11
+ }));
7
12
  }
@@ -374,6 +374,13 @@ export function registerDealTools(server, client) {
374
374
  const result = await client.post(`/api/v1/deals/${dealId}/tags`, { tagIds });
375
375
  return formatResult(result);
376
376
  });
377
+ strictInput(server.tool("conduyt_remove_deal_tag", "Take ONE tag off a deal (DELETE /api/v1/deals/{dealId}/tags/{tagId}; permission deals.edit and an active billing plan). tagId is the tag's UUID (a merged tag's old id also works: the tag actually removed comes back as tagId). Answers { dealId, tagId, deleted: true }. A deal you cannot see or edit, an unknown deal and a tag that is not on the deal are all 404 (\"Tag assignment not found\" for the last); nothing is changed then. The tag itself is not deleted and other deals keep it. What it fires: the deal.updated event with action tag_removed (app event, customer webhooks and deal.updated automations) and one deal.tag_removed audit line; it writes no timeline activity and no contact.tag_removed event (those belong to a CONTACT's tags: use conduyt_update_contact removeTags for those). The twin of conduyt_add_deal_tags.", {
378
+ dealId: z.string().uuid().describe("Deal UUID"),
379
+ tagId: z.string().uuid().describe("The tag's UUID to take off the deal"),
380
+ }, async ({ dealId, tagId }) => {
381
+ const result = await client.del(`/api/v1/deals/${encodeURIComponent(dealId)}/tags/${encodeURIComponent(tagId)}`);
382
+ return formatResult(result);
383
+ }));
377
384
  server.tool("conduyt_list_deal_views", "List the account's SAVED DEAL VIEWS (saved deal segments, e.g. 'Open deals over $10k'), each with its id, name, stored filter rules, and current deal count. Read-only — shows how the account segments its deals. A rule's filter field `contactTimezone` (#1312 tzfilter, the linked contact's time zone) takes operators equals / in (the value is a string: one value for equals, a comma-separated list for in) and each value is a group word (eastern, central, mountain, pacific, alaska, hawaii), unknown, or an IANA id (the same values as conduyt_list_deals contact_timezone; the API validates it and refuses a malformed value or more than 25 distinct values with a 400); a view with that rule is created or edited with conduyt_create_deal_view / conduyt_update_deal_view (POST / PATCH /api/v1/deals/views), read one with conduyt_get_deal_view and removed with conduyt_delete_deal_view.", {}, async () => {
378
385
  const result = await client.get("/api/v1/deals/views");
379
386
  return formatResult(result);
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /**
4
+ * Drip tracks (app: /api/v1/drip-tracks; the sequences that status metadata rows point at through dripTrackId). A track has a
5
+ * lowercase machine slug `name`, a `label`, a `channel` (sms | email | both), a `complianceProfile`, ordered `steps`,
6
+ * `exitConditions`, and the flags reEntryAllowed / isActive. Reads need settings:view, writes settings:edit (the step
7
+ * import needs an owner / admin key); writes need active billing.
8
+ */
9
+ export declare const DRIP_TRACK_CHANNELS: readonly ["sms", "email", "both"];
10
+ export declare const DRIP_COMPLIANCE_PROFILES: readonly ["twilio_10dlc", "gsm", "email_only"];
11
+ export declare function registerDripTrackTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ import { strictInput } from "./strict.js";
4
+ /**
5
+ * Drip tracks (app: /api/v1/drip-tracks; the sequences that status metadata rows point at through dripTrackId). A track has a
6
+ * lowercase machine slug `name`, a `label`, a `channel` (sms | email | both), a `complianceProfile`, ordered `steps`,
7
+ * `exitConditions`, and the flags reEntryAllowed / isActive. Reads need settings:view, writes settings:edit (the step
8
+ * import needs an owner / admin key); writes need active billing.
9
+ */
10
+ export const DRIP_TRACK_CHANNELS = ["sms", "email", "both"];
11
+ export const DRIP_COMPLIANCE_PROFILES = ["twilio_10dlc", "gsm", "email_only"];
12
+ const SLUG_RE = /^[a-z0-9][a-z0-9_]{0,79}$/;
13
+ // the routes trim a name before they test it, so a padded slug is valid input: trim first, then the rule
14
+ const slug = z.string().trim().regex(SLUG_RE, "lowercase machine slug: letters, numbers and underscores, max 80");
15
+ /** one step as the STEP IMPORT validates it (POST /drip-tracks/import-steps only). Create and update store ANY JSON array
16
+ * (the route only requires an array), so they take free-form steps: a track read back from the API always round-trips. */
17
+ const stepSchema = z.object({
18
+ dayOffset: z.number().int().min(0).describe("Days after entry; steps must be in ascending order"),
19
+ timeWindow: z.string().max(50).nullable().optional().describe("Send window text, e.g. '09:00-17:00'"),
20
+ channel: z.enum(DRIP_TRACK_CHANNELS).describe("sms, email or both"),
21
+ templateId: z.string().max(200).nullable().optional().describe("Template id"),
22
+ templateBody: z.string().max(10000).nullable().optional().describe("Inline template body"),
23
+ mergeTags: z.array(z.string().regex(/^\$\[[A-Za-z0-9_.-]+\]$/, "Merge tags use the $[tag] format")).max(100).optional().describe("Merge tags in $[tag] format"),
24
+ }).strict();
25
+ const TRACK_ERRORS = "Refusals are the server's: 400 with the reason (name must be a lowercase slug, channel / compliance_profile not one of the listed values, steps must be a JSON array, exit_conditions must be a JSON object or array), 404 'Drip track not found' (no such track in your account), 409 'A drip track with this name already exists'.";
26
+ export function registerDripTrackTools(server, client) {
27
+ strictInput(server.tool("conduyt_list_drip_tracks", "List the account's drip tracks (GET /api/v1/drip-tracks; settings:view): active first, then by name; each row has id, name, label, channel, complianceProfile, steps, exitConditions, reEntryAllowed, isActive and _count.statusMetadata (how many status metadata rows use the track). Status metadata names a track by its id (dripTrackId) or, in an import, by its name.", {}, async () => formatResult(await client.get("/api/v1/drip-tracks"))));
28
+ strictInput(server.tool("conduyt_get_drip_track", "Get one drip track with its steps (GET /api/v1/drip-tracks/{id}; settings:view). 404 'Drip track not found' for an id that is not in your account.", {
29
+ id: z.string().uuid().describe("Drip track UUID"),
30
+ }, async ({ id }) => formatResult(await client.get(`/api/v1/drip-tracks/${id}`))));
31
+ strictInput(server.tool("conduyt_create_drip_track", "Create a drip track (POST /api/v1/drip-tracks; settings:edit, active billing). name (a lowercase slug) and label are required; channel defaults to both, complianceProfile to twilio_10dlc, steps to none, reEntryAllowed to false, isActive to true. " + TRACK_ERRORS, {
32
+ name: slug.describe("Machine slug, e.g. 'new_lead_nurture' (unique per account)"),
33
+ label: z.string().trim().min(1).describe("Display label"),
34
+ channel: z.enum(DRIP_TRACK_CHANNELS).optional().describe("sms, email or both (default both)"),
35
+ complianceProfile: z.enum(DRIP_COMPLIANCE_PROFILES).optional().describe("twilio_10dlc (default), gsm or email_only"),
36
+ steps: z.array(z.unknown()).optional().describe("Ordered steps: any JSON array the route stores (the step import is the typed form: dayOffset ascending, channel, templateId, templateBody, mergeTags)"),
37
+ exitConditions: z.union([z.record(z.unknown()), z.array(z.unknown())]).optional().describe("Exit conditions: a JSON object or array"),
38
+ reEntryAllowed: z.boolean().optional().describe("May a contact enter the track again (default false)"),
39
+ isActive: z.boolean().optional().describe("Active (default true)"),
40
+ },
41
+ // undefined fields are dropped by JSON.stringify, so only the ones given are sent
42
+ async ({ name, label, channel, complianceProfile, steps, exitConditions, reEntryAllowed, isActive }) => formatResult(await client.post("/api/v1/drip-tracks", { name, label, channel, complianceProfile, steps, exitConditions, reEntryAllowed, isActive }))));
43
+ strictInput(server.tool("conduyt_update_drip_track", "Update a drip track (PATCH /api/v1/drip-tracks/{id}; settings:edit, active billing). Only the fields you pass change; at least one is needed (400 'No valid fields to update' otherwise). A passed steps list REPLACES the stored steps. " + TRACK_ERRORS, {
44
+ id: z.string().uuid().describe("Drip track UUID"),
45
+ name: slug.optional().describe("Machine slug"),
46
+ label: z.string().trim().min(1).optional().describe("Display label"),
47
+ channel: z.enum(DRIP_TRACK_CHANNELS).optional().describe("sms, email or both"),
48
+ complianceProfile: z.enum(DRIP_COMPLIANCE_PROFILES).optional().describe("twilio_10dlc, gsm or email_only"),
49
+ steps: z.array(z.unknown()).optional().describe("The full ordered step list (replaces the stored one; any JSON array, [] clears every step)"),
50
+ exitConditions: z.union([z.record(z.unknown()), z.array(z.unknown())]).optional().describe("Exit conditions: a JSON object or array"),
51
+ reEntryAllowed: z.boolean().optional().describe("May a contact enter the track again"),
52
+ isActive: z.boolean().optional().describe("Active"),
53
+ }, async ({ id, name, label, channel, complianceProfile, steps, exitConditions, reEntryAllowed, isActive }) => formatResult(await client.patch(`/api/v1/drip-tracks/${id}`, { name, label, channel, complianceProfile, steps, exitConditions, reEntryAllowed, isActive }))));
54
+ strictInput(server.tool("conduyt_delete_drip_track", "Delete a drip track (DELETE /api/v1/drip-tracks/{id}; settings:edit, active billing). Status metadata rows that named the track lose it (their dripTrackId becomes null and their updatedAt advances, so an editor holding the old version is refused); nothing else is deleted. Answers 204 with no body, reported here as { deleted: true, id }. 404 'Drip track not found' for an id that is not in your account.", {
55
+ id: z.string().uuid().describe("Drip track UUID"),
56
+ }, async ({ id }) => {
57
+ const result = await client.del(`/api/v1/drip-tracks/${id}`);
58
+ return formatResult(result ?? { deleted: true, id });
59
+ }));
60
+ strictInput(server.tool("conduyt_import_drip_track_steps", "Replace the steps of several existing drip tracks in one call (POST /api/v1/drip-tracks/import-steps; owner / admin key, active billing; max 200 tracks, 250 steps each). Tracks are named by trackName (the slug), not id. Answers { updated, errors: [{ trackName, reason }] }: read errors even on a 200 (a duplicate trackName in the call, 'Drip track not found', 'dayOffset values must be ascending'); the valid tracks are updated and the rest are reported. A step with a key outside dayOffset, timeWindow, channel, templateId, templateBody, mergeTags is refused as InvalidParams before any request.", {
61
+ items: z.array(z.object({
62
+ trackName: slug.describe("Drip track name (slug)"),
63
+ steps: z.array(stepSchema).max(250).describe("The full ordered step list for this track"),
64
+ }).strict()).max(200).describe("The tracks to update"),
65
+ }, async ({ items }) => formatResult(await client.post("/api/v1/drip-tracks/import-steps", { items }))));
66
+ }
@@ -0,0 +1,4 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /** (small92, parity47 planned) member groups: GET / POST /api/v1/groups and PATCH / DELETE /api/v1/groups/{id} (there is no GET by id) */
4
+ export declare function registerMemberGroupTools(server: McpServer, client: ConduytClient): void;