conduyt-mcp 4.112.1 → 4.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -137,7 +137,7 @@ export function registerAutomationTools(server, client) {
|
|
|
137
137
|
return formatResult(result);
|
|
138
138
|
}));
|
|
139
139
|
// (small88, live OpenAPI POST /automation-executions/{id}/recover) the recovery actions of a failed run
|
|
140
|
-
strictInput(server.tool("conduyt_recover_automation_execution", "Recover ONE failed run of an automation (POST /api/v1/automation-executions/{id}/recover; the id is the run's execution id). Only an owner or an admin may call it (403 for anyone else); another account's run, an unknown id and (for a key without the deals scope) a deal-bound run are all 404. action is required and is one of: retry (run the failed step's action again; it is QUEUED, not run in the request: answers 202 { queued: true, retryId, nextAt } and runs within a minute; refused with 422 when the run has no action step to run, e.g. a linear run, and with 409 for a branching step, which is never retried on its own), skip (give up on the failed step and carry on with the next one), resume (carry on from the failed step's continuation; skip and resume run inside the request and park durably at its deadline), recreate_carrier (a run that died before it started because its carrier could not be created: the carrier is re-created from the saved trigger, once, never twice), reconcile (a step whose retry already ran its action but whose recovery mark did not land: records it as recovered WITHOUT running anything again). retry, skip and resume work only on a run in status failed or completed_with_errors (otherwise 409 \"execution is not in a recoverable state\"; a stale call on a run whose only failed step was already recovered by its retry answers 200 { alreadyRecovered } and
|
|
140
|
+
strictInput(server.tool("conduyt_recover_automation_execution", "Recover ONE failed run of an automation (POST /api/v1/automation-executions/{id}/recover; the id is the run's execution id). Only an owner or an admin may call it (403 for anyone else); another account's run, an unknown id and (for a key without the deals scope) a deal-bound run are all 404. action is required and is one of: retry (run the failed step's action again; it is QUEUED, not run in the request: answers 202 { queued: true, retryId, nextAt } and runs within a minute; refused with 422 when the run has no action step to run, e.g. a linear run, and with 409 for a branching step, which is never retried on its own), skip (give up on the failed step and carry on with the next one), resume (carry on from the failed step's continuation; skip and resume run inside the request and park durably at its deadline), recreate_carrier (a run that died before it started because its carrier could not be created: the carrier is re-created from the saved trigger, once, never twice), reconcile (a step whose retry already ran its action but whose recovery mark did not land: records it as recovered WITHOUT running anything again). retry, skip and resume work only on a run in status failed or completed_with_errors (otherwise 409 \"execution is not in a recoverable state\"; a stale call on a run whose only failed step was already recovered by its retry answers 200 { recovered: false, alreadyRecovered: true } and runs nothing again; on a run the drip run reconciler owns whose retry handoff was still owed, the same answer also finishes that handoff (audited) and asks the reconciler to settle the run, best effort: finishedHandoff: true says the handoff was finished and runSettled says whether the run is now settled). Other 409 refusals, each with a code: automatic_retry_pending (the step is still retrying by itself; wait, answer carries nextRetryAt), retry_queued (a manual Retry is already queued), source_mark_unconfirmed (the step's retry ran its action but its mark did not land: use reconcile, never retry, skip or resume), nothing_to_reconcile, node_id_carrier_reencode_required. A run whose steps changed under the call answers 409 too: read it again and retry. AFTER THE CALL: skip and resume answer { ok, action, executed, reason, ambiguousEffects }. ambiguousEffects true, and a 500 \"Recovery ran but the execution could not be settled\", mean the step may already have sent something: inspect the run and its step log and reconcile; do NOT call retry, skip or resume again blindly (a repeat can duplicate an email, a text or a stage move). Not read-only and skip is irreversible (the failed step is rewritten as skipped): retry can run the step's action a second time (a text, an e-mail, a stage move), so check the run's step log before choosing. A recovery that completes is audited (automation_execution.recovered, best effort); the settlement-failure 500 below returns before that line. To stop a run instead, use conduyt_cancel_automation_run.", {
|
|
141
141
|
executionId: z.string().uuid().describe("The automation run (execution log) UUID to recover"),
|
|
142
142
|
action: z.enum(["retry", "skip", "resume", "recreate_carrier", "reconcile"]).describe("retry | skip | resume | recreate_carrier | reconcile (see the description)"),
|
|
143
143
|
}, async ({ executionId, action }) => {
|
|
@@ -15,15 +15,18 @@ export function normalizeRoutingSlug(raw) {
|
|
|
15
15
|
const slugField = z.string().refine((s) => normalizeRoutingSlug(s).length >= 3, "slug must be at least 3 characters once normalised (letters, numbers or hyphens)");
|
|
16
16
|
/** the route ignores a blank title on PATCH (a silent success) and refuses it on create: refuse it here for both */
|
|
17
17
|
const nonBlank = z.string().trim().min(1, "must not be blank");
|
|
18
|
+
/** (small99, Codex dripmcp69-r2 P3) the route trims a step's id, question and type and an option's label and value before it
|
|
19
|
+
* judges them (sanitizeSteps), so they are trimmed here first and sent trimmed (routeTo is left as given: the route keeps a
|
|
20
|
+
* blank one as "", a trimmed-away one would be dropped) */
|
|
18
21
|
const optionSchema = z.object({
|
|
19
|
-
label: z.string().min(1).describe("Option text shown to the visitor"),
|
|
20
|
-
value: z.string().min(1).describe("Option value"),
|
|
22
|
+
label: z.string().trim().min(1).describe("Option text shown to the visitor"),
|
|
23
|
+
value: z.string().trim().min(1).describe("Option value"),
|
|
21
24
|
routeTo: z.string().optional().describe("Where this answer routes (a booking page slug or path)"),
|
|
22
25
|
}).strict();
|
|
23
26
|
const stepSchema = z.object({
|
|
24
|
-
id: z.string().min(1).describe("Step id (unique within the form)"),
|
|
25
|
-
question: z.string().min(1).describe("The question text"),
|
|
26
|
-
type: z.enum(ROUTING_STEP_TYPES).describe("select, radio or text"),
|
|
27
|
+
id: z.string().trim().min(1).describe("Step id (unique within the form)"),
|
|
28
|
+
question: z.string().trim().min(1).describe("The question text"),
|
|
29
|
+
type: z.preprocess((v) => (typeof v === "string" ? v.trim() : v), z.enum(ROUTING_STEP_TYPES)).describe("select, radio or text"),
|
|
27
30
|
options: z.array(optionSchema).optional().describe("The choices of a select / radio step"),
|
|
28
31
|
required: z.boolean().optional().describe("Required (default true)"),
|
|
29
32
|
}).strict();
|
package/dist/tools/calls.js
CHANGED
|
@@ -141,7 +141,7 @@ export function registerCallTools(server, client) {
|
|
|
141
141
|
return formatResult(result);
|
|
142
142
|
});
|
|
143
143
|
// (mcprings71 r1 P2) strict: an unknown key (a typo such as contactID) is refused, never stripped into an unfiltered list
|
|
144
|
-
strictInput(server.tool("conduyt_list_lead_rings", "List the \"Ring the team for this lead\" rings, newest first (GET /api/v1/lead-rings, app shotgun50): who was rung, who answered, when. Each row: { id, contactId, dealId (null to a key without the deals scope), automationId (the automation that rang the team), status (open | won | expired: expired = ended without a winner, i.e. nobody answered in time, the lead could not be assigned, nobody could be rung, or the run stopped; an open ring past its time reads expired), answeredBy (the user who answered, or null), answeredAt, rung (the user ids rung), notRung ([{ userId, reason }]: the step's people left out BEFORE the ring was placed and why, e.g. not available, today's limit reached, over the ring limit; a leg that then failed to place, or was still waiting to be placed when the ring closed or ran out of time, is not listed here (nor in rung; a leg whose placement completed is in rung, even when it completed after the ring closed), so notRung is not the complete inverse of rung), createdAt, endsAt (null
|
|
144
|
+
strictInput(server.tool("conduyt_list_lead_rings", "List the \"Ring the team for this lead\" rings, newest first (GET /api/v1/lead-rings, app shotgun50): who was rung, who answered, when. Each row: { id, contactId, dealId (null to a key without the deals scope), automationId (the automation that rang the team), status (open | won | expired: expired = ended without a winner, i.e. nobody answered in time, the lead could not be assigned, nobody could be rung, or the run stopped; an open ring past its time reads expired), answeredBy (the user who answered, or null), answeredAt, rung (the user ids rung), notRung ([{ userId, reason }]: the step's people left out BEFORE the ring was placed and why, e.g. not available, today's limit reached, over the ring limit; a leg that then failed to place, or was still waiting to be placed when the ring closed or ran out of time, is not listed here (nor in rung; a leg whose placement completed is in rung, even when it completed after the ring closed), so notRung is not the complete inverse of rung), createdAt, endsAt (null whenever no deadline was established, including during placement and for some finished rings), cancelFailed (true: cancelling the other phones failed at its bound, they rang on until the ring time was up) }. Owners and admins see every ring; anyone else sees only the rings that rang them. Filters: contactId (one lead), status, limit 1-100 (default 25). Read-only; requires dialer:view. Answering a ring is a person's softphone only (an API key cannot answer).", {
|
|
145
145
|
contactId: z.string().uuid().optional().describe("Only this lead's rings (contact UUID)"),
|
|
146
146
|
status: z.enum(["open", "won", "expired"]).optional().describe("open (still ringing), won (someone answered) or expired (ended without a winner: nobody answered in time, the lead could not be assigned, nobody could be rung, or the run stopped)"),
|
|
147
147
|
limit: z.number().int().min(1).max(100).optional().describe("Rows, 1-100 (default 25)"),
|
package/dist/tools/deals.js
CHANGED
|
@@ -374,7 +374,7 @@ export function registerDealTools(server, client) {
|
|
|
374
374
|
const result = await client.post(`/api/v1/deals/${dealId}/tags`, { tagIds });
|
|
375
375
|
return formatResult(result);
|
|
376
376
|
});
|
|
377
|
-
strictInput(server.tool("conduyt_remove_deal_tag", "Take ONE tag off a deal (DELETE /api/v1/deals/{dealId}/tags/{tagId}; permission deals.edit and an active billing plan). tagId is the tag's UUID (a merged tag's old id also works: the tag actually removed comes back as tagId). Answers { dealId, tagId, deleted: true }. A deal you cannot see or edit, an unknown deal and a tag that is not on the deal are all 404 (\"Tag assignment not found\" for the last); nothing is changed then. The tag itself is not deleted and other deals keep it. What it fires: the deal.updated event with action tag_removed (app event, customer webhooks and deal.updated automations) and one deal.tag_removed audit line; it writes no timeline activity and no contact.tag_removed event (those belong to a CONTACT's tags: use conduyt_update_contact removeTags for those). The twin of conduyt_add_deal_tags.", {
|
|
377
|
+
strictInput(server.tool("conduyt_remove_deal_tag", "Take ONE tag off a deal (DELETE /api/v1/deals/{dealId}/tags/{tagId}; permission deals.edit and an active billing plan). tagId is the tag's UUID (a merged tag's old id also works: the tag actually removed comes back as tagId). Answers { dealId, tagId, deleted: true }. A deal you cannot see or edit, an unknown deal and a tag that is not on the deal are all 404 (\"Tag assignment not found\" for the last); nothing is changed then. A tag merged or deleted during the call answers a retryable 409 (\"A tag in this request was merged or deleted a moment ago — retry\", no code): nothing was changed, so re-read the deal's tags and run it again. The tag itself is not deleted and other deals keep it. What it fires: the deal.updated event with action tag_removed (app event, customer webhooks and deal.updated automations) and one deal.tag_removed audit line (best effort: a failed audit write is logged and does not fail the call); it writes no timeline activity and no contact.tag_removed event (those belong to a CONTACT's tags: use conduyt_update_contact removeTags for those). The twin of conduyt_add_deal_tags.", {
|
|
378
378
|
dealId: z.string().uuid().describe("Deal UUID"),
|
|
379
379
|
tagId: z.string().uuid().describe("The tag's UUID to take off the deal"),
|
|
380
380
|
}, async ({ dealId, tagId }) => {
|
|
@@ -12,15 +12,19 @@ export const DRIP_COMPLIANCE_PROFILES = ["twilio_10dlc", "gsm", "email_only"];
|
|
|
12
12
|
const SLUG_RE = /^[a-z0-9][a-z0-9_]{0,79}$/;
|
|
13
13
|
// the routes trim a name before they test it, so a padded slug is valid input: trim first, then the rule
|
|
14
14
|
const slug = z.string().trim().regex(SLUG_RE, "lowercase machine slug: letters, numbers and underscores, max 80");
|
|
15
|
-
/**
|
|
15
|
+
/** (small99, Codex dripmcp69-r2 P3) the create / update routes trim channel and compliance_profile before the list check
|
|
16
|
+
* (lib/status-taxonomy-validation.ts readString), so a padded value is judged and sent trimmed, never refused first */
|
|
17
|
+
const trimmedEnum = (values) => z.preprocess((v) => (typeof v === "string" ? v.trim() : v), z.enum(values));
|
|
18
|
+
/** one step as the STEP IMPORT validates it (POST /drip-tracks/import-steps only; (small99) its strings are trimmed before the
|
|
19
|
+
* bound / format check as the route does; channel is a plain enum there, so not trimmed). Create and update store ANY JSON array
|
|
16
20
|
* (the route only requires an array), so they take free-form steps: a track read back from the API always round-trips. */
|
|
17
21
|
const stepSchema = z.object({
|
|
18
22
|
dayOffset: z.number().int().min(0).describe("Days after entry; steps must be in ascending order"),
|
|
19
|
-
timeWindow: z.string().max(50).nullable().optional().describe("Send window text, e.g. '09:00-17:00'"),
|
|
23
|
+
timeWindow: z.string().trim().max(50).nullable().optional().describe("Send window text, e.g. '09:00-17:00'"),
|
|
20
24
|
channel: z.enum(DRIP_TRACK_CHANNELS).describe("sms, email or both"),
|
|
21
|
-
templateId: z.string().max(200).nullable().optional().describe("Template id"),
|
|
22
|
-
templateBody: z.string().max(10000).nullable().optional().describe("Inline template body"),
|
|
23
|
-
mergeTags: z.array(z.string().regex(/^\$\[[A-Za-z0-9_.-]+\]$/, "Merge tags use the $[tag] format")).max(100).optional().describe("Merge tags in $[tag] format"),
|
|
25
|
+
templateId: z.string().trim().max(200).nullable().optional().describe("Template id"),
|
|
26
|
+
templateBody: z.string().trim().max(10000).nullable().optional().describe("Inline template body"),
|
|
27
|
+
mergeTags: z.array(z.string().trim().regex(/^\$\[[A-Za-z0-9_.-]+\]$/, "Merge tags use the $[tag] format")).max(100).optional().describe("Merge tags in $[tag] format"),
|
|
24
28
|
}).strict();
|
|
25
29
|
const TRACK_ERRORS = "Refusals are the server's: 400 with the reason (name must be a lowercase slug, channel / compliance_profile not one of the listed values, steps must be a JSON array, exit_conditions must be a JSON object or array), 404 'Drip track not found' (no such track in your account), 409 'A drip track with this name already exists'.";
|
|
26
30
|
export function registerDripTrackTools(server, client) {
|
|
@@ -31,8 +35,8 @@ export function registerDripTrackTools(server, client) {
|
|
|
31
35
|
strictInput(server.tool("conduyt_create_drip_track", "Create a drip track (POST /api/v1/drip-tracks; settings:edit, active billing). name (a lowercase slug) and label are required; channel defaults to both, complianceProfile to twilio_10dlc, steps to none, reEntryAllowed to false, isActive to true. " + TRACK_ERRORS, {
|
|
32
36
|
name: slug.describe("Machine slug, e.g. 'new_lead_nurture' (unique per account)"),
|
|
33
37
|
label: z.string().trim().min(1).describe("Display label"),
|
|
34
|
-
channel:
|
|
35
|
-
complianceProfile:
|
|
38
|
+
channel: trimmedEnum(DRIP_TRACK_CHANNELS).optional().describe("sms, email or both (default both)"),
|
|
39
|
+
complianceProfile: trimmedEnum(DRIP_COMPLIANCE_PROFILES).optional().describe("twilio_10dlc (default), gsm or email_only"),
|
|
36
40
|
steps: z.array(z.unknown()).optional().describe("Ordered steps: any JSON array the route stores (the step import is the typed form: dayOffset ascending, channel, templateId, templateBody, mergeTags)"),
|
|
37
41
|
exitConditions: z.union([z.record(z.unknown()), z.array(z.unknown())]).optional().describe("Exit conditions: a JSON object or array"),
|
|
38
42
|
reEntryAllowed: z.boolean().optional().describe("May a contact enter the track again (default false)"),
|
|
@@ -44,8 +48,8 @@ export function registerDripTrackTools(server, client) {
|
|
|
44
48
|
id: z.string().uuid().describe("Drip track UUID"),
|
|
45
49
|
name: slug.optional().describe("Machine slug"),
|
|
46
50
|
label: z.string().trim().min(1).optional().describe("Display label"),
|
|
47
|
-
channel:
|
|
48
|
-
complianceProfile:
|
|
51
|
+
channel: trimmedEnum(DRIP_TRACK_CHANNELS).optional().describe("sms, email or both"),
|
|
52
|
+
complianceProfile: trimmedEnum(DRIP_COMPLIANCE_PROFILES).optional().describe("twilio_10dlc, gsm or email_only"),
|
|
49
53
|
steps: z.array(z.unknown()).optional().describe("The full ordered step list (replaces the stored one; any JSON array, [] clears every step)"),
|
|
50
54
|
exitConditions: z.union([z.record(z.unknown()), z.array(z.unknown())]).optional().describe("Exit conditions: a JSON object or array"),
|
|
51
55
|
reEntryAllowed: z.boolean().optional().describe("May a contact enter the track again"),
|
package/dist/tools/messaging.js
CHANGED
|
@@ -88,7 +88,8 @@ export function registerMessagingTools(server, client) {
|
|
|
88
88
|
const result = await client.post("/api/v1/messages/sms/send", params);
|
|
89
89
|
return formatResult(result);
|
|
90
90
|
});
|
|
91
|
-
|
|
91
|
+
// (r2, Codex r1 P2) strict: a misspelled argument (idempotency_key) is refused, never stripped into an unkeyed send
|
|
92
|
+
strictInput(server.tool("conduyt_send_email", "Send a single email to a contact. Requires either HTML or plain text body. Subject line max 998 characters. idempotencyKey (optional, 1-255 printable ASCII, trimmed) is sent as the Idempotency-Key header: one key per e-mail, reused ONLY to retry the SAME request whose answer you did not see; the SAME key replays the first answer, never a second e-mail. Without a key, every call is a new e-mail. Answers under a key and what to do: 422 idempotency_request_conflict (a different body under this key: the key is bound to the first request; verify it, then a NEW key); 409 idempotency_in_progress (the first attempt is still running: wait Retry-After, then the SAME key); 409 idempotency_key_spent (an earlier attempt failed or has an unknown outcome: check whether the e-mail went out BEFORE a NEW key; the same key only repeats this 409); 409 idempotency_conflict_retry (nothing ran: the SAME key); 503 idempotency_claim_held (a failed attempt's claim could not be released: a NEW key, never the same); 503 idempotency_outcome_unknown (the send may have gone through: verify before any new key); 503 send_not_attempted (the server was busy before the provider was called: nothing was sent, but a keyed request has SPENT its key: retry with a NEW key); 400 idempotency_key_invalid (a blank or malformed key). Spend and release: every executed attempt spends the key, success or not; a refusal that fires before anything is read or written for the request itself (an invalid body, a lookup that comes back empty, mismatched or inaccessible) releases it, so the SAME key may be retried once the request is corrected; a proven pre-wire refusal whose settlement failed is released only once the row is confirmed disarmed (pre_wire_failure_unrecorded), otherwise the key stays spent as idempotency_outcome_unknown.", {
|
|
92
93
|
to: z.string().describe("Recipient email address"),
|
|
93
94
|
subject: z.string().describe("Email subject line (max 998 chars)"),
|
|
94
95
|
html: z.string().optional().describe("HTML email body (sanitized server-side)"),
|
|
@@ -98,10 +99,14 @@ export function registerMessagingTools(server, client) {
|
|
|
98
99
|
cc: z.array(z.string()).optional().describe("CC email addresses"),
|
|
99
100
|
bcc: z.array(z.string()).optional().describe("BCC email addresses"),
|
|
100
101
|
dealId: attemptDealId(),
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
// (small100, S22) the route's wide key contract (lib/api-required-headers.ts POST /api/v1/email/send)
|
|
103
|
+
// (r2, Codex r1 P3) trimmed first: the route trims the header before it judges it (lib/idempotency.ts)
|
|
104
|
+
idempotencyKey: z.string().trim().regex(/^[!-~](?:[ -~]{0,253}[!-~])?$/, "idempotencyKey must be 1-255 printable ASCII characters, not blank").optional().describe("Sent as the Idempotency-Key header: one key per e-mail, reused ONLY to retry the SAME request"),
|
|
105
|
+
}, async ({ idempotencyKey, ...params }) => {
|
|
106
|
+
// the key is a header, never a body field (the route's body schema is strict)
|
|
107
|
+
const result = await client.post("/api/v1/email/send", params, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined);
|
|
103
108
|
return formatResult(result);
|
|
104
|
-
});
|
|
109
|
+
}));
|
|
105
110
|
server.tool("conduyt_get_conversation", "Read the full conversation thread for one contact — the chronological SMS/email message history (both inbound replies and outbound sends), plus conversation state, unread count, and recent notes. Use this to see what a contact has replied before deciding how to follow up. Requires communications:view.", {
|
|
106
111
|
contactId: z.string().describe("Contact UUID whose conversation to read"),
|
|
107
112
|
channel: z.string().optional().describe("Filter to one channel, e.g. 'sms' or 'email' (omit for all channels)"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conduyt-mcp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.113.0",
|
|
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",
|
|
@@ -24,12 +24,17 @@
|
|
|
24
24
|
"build": "tsc",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
26
|
"test": "node --import tsx --test \"src/**/*.test.ts\"",
|
|
27
|
-
"prepublishOnly": "npm run check:version &&
|
|
27
|
+
"prepublishOnly": "npm run check:version && node scripts/publish-gate.mjs && npm run build && ENFORCE=1 node scripts/verify-contracts.mjs && ENFORCE=1 node scripts/verify-coverage.mjs",
|
|
28
|
+
"publish:gate": "node scripts/publish-gate.mjs",
|
|
28
29
|
"audit:contracts": "node scripts/verify-contracts.mjs",
|
|
29
30
|
"audit:coverage": "node scripts/verify-coverage.mjs",
|
|
30
31
|
"contracts:refresh": "node scripts/refresh-contracts.mjs",
|
|
31
32
|
"check:version": "node scripts/check-version-sync.mjs"
|
|
32
33
|
},
|
|
34
|
+
"publishGate": {
|
|
35
|
+
"steps": [],
|
|
36
|
+
"test": "node --import tsx --test {reporter} \"src/**/*.test.ts\""
|
|
37
|
+
},
|
|
33
38
|
"keywords": [
|
|
34
39
|
"mcp",
|
|
35
40
|
"model-context-protocol",
|