conduyt-mcp 4.105.38 → 4.105.40

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.
@@ -299,7 +299,7 @@ export function registerAiExtendedTools(server, client) {
299
299
  const result = await client.post("/api/v1/ai/tasks", { type: "segment_and_act", ...params, dryRun: true });
300
300
  return formatResult(result);
301
301
  });
302
- server.tool("conduyt_ai_task_pipeline_cleanup", "AI task (PREVIEW ONLY): preview finding stale deals in a pipeline and tagging, moving, notifying, or reporting on them. Returns the stale deals and what WOULD happen, without persisting. Executing a mutating action is intentionally restricted to a human session in the app; agent/API-key callers can only preview.", {
302
+ server.tool("conduyt_ai_task_pipeline_cleanup", "AI task (PREVIEW ONLY): preview finding stale deals in a pipeline and tagging, moving, notifying, or reporting on them. Returns the stale deals and what WOULD happen, without persisting. Executing a mutating action is intentionally restricted to a human session in the app; agent/API-key callers can only preview. (batch60, stageparked53) The preview scans stale WORK only: a card in a finished-work stage (isParked, status open) is a record and is never listed, so the preview shows none of them and a live run never reports, notifies or moves one.", {
303
303
  pipelineId: z.string().describe("Pipeline UUID to scan"),
304
304
  staleDays: z.number().optional().describe("Days without activity to consider a deal stale (default 30)"),
305
305
  action: z.enum(["tag", "move_stage", "notify", "report_only"]).optional().describe("Action to preview against stale deals (default report_only)"),
@@ -4,10 +4,20 @@ import { ConduytClient } from "../client.js";
4
4
  export declare const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: assign_to_user config {userId | userIds (round robin) | groupId, mode (single | round_robin | trigger_host), target|applyTo: contact|deal|both, overwriteExisting, previousOwner, laneSource, lanePipelineId, laneStageId}: laneSource names a card lane (the Deal.source its Auto-Create step wrote, e.g. 'GSM', max 500 chars) and makes the deal leg assign the contact's newest OPEN card from that lane (inside lanePipelineId when set) instead of the run's deal; when the contact has none and lanePipelineId is set, the card is created there (laneStageId, else the pipeline's first stage) already owned by the user; lanePipelineId or laneStageId without laneSource, or laneStageId without lanePipelineId, is refused; a lane never applies to an 'Assign to: contact' step. assign_to_user mode 'trigger_host' assigns to the appointment's booked host (appointment.booked runs only; fails closed when the run has no host). previousOwner (release | keep_as_collaborator; default release) says what happens to the previous owner when the step changes an owner: release means they lose the lead unless something else explains their access (e.g. another open card of theirs), keep_as_collaborator keeps them as a collaborator of the contact (they still see the lead and its cards, read-only); any other value is refused, and keep_as_collaborator is refused on a step with a card lane (laneSource) unless it assigns the contact only (validate and publish answer a field error on action.config.previousOwner). create_deal config {pipelineId (required), stageId, dealName, dealValue, allowDuplicates, status, source, assignedTo, assigneeMode, leaveUnassigned}: leaveUnassigned true leaves the card unassigned when no assignee is set (default false: the card goes to the lead's owner). assigneeMode 'trigger_host' assigns the card to the appointment's booked host (appointment.booked runs only; wins over assignedTo; fails closed when the run has no host, creating nothing). The condition field 'Booked host' (trigger.hostUserId) exists on appointment.booked, whose payload now carries hostUserId. close_other_open_deals config {lostReason (required)}: closes the contact's OTHER open cards as lost with that reason, keeping the run's own card (each moves to its pipeline's lost stage with the usual stage-change effects; cards already won/lost, in the DPP Post-Close pipeline or in a pipeline with no lost stage are skipped; a re-run closes nothing twice); it needs the run's own deal, so use a deal trigger or a find_opportunity step first.";
5
5
  /** (deal nodes, app 10-13) find_opportunity v2, link_appointment_to_deal, update_deal_field systemField source; the catalog does not carry action config */
6
6
  export declare const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
7
+ /** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
8
+ export declare const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
7
9
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
8
10
  export declare 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).";
9
11
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
10
- export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
12
+ export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation that has no outcome yet (a draft, queued, scheduled or sending message)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
13
+ /** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
14
+ export declare const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
15
+ /** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
16
+ export declare const AUTOMATION_LOCK_503_DOC = "503 code automation_lock_timeout (Retry-After seconds, retryable): another change in the workspace (such as a tag merge) held a lock this change needs (the enrollment lock wait is bounded at 3 s); nothing was changed, call again after Retry-After";
17
+ /** (parity60) what a SAVE or a PUBLISH that changes what a live drip-enrollment automation enrolls on can answer, besides the key refusals */
18
+ export declare const AUTOMATION_ENROLLMENT_REFUSALS_NOTE = " Enrollment refusals: 409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused. 409 without a code: the automation's tag or drip campaign changed while it was being saved (the app says: This automation changed while it was being saved (another change moved its tag or drip campaign). Nothing was saved; try again.): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds, retryable): another change in the workspace (such as a tag merge) held a lock this change needs (the enrollment lock wait is bounded at 3 s); nothing was changed, call again after Retry-After.";
19
+ /** (toggleon58) what isActive does, documented for an agent: the app's switch-on RESUMES the published workflow */
20
+ export declare const IS_ACTIVE_DOC: string;
11
21
  /** GET /automations/:id answers { data: { ...automation, configRevision } } (jsonResponse wraps): the revision lives under `data` */
12
22
  export declare function configRevisionOf(raw: unknown): number | undefined;
13
23
  export declare function registerAutomationTools(server: McpServer, client: ConduytClient): void;
@@ -5,10 +5,20 @@ import { formatResult, formatToolError } from "../client.js";
5
5
  export const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: assign_to_user config {userId | userIds (round robin) | groupId, mode (single | round_robin | trigger_host), target|applyTo: contact|deal|both, overwriteExisting, previousOwner, laneSource, lanePipelineId, laneStageId}: laneSource names a card lane (the Deal.source its Auto-Create step wrote, e.g. 'GSM', max 500 chars) and makes the deal leg assign the contact's newest OPEN card from that lane (inside lanePipelineId when set) instead of the run's deal; when the contact has none and lanePipelineId is set, the card is created there (laneStageId, else the pipeline's first stage) already owned by the user; lanePipelineId or laneStageId without laneSource, or laneStageId without lanePipelineId, is refused; a lane never applies to an 'Assign to: contact' step. assign_to_user mode 'trigger_host' assigns to the appointment's booked host (appointment.booked runs only; fails closed when the run has no host). previousOwner (release | keep_as_collaborator; default release) says what happens to the previous owner when the step changes an owner: release means they lose the lead unless something else explains their access (e.g. another open card of theirs), keep_as_collaborator keeps them as a collaborator of the contact (they still see the lead and its cards, read-only); any other value is refused, and keep_as_collaborator is refused on a step with a card lane (laneSource) unless it assigns the contact only (validate and publish answer a field error on action.config.previousOwner). create_deal config {pipelineId (required), stageId, dealName, dealValue, allowDuplicates, status, source, assignedTo, assigneeMode, leaveUnassigned}: leaveUnassigned true leaves the card unassigned when no assignee is set (default false: the card goes to the lead's owner). assigneeMode 'trigger_host' assigns the card to the appointment's booked host (appointment.booked runs only; wins over assignedTo; fails closed when the run has no host, creating nothing). The condition field 'Booked host' (trigger.hostUserId) exists on appointment.booked, whose payload now carries hostUserId. close_other_open_deals config {lostReason (required)}: closes the contact's OTHER open cards as lost with that reason, keeping the run's own card (each moves to its pipeline's lost stage with the usual stage-change effects; cards already won/lost, in the DPP Post-Close pipeline or in a pipeline with no lost stage are skipped; a re-run closes nothing twice); it needs the run's own deal, so use a deal trigger or a find_opportunity step first.";
6
6
  /** (deal nodes, app 10-13) find_opportunity v2, link_appointment_to_deal, update_deal_field systemField source; the catalog does not carry action config */
7
7
  export const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
8
+ /** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
9
+ export const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
8
10
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
9
11
  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).";
10
12
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
11
- export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
13
+ export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation that has no outcome yet (a draft, queued, scheduled or sending message)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
14
+ /** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
15
+ export const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
16
+ /** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
17
+ export const AUTOMATION_LOCK_503_DOC = "503 code automation_lock_timeout (Retry-After seconds, retryable): another change in the workspace (such as a tag merge) held a lock this change needs (the enrollment lock wait is bounded at 3 s); nothing was changed, call again after Retry-After";
18
+ /** (parity60) what a SAVE or a PUBLISH that changes what a live drip-enrollment automation enrolls on can answer, besides the key refusals */
19
+ export const AUTOMATION_ENROLLMENT_REFUSALS_NOTE = ` Enrollment refusals: ${ENROLLMENT_TWIN_409_DOC}. 409 without a code: the automation's tag or drip campaign changed while it was being saved (the app says: This automation changed while it was being saved (another change moved its tag or drip campaign). Nothing was saved; try again.): read it again and call again. ${AUTOMATION_LOCK_503_DOC}.`;
20
+ /** (toggleon58) what isActive does, documented for an agent: the app's switch-on RESUMES the published workflow */
21
+ export const IS_ACTIVE_DOC = "false switches the automation off (unconditionally; see ifIdle for the conditional switch-off). true switches a PUBLISHED automation back on: send ONLY isActive true (no other field; the API answers 400 automation_activation_alone otherwise, and this tool refuses before sending). It RESUMES what was published (never the draft: to put draft edits live, use conduyt_publish_automation), after the same readiness checks as a publish: 422 automation_not_ready names what blocks it now (for example a step's tag or template deleted since). 400 automation_never_published: it was never published, publish it instead. 403: the key lacks automations.execute. Two different 409s. (a) Without a code: the workflow changed while it was being switched on (the app says: The workflow changed while it was being switched on. Try again.): read it and call again. (b) " + ENROLLMENT_TWIN_409_DOC + ". Then switch this one on. " + AUTOMATION_LOCK_503_DOC + ". Already on: success, nothing changed.";
12
22
  /** GET /automations/:id answers { data: { ...automation, configRevision } } (jsonResponse wraps): the revision lives under `data` */
13
23
  export function configRevisionOf(raw) {
14
24
  const row = raw && typeof raw === "object" && "data" in raw ? raw.data : raw;
@@ -41,7 +51,7 @@ export function registerAutomationTools(server, client) {
41
51
  kind: z.enum(["native", "n8n"]).optional().describe("Automation type — 'native' for the built-in graph engine (use `actions`), 'n8n' for an external n8n webhook (requires n8nWorkflowId + n8nWebhookUrl). For agent-built automations use 'native'."),
42
52
  n8nWorkflowId: z.string().optional().describe("n8n workflow ID (required when kind='n8n')"),
43
53
  n8nWebhookUrl: z.string().optional().describe("n8n webhook URL (required when kind='n8n')"),
44
- actions: z.any().optional().describe("Actions graph — v1: [{type, config}], v2: {nodes:[], startNodeId}. A sequence step is the action enroll_in_sequence with config {sequenceId, enrollAction: 'add' (default) | 'remove'}: add puts the contact into the sequence (the sequence must allow automation enrollment, allowAutomationEnroll), remove ends their run. A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + ""),
54
+ actions: z.any().optional().describe("Actions graph — v1: [{type, config}], v2: {nodes:[], startNodeId}. A sequence step is the action enroll_in_sequence with config {sequenceId, enrollAction: 'add' (default) | 'remove'}: add puts the contact into the sequence (the sequence must allow automation enrollment, allowAutomationEnroll), remove ends their run. A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + ""),
45
55
  graphVersion: z.number().optional().describe("Graph version — 1 (legacy array) or 2 (node graph). Default 1"),
46
56
  schedule: z.string().optional().describe("5-field cron expression (required if triggerEvent='scheduled')"),
47
57
  scheduleTimezone: z.string().optional().describe("IANA timezone for scheduled triggers (e.g. 'America/Los_Angeles')"),
@@ -53,7 +63,7 @@ export function registerAutomationTools(server, client) {
53
63
  const result = await client.post("/api/v1/automations", params);
54
64
  return formatResult(result);
55
65
  });
56
- server.tool("conduyt_update_automation", "Update an existing automation — change trigger, actions, schedule, or activation status." + AUTOMATION_KEY_REFUSALS_NOTE + WEBHOOK_NAME_TAG_DOC, {
66
+ server.tool("conduyt_update_automation", "Update an existing automation — change trigger, actions, schedule, or activation status." + AUTOMATION_KEY_REFUSALS_NOTE + AUTOMATION_ENROLLMENT_REFUSALS_NOTE + WEBHOOK_NAME_TAG_DOC, {
57
67
  id: z.string().describe("Automation UUID"),
58
68
  name: z.string().optional().describe("Updated name"),
59
69
  description: z.string().optional().describe("Updated description"),
@@ -62,10 +72,10 @@ export function registerAutomationTools(server, client) {
62
72
  .any()
63
73
  .optional()
64
74
  .describe("Updated trigger conditions (replaces the object). Same keys as create — e.g. { untouchedDays: 7 } on 'contact.untouched'. (#16 tri-surface parity: the UI and API could set this; MCP could not.)"),
65
- isActive: z.boolean().optional().describe("Enable or disable the automation"),
75
+ isActive: z.boolean().optional().describe(IS_ACTIVE_DOC),
66
76
  ifIdle: z.literal(true).optional().describe(IF_IDLE_DOC),
67
77
  expectedConfigRevision: z.number().int().nonnegative().optional().describe("REQUIRED whenever `actions` is replaced: the configRevision of the automation you read (conduyt_get_automation) before preparing the new graph. It is sent unchanged; if the automation was saved since, the API answers 409 with the current revision and nothing is overwritten, so re-read, re-apply your change and call again. Not needed for an update that leaves `actions` alone"),
68
- actions: z.any().optional().describe("Updated actions graph (same shape as create; e.g. enroll_in_sequence {sequenceId, enrollAction: 'add' | 'remove'}) A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + ""),
78
+ actions: z.any().optional().describe("Updated actions graph (same shape as create; e.g. enroll_in_sequence {sequenceId, enrollAction: 'add' | 'remove'}) A delay node waits for a fixed duration by default; waitType 'until_field_date' (with fieldKey = a deal DATE / DATETIME custom field key and offsetHours = signed hours added to its date, default 0, e.g. 24 = a day after it) waits until that date stored on the deal, re-read at every wake (an empty or past value continues immediately)." + CARD_OWNERSHIP_ACTIONS_NOTE + DEAL_NODES_ACTIONS_NOTE + SEND_ONCE_EMAIL_NOTE + ""),
69
79
  schedule: z.string().optional().describe("Updated cron schedule"),
70
80
  scheduleTimezone: z.string().optional().describe("Updated timezone"),
71
81
  stopOnResponse: z.boolean().optional().describe("Stop drip if contact responds"),
@@ -90,10 +100,17 @@ export function registerAutomationTools(server, client) {
90
100
  // ifIdle in a PATCH and switches off unconditionally, while it does not have this path at all (404 / 405, nothing changed)
91
101
  return formatResult(await client.post(`/api/v1/automations/${id}/deactivate-if-idle`, {}));
92
102
  }
103
+ // (toggleon58) the switch-on is exactly { isActive: true }: the API refuses any other field beside it (400 automation_activation_alone)
104
+ if (updates.isActive === true) {
105
+ const others = Object.keys(updates).filter((k) => k !== "isActive" && updates[k] !== undefined);
106
+ if (others.length > 0) {
107
+ return formatToolError(`Switching on is isActive true alone (it resumes the published automation); send ${others.join(", ")} in a separate call. Nothing was sent.`);
108
+ }
109
+ }
93
110
  const result = await client.patch(`/api/v1/automations/${id}`, updates);
94
111
  return formatResult(result);
95
112
  });
96
- server.tool("conduyt_publish_automation", "Publish an automation — copies the draft actions to the live published version. The automation must have actions defined. The publish is bound to the draft revision you reviewed (fetched automatically unless you pass expectedConfigRevision)." + AUTOMATION_KEY_REFUSALS_NOTE, {
113
+ server.tool("conduyt_publish_automation", "Publish an automation — copies the draft actions to the live published version. The automation must have actions defined. The publish is bound to the draft revision you reviewed (fetched automatically unless you pass expectedConfigRevision)." + AUTOMATION_KEY_REFUSALS_NOTE + AUTOMATION_ENROLLMENT_REFUSALS_NOTE, {
97
114
  id: z.string().describe("Automation UUID"),
98
115
  expectedConfigRevision: z.number().int().nonnegative().optional().describe("The configRevision of the draft you reviewed (from conduyt_get_automation); fetched automatically when omitted"),
99
116
  }, async ({ id, expectedConfigRevision }) => {
@@ -70,7 +70,9 @@ export function registerBulkTools(server, client) {
70
70
  });
71
71
  server.tool("conduyt_export_deals", "Export deals as JSON (GET /api/v1/deals/export, owner or admin only: otherwise 403) with the board's filters: search, status, pipeline, assigned_to (user UUIDs or `unassigned`, at most 25 distinct owners), tag_ids (tag UUIDs, ANY match, at most 25), contact_timezone, created_after / created_before (YYYY-MM-DD in the account time zone, day-inclusive, or an ISO datetime with offset), value_min / value_max, needsAction, stale, health (one Pipeline health check). Answer: { deals, meta { total, exported_at, filters_applied } }; Secure custom field values are masked. The whole filtered book is read in one request (not streamed): at most 50,000 rows, past that 413 and nothing is exported (narrow the filters); rate limited to 5 exports a minute per workspace and address (429). Each repeated filter is sent as repeated query parameters, never comma-joined; the owner and tag caps are also checked here, before any request. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param). TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + " The export applies the same rule as conduyt_list_deals." + LIST_USERS_DOC, {
72
72
  search: z.string().optional().describe("Search deal titles"),
73
- status: z.string().optional().describe("Filter by status (open, won, lost)"),
73
+ status: z.string().optional().describe("Filter by status (open, won, lost, or all for every status). open = open WORK: cards in a finished-work stage (isParked) are left out, as on the board"),
74
+ include_parked: z.boolean().optional().describe("(stageparked53) true or false; the API's default is false = open work. With status open: true also returns the cards in a finished-work stage (isParked), i.e. every not-closed record (sent as include_parked=true); use it to find or share a card. Without status open it changes nothing, as in the API (the export route's own default is also false). Alias: includeParked."),
75
+ includeParked: z.boolean().optional().describe("camelCase alias of include_parked."),
74
76
  pipeline: z.string().optional().describe("Filter by pipeline UUID"),
75
77
  contact_timezone: contactTimezoneSchema,
76
78
  ...dealExportFilterShape,
@@ -80,6 +82,10 @@ export function registerBulkTools(server, client) {
80
82
  qp.set("search", params.search);
81
83
  if (params.status)
82
84
  qp.set("status", params.status);
85
+ if (params.include_parked !== undefined && params.includeParked !== undefined && params.include_parked !== params.includeParked)
86
+ throw new Error("Conflicting include_parked values — pass only one.");
87
+ if ((params.include_parked ?? params.includeParked) === true)
88
+ qp.set("include_parked", "true");
83
89
  if (params.pipeline)
84
90
  qp.set("pipeline", params.pipeline);
85
91
  appendContactTimezone(qp, params.contact_timezone);
@@ -96,7 +102,7 @@ export function registerBulkTools(server, client) {
96
102
  industry: z.string().optional().describe("Filter by industry"),
97
103
  ownerId: z.string().uuid().optional().describe("Filter by owner user UUID"),
98
104
  lifecycleStage: z.string().optional().describe("Filter by lifecycle stage"),
99
- hasOpenDeals: z.boolean().optional().describe("true = only companies with an open deal (false sends nothing)"),
105
+ hasOpenDeals: z.boolean().optional().describe("true = only companies with an open-WORK deal (status open, not in a finished-work stage) (false sends nothing)"),
100
106
  ids: z.array(z.string().uuid()).min(1).max(1000).optional().describe("Only these company UUIDs (1 to 1000; omit for no id filter: an empty list is refused, never an unfiltered export)"),
101
107
  }, async (params) => {
102
108
  const qp = new URLSearchParams({ format: "json" });
@@ -1,6 +1,6 @@
1
1
  import { formatResult } from "../client.js";
2
2
  export function registerDashboardTools(server, client) {
3
- 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.", {}, async () => {
3
+ 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
4
  const result = await client.get("/api/v1/dashboard");
5
5
  return formatResult(result);
6
6
  });
@@ -42,7 +42,7 @@ const filtersSchema = z.object({
42
42
  if (f.valueMin && f.valueMax && Number(f.valueMin) > Number(f.valueMax))
43
43
  ctx.addIssue({ code: z.ZodIssueCode.custom, message: "valueMin is above valueMax", path: ["valueMin"] });
44
44
  }).describe("The Deals page's filters (no other key): ownerIds, createdFrom, createdTo, tagIds, contactTimezones, valueMin, valueMax; every key optional");
45
- const VIEW_DOC = "A view is { id, name, builtin, status (all | open | won | lost), filters, listSort ({ field, dir } or null), savedListSort, shared, mine, canEdit, owner ({ id, name } or null), count? }. These are the Deals page's views, per person per workspace (needs deals.view); they are NOT the board's saved view tabs of conduyt_list_deal_views (GET /deals/views).";
45
+ const VIEW_DOC = "A view is { id, name, builtin, status (all | open | won | lost), filters, listSort ({ field, dir } or null), savedListSort, shared, mine, canEdit, owner ({ id, name } or null), revision (16 hex characters, on every view but a built-in: the revision of what the view saves; pass it back as expectedRevision on an update), count? }. These are the Deals page's views, per person per workspace (needs deals.view); they are NOT the board's saved view tabs of conduyt_list_deal_views (GET /deals/views).";
46
46
  export function registerDealsPageViewTools(server, client) {
47
47
  strictInput(server.tool("conduyt_list_deals_page_views", "List the Deals page's saved views you see (GET /api/v1/deal-views): { views, defaultViewId, canShare }. The five built-ins come first in this order: all \"All deals\", open \"Open deals\", mine \"My deals\" (your own OPEN deals), won \"Won\", lost \"Lost and disqualified\"; then your own views and the views shared in the workspace. defaultViewId = the view the page opens on (your starred one, else all); canShare = whether you may share views (the Manager permission deals.view_all). With pipeline every view also carries count: its deals on that pipeline as GET /deals counts them for you (null when a count could not be read). Read-only. 400 invalid_pipeline (not a UUID), unknown_query_param, query_param_conflict. " + VIEW_DOC, { pipeline: z.string().uuid().optional().describe("Pipeline UUID: adds each view's count of deals on that pipeline") }, async ({ pipeline }) => {
48
48
  // two literal paths (the coverage gate derives a tool's endpoints from its literal client calls: a path ending in a template
@@ -59,15 +59,16 @@ export function registerDealsPageViewTools(server, client) {
59
59
  shared: z.boolean().optional().describe("true = shared in the workspace (managers only)"),
60
60
  makeDefault: z.boolean().optional().describe("true = also your default view"),
61
61
  }, async (params) => formatResult(await client.post("/api/v1/deal-views", params))));
62
- strictInput(server.tool("conduyt_update_deals_page_view", "Change one of YOUR Deals page views (PATCH /api/v1/deal-views/{id}): only the fields you pass change; filters REPLACES the whole filter set; listSort null clears the saved sort. Answers { view }. Owner only: 403 deal_view_builtin (id is a built-in), 403 deal_view_read_only (a view shared by someone else: duplicate it with conduyt_duplicate_deals_page_view), 403 deal_view_share_forbidden (changing shared without deals.view_all), 404 deal_view_not_found (missing or another person's private view), 409 deal_view_name_taken, 400 invalid_request / invalid_filters. Nothing to change is refused before any request. " + VIEW_DOC, {
62
+ strictInput(server.tool("conduyt_update_deals_page_view", "Change one of YOUR Deals page views (PATCH /api/v1/deal-views/{id}): only the fields you pass change; filters REPLACES the whole filter set (pass expectedRevision, the revision you read, so a view changed since is a 409 deal_view_changed instead of being overwritten); listSort null clears the saved sort. Answers { view }. Owner only: 403 deal_view_builtin (id is a built-in), 403 deal_view_read_only (a view shared by someone else: duplicate it with conduyt_duplicate_deals_page_view), 403 deal_view_share_forbidden (changing shared without deals.view_all), 404 deal_view_not_found (missing or another person's private view), 409 deal_view_name_taken, 400 invalid_request / invalid_filters. Nothing to change is refused before any request. " + VIEW_DOC, {
63
63
  id: viewId("The view's id"),
64
64
  name: nameSchema.optional(),
65
65
  status: statusSchema.optional(),
66
66
  filters: filtersSchema.optional(),
67
67
  listSort: sortSchema.nullable().optional().describe("The saved list sort { field, dir }; null clears it"),
68
68
  shared: z.boolean().optional().describe("Share in the workspace or stop sharing (managers only)"),
69
+ expectedRevision: z.string().regex(/^[0-9a-f]{16}$/).optional().describe("The view's revision as you read it (the `revision` field of conduyt_list_deals_page_views; 16 hex characters): when what the view saves (status, filters, list sort) was changed since, nothing is saved and the API answers 409 deal_view_changed. A rename or a share does not move it. Optional (without it the last write wins); not a change by itself."),
69
70
  }, async ({ id, ...updates }) => {
70
- if (Object.keys(updates).length === 0)
71
+ if (Object.keys(updates).filter((k) => k !== "expectedRevision").length === 0)
71
72
  throw new Error("Nothing to change: pass name, status, filters, listSort or shared.");
72
73
  return formatResult(await client.patch(`/api/v1/deal-views/${encodeURIComponent(id)}`, updates));
73
74
  }));
@@ -61,7 +61,7 @@ function boardSnapshotColumns(a, f) {
61
61
  return a.board_columns.map((c) => (c.limit === undefined ? c.stageId : `${c.stageId}:${c.limit}`)).join(",");
62
62
  }
63
63
  export function registerDealTools(server, client) {
64
- strictInput(server.tool("conduyt_list_deals", "List deals with filtering by pipeline, stage, assignee, or status. Returns deal title, value, stage, contact, and dates. Filter by pipeline/stage NAME (the same names you import with) or by UUID — both camelCase (pipelineName) and snake_case (pipeline_name) argument names are accepted. An unknown name returns a clear error, never the whole account. Each deal row carries hasNextStep (boolean: an open task or a booked appointment from a day ago on; the Needs next action rule's own answer) and nextAppointmentAt (ISO string or null; null unless your key can view the calendar, even when hasNextStep is true). PIPELINE HEALTH: pass health_summary=true to get the Pipeline health strip for the same filtered set instead of the deal list: { totalOpenDeals, atRiskValue, checks[] (key, label, severity, color, rule, count, value; the six checks high_value_idle, stale, unassigned, needs_action, missing_close_date, missing_contact, ordered by money at risk), deals }. Add health_check to also get that check's first page of deals (highest value first) as deals: { check, offset, items, hasMore, nextCursor, total }; deals is null without a check. Page with health_cursor (the previous nextCursor, passed back UNCHANGED: an opaque signed token) or health_offset, and health_rows_only=true to get just the page without the summary: the answer is {data:{deals:{check, offset, items, hasMore, nextCursor}}} (the page sits under data.deals). " + HEALTH_ERRORS + " " + BOARD_SNAPSHOT_DOC + " " + BUSY_503_DOC + MIRROR_READ_DOC + " A mirror key is not filterable (422 mirror_not_filterable). The API judges the query NAMES (batch32, #1313): a name GET /deals does not read is 400 unknown_query_param { message, unknown[], accepted[] (every name it reads), didYouMean { name: accepted twin } for the camelCase / snake_case twin of an accepted name } and is never silently ignored (it used to answer the unfiltered list); two different values for a single-value name (status, contact_id, search, stale, needsAction, summary, latest_updated, system_occupancy, sort, order, page, per_page, value_min / minValue, value_max / maxValue) are 400 query_param_conflict { message, param }, an exact repeat is accepted. This tool sends only accepted names (pipeline, pipeline_name, stage, stage_name, assigned_to, status, search, contact_timezone, page, per_page, sort, order, list_order, board_snapshot, board_columns, health_summary, health_check, health_limit, health_offset, health_cursor, health_rows_only), so these two codes mean an older or newer server than this MCP expects; they reach you as `Conduyt API 400: <message>` with the code. The API judges sort and order (batch32): an unknown sort field, or an order other than asc / desc, is 400 sort_invalid { message, param, accepted } (the sent spelling in param) and is never silently replaced by the default order. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param)." + " " + ROLE_COLUMNS_NOTE + " TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + LIST_USERS_DOC, {
64
+ strictInput(server.tool("conduyt_list_deals", "List deals with filtering by pipeline, stage, assignee, or status. Returns deal title, value, stage, contact, and dates. Filter by pipeline/stage NAME (the same names you import with) or by UUID — both camelCase (pipelineName) and snake_case (pipeline_name) argument names are accepted. An unknown name returns a clear error, never the whole account. Each deal row carries hasNextStep (boolean: an open task or a booked appointment from a day ago on; the Needs next action rule's own answer) and nextAppointmentAt (ISO string or null; null unless your key can view the calendar, even when hasNextStep is true). PIPELINE HEALTH: pass health_summary=true to get the Pipeline health strip for the same filtered set instead of the deal list: { totalOpenDeals, atRiskValue, checks[] (key, label, severity, color, rule, count, value; the six checks high_value_idle, stale, unassigned, needs_action, missing_close_date, missing_contact, ordered by money at risk), deals }. Add health_check to also get that check's first page of deals (highest value first) as deals: { check, offset, items, hasMore, nextCursor, total }; deals is null without a check. Page with health_cursor (the previous nextCursor, passed back UNCHANGED: an opaque signed token) or health_offset, and health_rows_only=true to get just the page without the summary: the answer is {data:{deals:{check, offset, items, hasMore, nextCursor}}} (the page sits under data.deals). " + HEALTH_ERRORS + " " + BOARD_SNAPSHOT_DOC + " " + BUSY_503_DOC + MIRROR_READ_DOC + " A mirror key is not filterable (422 mirror_not_filterable). The API judges the query NAMES (batch32, #1313): a name GET /deals does not read is 400 unknown_query_param { message, unknown[], accepted[] (every name it reads), didYouMean { name: accepted twin } for the camelCase / snake_case twin of an accepted name } and is never silently ignored (it used to answer the unfiltered list); two different values for a single-value name (status, contact_id, search, stale, needsAction, summary, latest_updated, system_occupancy, sort, order, page, per_page, value_min / minValue, value_max / maxValue) are 400 query_param_conflict { message, param }, an exact repeat is accepted. This tool sends only accepted names (pipeline, pipeline_name, stage, stage_name, assigned_to, status, include_parked, search, contact_timezone, view_id, page, per_page, sort, order, list_order, board_snapshot, board_columns, health_summary, health_check, health_limit, health_offset, health_cursor, health_rows_only), so these two codes mean an older or newer server than this MCP expects; they reach you as `Conduyt API 400: <message>` with the code. The API judges sort and order (batch32): an unknown sort field, or an order other than asc / desc, is 400 sort_invalid { message, param, accepted } (the sent spelling in param) and is never silently replaced by the default order. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param)." + " " + ROLE_COLUMNS_NOTE + " TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + LIST_USERS_DOC, {
65
65
  pipeline: z.string().optional().describe("Filter by pipeline UUID (canonical). Aliases: pipelineId, pipeline_id."),
66
66
  pipelineId: z.string().optional().describe("Filter by pipeline UUID (alias of pipeline)."),
67
67
  pipeline_id: z.string().optional().describe("snake_case alias of pipelineId."),
@@ -73,7 +73,9 @@ export function registerDealTools(server, client) {
73
73
  stageName: z.string().optional().describe("Filter by stage NAME within the pipeline — resolved to its UUID; errors if not found. Alias: stage_name."),
74
74
  stage_name: z.string().optional().describe("snake_case alias of stageName."),
75
75
  assignedTo: z.string().optional().describe("Filter by assigned user UUID"),
76
- status: z.enum(["open", "won", "lost"]).optional().describe("Filter by deal status"),
76
+ status: z.enum(["open", "won", "lost", "all"]).optional().describe("Filter by deal status. open = open WORK: a card in a finished-work stage (a stage with isParked, e.g. 'Handed Off') keeps status open but is NOT returned for open. all = every status (the same as omitting it). To read a rep's finished-work cards: stage=<that stage's id>, status all (or omitted), assignedTo=<rep>."),
77
+ include_parked: z.boolean().optional().describe("(stageparked53) true or false; the API's default is false = open work. With status open: true also returns the cards in a finished-work stage (isParked), i.e. every not-closed record (sent as include_parked=true); use it to find or share a card. Without status open it changes nothing, as in the API. Alias: includeParked."),
78
+ includeParked: z.boolean().optional().describe("camelCase alias of include_parked."),
77
79
  search: z.string().optional().describe("Search deal titles"),
78
80
  contact_timezone: contactTimezoneSchema,
79
81
  view_id: z.string().optional().describe("Apply this SAVED DEAL VIEW (a UUID from conduyt_list_deal_views; sent as view_id, the canonical name in the OpenAPI, which also documents the alias viewId): the list is the set the view defines, ANDed with every other filter given here (the API combines them; nothing is resolved by this tool). 404 when the view does not exist, is disabled or is not visible to you; 422 when its stored rules are invalid or unsupported; 400 for a blank or non-UUID id (forwarded as given). Works with health_summary and board_snapshot too."),
@@ -115,6 +117,13 @@ export function registerDealTools(server, client) {
115
117
  // prefer a non-blank original; else keep a blank so the server can reject it
116
118
  return present.find((v) => v.trim() !== "") ?? present[0];
117
119
  };
120
+ // include_parked is a boolean alias pair: two different values are a contradictory request, refused before any request
121
+ const coalesceBool = (label, ...vals) => {
122
+ const present = vals.filter((v) => v !== undefined);
123
+ if (new Set(present).size > 1)
124
+ throw new Error(`Conflicting ${label} values — pass only one.`);
125
+ return present[0];
126
+ };
118
127
  const { assignedTo, status, search, page, per_page } = a;
119
128
  const pipelineV = coalesce("pipeline id", a.pipeline, a.pipelineId, a.pipeline_id);
120
129
  const pipelineNameV = coalesce("pipeline name", a.pipelineName, a.pipeline_name);
@@ -133,6 +142,9 @@ export function registerDealTools(server, client) {
133
142
  params.set("assigned_to", assignedTo);
134
143
  if (status)
135
144
  params.set("status", status);
145
+ const includeParkedV = coalesceBool("include_parked", a.include_parked, a.includeParked);
146
+ if (includeParkedV === true)
147
+ params.set("include_parked", "true");
136
148
  if (search)
137
149
  params.set("search", search);
138
150
  appendContactTimezone(params, a.contact_timezone);
@@ -196,7 +208,7 @@ export function registerDealTools(server, client) {
196
208
  const result = qs ? await client.get("/api/v1/deals/inspection?" + qs) : await client.get("/api/v1/deals/inspection");
197
209
  return formatResult(result);
198
210
  }));
199
- strictInput(server.tool("conduyt_get_deals_forecast", "Weighted pipeline value and the probability forecast (GET /api/v1/deals/forecast): per pipeline and stage, the year's monthly open and won values, win rate. Needs deals.view (an API key needs the deals scope) and a Professional-or-above plan: a lower plan, a free trial included, is 403 code plan_required; an account whose billing is not active is 402. `pipeline` limits it to one pipeline (a UUID that is not one is 400; a hidden or unknown one is 404 Pipeline not found); omit it for every visible active pipeline. The API judges the query names: a name the route does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and every pipeline was forecast); this tool sends only `pipeline`. Read-only.", {
211
+ strictInput(server.tool("conduyt_get_deals_forecast", "Weighted pipeline value and the probability forecast (GET /api/v1/deals/forecast): per pipeline and stage, the year's monthly open and won values, win rate. Needs deals.view (an API key needs the deals scope) and a Professional-or-above plan: a lower plan, a free trial included, is 403 code plan_required; an account whose billing is not active is 402. `pipeline` limits it to one pipeline (a UUID that is not one is 400; a hidden or unknown one is 404 Pipeline not found); omit it for every visible active pipeline. The API judges the query names: a name the route does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and every pipeline was forecast); this tool sends only `pipeline`. (batch60, stageparked53) A finished-work stage (isParked) is not open work: it has no row in the stage breakdown and its cards are not in the totals or the weighted value (the answer's stage rows carry no isParked field); it still counts as a rung of the default probability ladder, so flagging a stage never renumbers the other stages' probabilities. Read-only.", {
200
212
  pipeline: z.string().uuid().optional().describe("Pipeline UUID; omit for every visible active pipeline."),
201
213
  }, async ({ pipeline }) => {
202
214
  // literal paths on purpose: the coverage scanner reads the first string after client.get(
@@ -242,7 +254,7 @@ export function registerDealTools(server, client) {
242
254
  const result = await client.post("/api/v1/tasks", { checkOrigin, dealId, expectedDealUpdatedAt, title, description, dueDate, priority, status, assignedTo, contactId }, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined);
243
255
  return formatResult(result);
244
256
  }));
245
- server.tool("conduyt_get_deal", "Get a single deal with full details — value, currency, probability, stage, contact, expected close date, custom-field values, activities, tasks, and history. Use this to read structured custom-field data back out of a deal (e.g. for a P&L or balance-sheet model). Deal rows also carry hasNextStep and nextAppointmentAt (null unless your key can view the calendar) when the API returns them." + MIRROR_READ_DOC + " " + USER_FIELD_READ_DOC, {
257
+ server.tool("conduyt_get_deal", "Get a single deal with full details — value, currency, probability, stage, contact, expected close date, custom-field values, activities, tasks, and history. Use this to read structured custom-field data back out of a deal (e.g. for a P&L or balance-sheet model). Deal rows also carry hasNextStep and nextAppointmentAt (null unless your key can view the calendar) when the API returns them. Every deal answer (list rows, get, create, update) carries stage.isParked: true = the card sits in a finished-work stage (done work, status open, in no open-work count)." + MIRROR_READ_DOC + " " + USER_FIELD_READ_DOC, {
246
258
  id: z.string().describe("Deal UUID"),
247
259
  }, async ({ id }) => {
248
260
  const result = await client.get(`/api/v1/deals/${id}`);
@@ -9,7 +9,7 @@ export const ARCHIVE_ERROR_CODES = "A refusal carries a machine-readable code in
9
9
  /** above the archive route's 60 s transaction (up to 500 deal moves) plus post-commit events; the client default is 30 s */
10
10
  export const ARCHIVE_PIPELINE_TIMEOUT_MS = 75_000;
11
11
  export function registerPipelineTools(server, client) {
12
- server.tool("conduyt_list_pipelines", "List all active sales pipelines with their stages (soft-deleted stages are never included). Use this to discover pipeline and stage UUIDs before creating or moving deals. Each stage carries entryByAutomationOnly (boolean; true = only an automation can move or create a deal INTO it, every other entry is refused 422 stage_automation_only; set it with conduyt_set_stage_rules). Each pipeline carries color (one of the 10 palette hex colours, or null until the settings page saves one), automationOnly and sortOrder (the board-menu order); an archived pipeline's pre-archive name is archivedFromName (see conduyt_list_archived_pipelines).", {}, async () => {
12
+ server.tool("conduyt_list_pipelines", "List all active sales pipelines with their stages (soft-deleted stages are never included). Use this to discover pipeline and stage UUIDs before creating or moving deals. Each stage carries isParked (boolean; true = a finished-work stage: its cards stay open records but are not open work; set it with conduyt_update_stage) and entryByAutomationOnly (boolean; true = only an automation can move or create a deal INTO it, every other entry is refused 422 stage_automation_only; set it with conduyt_set_stage_rules). Each pipeline carries color (one of the 10 palette hex colours, or null until the settings page saves one), automationOnly and sortOrder (the board-menu order); an archived pipeline's pre-archive name is archivedFromName (see conduyt_list_archived_pipelines).", {}, async () => {
13
13
  const result = await client.get("/api/v1/pipelines");
14
14
  return formatResult(result);
15
15
  });
@@ -30,6 +30,7 @@ export function registerPipelineTools(server, client) {
30
30
  isWon: z.boolean().optional().describe("Marks this as a won/closed-won stage"),
31
31
  isLost: z.boolean().optional().describe("Marks this as a lost/dead stage"),
32
32
  isSystem: z.boolean().optional().describe("A system holding stage (automation bridges route deals through it): hidden from the stage pickers reps use, still visible to automations"),
33
+ isParked: z.boolean().optional().describe("A finished-work stage (e.g. \"Handed Off\"): its cards keep status open (no Won / Lost side effects) and stay on the board with their own column count, but are not open work: not in open totals, ?status=open, stale / needs-next-action / pipeline health, aging, dashboard workload or the forecast. Never on a Won or Lost stage (400)."),
33
34
  }))
34
35
  .optional()
35
36
  .describe("Ordered list of stages to create with the pipeline. A stage cannot be both isWon and isLost."),
@@ -112,17 +113,19 @@ export function registerPipelineTools(server, client) {
112
113
  isWon: z.boolean().optional().describe("Marks this as a won stage"),
113
114
  isLost: z.boolean().optional().describe("Marks this as a lost/dead stage"),
114
115
  isSystem: z.boolean().optional().describe("A system holding stage (automation bridges route deals through it): hidden from the stage pickers reps use, still visible to automations"),
115
- }, async ({ pipelineId, name, color, isWon, isLost, isSystem }) => {
116
+ isParked: z.boolean().optional().describe("A finished-work stage (e.g. \"Handed Off\"): its cards keep status open (no Won / Lost side effects) and stay on the board with their own column count, but are not open work: not in open totals, ?status=open, stale / needs-next-action / pipeline health, aging, dashboard workload or the forecast. Never on a Won or Lost stage (400)."),
117
+ }, async ({ pipelineId, name, color, isWon, isLost, isSystem, isParked }) => {
116
118
  const result = await client.post(`/api/v1/pipelines/${pipelineId}/stages`, {
117
119
  name,
118
120
  color,
119
121
  isWon,
120
122
  isLost,
121
123
  isSystem,
124
+ isParked,
122
125
  });
123
126
  return formatResult(result);
124
127
  });
125
- server.tool("conduyt_update_stage", "Update a stage within a pipeline — rename, recolor, reorder (sortOrder), or change its won/lost/system flags. A soft-deleted stage (conduyt_delete_stage) answers 404. The \"Entry by automation only\" flag is not set here (the API reads it from the stage rules): use conduyt_set_stage_rules; conduyt_list_pipelines shows it as entryByAutomationOnly on each stage.", {
128
+ server.tool("conduyt_update_stage", "Update a stage within a pipeline — rename, recolor, reorder (sortOrder), or change its won/lost/system/finished-work (isParked) flags. A soft-deleted stage (conduyt_delete_stage) answers 404. The \"Entry by automation only\" flag is not set here (the API reads it from the stage rules): use conduyt_set_stage_rules; conduyt_list_pipelines shows it as entryByAutomationOnly on each stage.", {
126
129
  pipelineId: z.string().describe("Pipeline UUID"),
127
130
  stageId: z.string().describe("Stage UUID to update"),
128
131
  name: z.string().optional().describe("Updated stage name"),
@@ -131,6 +134,7 @@ export function registerPipelineTools(server, client) {
131
134
  isWon: z.boolean().optional().describe("Updated won flag"),
132
135
  isLost: z.boolean().optional().describe("Updated lost flag"),
133
136
  isSystem: z.boolean().optional().describe("Updated system flag: true hides the stage from rep-facing stage pickers (automation holding stage)"),
137
+ isParked: z.boolean().optional().describe("Updated finished-work flag. A finished-work stage (e.g. \"Handed Off\"): its cards keep status open (no Won / Lost side effects) and stay on the board with their own column count, but are not open work: not in open totals, ?status=open, stale / needs-next-action / pipeline health, aging, dashboard workload or the forecast. Never on a Won or Lost stage (400). To turn a finished-work stage Won or Lost, send isParked: false in the same call."),
134
138
  }, async ({ pipelineId, stageId, ...updates }) => {
135
139
  const result = await client.patch(`/api/v1/pipelines/${pipelineId}/stages/${stageId}`, updates);
136
140
  return formatResult(result);
@@ -1,3 +1,5 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { ConduytClient } from "../client.js";
3
+ /** (toggleon58 r3) what a merge does and the 409s it can answer (app POST /api/v1/tags/merge) */
4
+ export declare const MERGE_TAGS_DOC = "Merge two tags: moves every contact, deal and company from the source tag to the target and rewrites every reference to the source (automations, lists, views); the source stays as an alias of the target. Useful for deduplicating tags. Refused with NOTHING changed: 409 tag_merge_would_duplicate_enrollment when the merge would make two ACTIVE automations enroll the same contacts (the same drip campaign, on the same tag after the merge, or with a trigger that fires for every tag): the error names both, `automations` lists them; switch one off, then merge (an inactive duplicate is fine; two that already overlapped before the merge do not refuse it). 409 tag_merge_automations_changed: automations using these tags changed during the merge; nothing was merged, call again. 409 without a code, nothing changed (app/api/v1/tags/merge/route.ts): the source tag was already merged (list the tags again); the target tag was merged into another tag (merge into that tag instead); or an import side effect, or automation / outbox / drip work naming the tag, is running right now (the app says: ... retry the merge once they settle): wait, then call again.";
3
5
  export declare function registerTagTools(server: McpServer, client: ConduytClient): void;
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
+ /** (toggleon58 r3) what a merge does and the 409s it can answer (app POST /api/v1/tags/merge) */
4
+ export const MERGE_TAGS_DOC = "Merge two tags: moves every contact, deal and company from the source tag to the target and rewrites every reference to the source (automations, lists, views); the source stays as an alias of the target. Useful for deduplicating tags. Refused with NOTHING changed: 409 tag_merge_would_duplicate_enrollment when the merge would make two ACTIVE automations enroll the same contacts (the same drip campaign, on the same tag after the merge, or with a trigger that fires for every tag): the error names both, `automations` lists them; switch one off, then merge (an inactive duplicate is fine; two that already overlapped before the merge do not refuse it). 409 tag_merge_automations_changed: automations using these tags changed during the merge; nothing was merged, call again. 409 without a code, nothing changed (app/api/v1/tags/merge/route.ts): the source tag was already merged (list the tags again); the target tag was merged into another tag (merge into that tag instead); or an import side effect, or automation / outbox / drip work naming the tag, is running right now (the app says: ... retry the merge once they settle): wait, then call again.";
3
5
  export function registerTagTools(server, client) {
4
6
  server.tool("conduyt_list_tags", "List all tags in the account with contact counts. Use this to discover tag names and IDs.", {
5
7
  page: z.number().optional().describe("Page number (default 1)"),
@@ -34,8 +36,8 @@ export function registerTagTools(server, client) {
34
36
  const result = await client.del(`/api/v1/tags/${id}`);
35
37
  return formatResult(result);
36
38
  });
37
- server.tool("conduyt_merge_tags", "Merge two tags — moves all contacts from source tag to target tag, then deletes the source. Useful for deduplicating tags.", {
38
- sourceTagId: z.string().describe("Tag UUID to merge FROM (will be deleted)"),
39
+ server.tool("conduyt_merge_tags", MERGE_TAGS_DOC, {
40
+ sourceTagId: z.string().describe("Tag UUID to merge FROM (it becomes an alias of the target)"),
39
41
  targetTagId: z.string().describe("Tag UUID to merge INTO (will be kept)"),
40
42
  }, async (params) => {
41
43
  const result = await client.post("/api/v1/tags/merge", params);
@@ -1,3 +1,4 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { ConduytClient } from "../client.js";
3
+ export declare const SEND_ONCE_PREVIEW_NOTE = " A send_email step with a sendKey (config sendKey / sendKeyDays: at most once per contact per window, across automations) whose contact was already e-mailed under that key inside the window previews as skipped (detail 'Email would be skipped: already sent under the send key ...', compliance send_key_already_sent), as the run skips it; the preview reads the ledger and never claims.";
3
4
  export declare function registerWorkflowSandboxTools(server: McpServer, client: ConduytClient): void;
@@ -1,6 +1,7 @@
1
1
  import { ANSWER_USERS_DOC, WEBHOOK_NAME_TAG_DOC } from "./user-fields-doc.js";
2
2
  import { z } from "zod";
3
3
  import { formatResult } from "../client.js";
4
+ export const SEND_ONCE_PREVIEW_NOTE = " A send_email step with a sendKey (config sendKey / sendKeyDays: at most once per contact per window, across automations) whose contact was already e-mailed under that key inside the window previews as skipped (detail 'Email would be skipped: already sent under the send key ...', compliance send_key_already_sent), as the run skips it; the preview reads the ledger and never claims.";
4
5
  function unwrap(response) {
5
6
  if (response && typeof response === "object" && "data" in response) {
6
7
  return response.data;
@@ -27,7 +28,7 @@ export function registerWorkflowSandboxTools(server, client) {
27
28
  });
28
29
  return formatResult(result);
29
30
  });
30
- server.tool("conduyt_workflow_simulate", "Dry-run a saved automation against a real or stub contact. Returns a step-by-step trace of what WOULD happen — no messages sent, no tags applied, no side effects. Checks compliance (DNC, opt-outs), provider readiness (SMS/email configured), and condition evaluation. Use this to verify a workflow does what you expect before publishing. A deal occurrence needs dealId and a company occurrence needs companyId (see those fields). executionId (optional, admin or owner only) replays a stored run of this automation and supplies ONE fact, the company carried by that run's payload; the run must belong to this account and this automation with the same trigger event, contact and deal as the preview, and without executionId on a non-company occurrence the preview is a synthetic sample whose company rules evaluate as unknown/absent, which the response states." + ANSWER_USERS_DOC, {
31
+ server.tool("conduyt_workflow_simulate", "Dry-run a saved automation against a real or stub contact. Returns a step-by-step trace of what WOULD happen — no messages sent, no tags applied, no side effects. Checks compliance (DNC, opt-outs), provider readiness (SMS/email configured), and condition evaluation. Use this to verify a workflow does what you expect before publishing. A deal occurrence needs dealId and a company occurrence needs companyId (see those fields). executionId (optional, admin or owner only) replays a stored run of this automation and supplies ONE fact, the company carried by that run's payload; the run must belong to this account and this automation with the same trigger event, contact and deal as the preview, and without executionId on a non-company occurrence the preview is a synthetic sample whose company rules evaluate as unknown/absent, which the response states." + SEND_ONCE_PREVIEW_NOTE + ANSWER_USERS_DOC, {
31
32
  automationId: z.string().describe("Automation UUID to simulate"),
32
33
  contactId: z.string().optional().describe("Contact UUID to simulate against. If omitted, uses a stub contact with empty fields."),
33
34
  dealId: z.string().optional().describe("The event's deal for a DEAL occurrence (deal.created / stage_changed / won / lost / ...): REQUIRED, 400 without it (the contact's newest deal is never a substitute); must be a deal you can see (deals.view and pipeline visibility), 404 otherwise; refused (400) when the selected occurrence is not a deal event (UUID)"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.38",
3
+ "version": "4.105.40",
4
4
  "mcpName": "com.conduyt/mcp",
5
5
  "description": "MCP server for Conduyt CRM — expose CRM operations as AI-accessible tools",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-11-22T07:10:20.755Z",
2
+ "generatedAt": "2026-11-22T21:49:11.441Z",
3
3
  "toolCount": 452,
4
4
  "totalEndpoints": 1229,
5
5
  "counts": {