conduyt-mcp 4.105.37 → 4.105.38

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.
@@ -6,6 +6,8 @@ export declare const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: as
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
7
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
8
8
  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
+ /** (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).";
9
11
  /** GET /automations/:id answers { data: { ...automation, configRevision } } (jsonResponse wraps): the revision lives under `data` */
10
12
  export declare function configRevisionOf(raw: unknown): number | undefined;
11
13
  export declare function registerAutomationTools(server: McpServer, client: ConduytClient): void;
@@ -7,6 +7,8 @@ export const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: assign_to_
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
8
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
9
9
  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
+ /** (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).";
10
12
  /** GET /automations/:id answers { data: { ...automation, configRevision } } (jsonResponse wraps): the revision lives under `data` */
11
13
  export function configRevisionOf(raw) {
12
14
  const row = raw && typeof raw === "object" && "data" in raw ? raw.data : raw;
@@ -61,6 +63,7 @@ export function registerAutomationTools(server, client) {
61
63
  .optional()
62
64
  .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.)"),
63
65
  isActive: z.boolean().optional().describe("Enable or disable the automation"),
66
+ ifIdle: z.literal(true).optional().describe(IF_IDLE_DOC),
64
67
  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"),
65
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 + ""),
66
69
  schedule: z.string().optional().describe("Updated cron schedule"),
@@ -76,6 +79,17 @@ export function registerAutomationTools(server, client) {
76
79
  if (updates.actions !== undefined && updates.expectedConfigRevision === undefined) {
77
80
  return formatToolError("Replacing `actions` needs expectedConfigRevision: read the automation first (conduyt_get_automation) and pass its configRevision. Nothing was sent.");
78
81
  }
82
+ // (idleoff57) the conditional switch-off is exactly { isActive: false, ifIdle: true }: any other field beside it is refused by the
83
+ // API (400 invalid_if_idle); said here first, before anything is sent
84
+ if (updates.ifIdle !== undefined) {
85
+ const others = Object.keys(updates).filter((k) => k !== "ifIdle" && updates[k] !== undefined);
86
+ if (updates.isActive !== false || others.length !== 1) {
87
+ return formatToolError("ifIdle is the conditional switch-off: send only isActive false and ifIdle true (no other field). Nothing was sent.");
88
+ }
89
+ // (idleroute58) the conditional switch-off goes to its OWN endpoint, never the PATCH: an app build without the feature ignores
90
+ // ifIdle in a PATCH and switches off unconditionally, while it does not have this path at all (404 / 405, nothing changed)
91
+ return formatResult(await client.post(`/api/v1/automations/${id}/deactivate-if-idle`, {}));
92
+ }
79
93
  const result = await client.patch(`/api/v1/automations/${id}`, updates);
80
94
  return formatResult(result);
81
95
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.37",
3
+ "version": "4.105.38",
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,9 +1,9 @@
1
1
  {
2
- "generatedAt": "2026-11-22T01:49:36.170Z",
2
+ "generatedAt": "2026-11-22T07:10:20.755Z",
3
3
  "toolCount": 452,
4
- "totalEndpoints": 1228,
4
+ "totalEndpoints": 1229,
5
5
  "counts": {
6
- "covered": 401,
6
+ "covered": 402,
7
7
  "excluded": 376,
8
8
  "planned": 451,
9
9
  "uncategorized": 0
@@ -813,6 +813,12 @@
813
813
  "status": "planned",
814
814
  "reason": "automation subroutes beyond the workflow-builder tools (step-logs detail, node ops)"
815
815
  },
816
+ "POST /api/v1/automations/:id/deactivate-if-idle": {
817
+ "status": "covered",
818
+ "tools": [
819
+ "conduyt_update_automation"
820
+ ]
821
+ },
816
822
  "GET /api/v1/automations/:id/dependency-audit": {
817
823
  "status": "planned",
818
824
  "reason": "automation subroutes beyond the workflow-builder tools (step-logs detail, node ops)"