conduyt-mcp 4.112.1 → 4.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/tool-annotations.js +1 -0
- package/dist/tools/automations.js +2 -2
- package/dist/tools/booking-routing-forms.js +8 -5
- package/dist/tools/calls.js +1 -1
- package/dist/tools/custom-fields.js +8 -0
- package/dist/tools/deals.js +1 -1
- package/dist/tools/drip-tracks.js +13 -9
- package/dist/tools/messaging.js +9 -4
- package/package.json +7 -2
- package/scripts/coverage-matrix.json +7 -5
package/README.md
CHANGED
|
@@ -316,6 +316,7 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
|
|
|
316
316
|
| Tool | Description |
|
|
317
317
|
|------|-------------|
|
|
318
318
|
| `conduyt_list_custom_fields` | List custom field definitions (contact/deal) |
|
|
319
|
+
| `conduyt_get_formula_context` | The day and time zone formula fields are computed with (TODAY(), date-and-time inputs) |
|
|
319
320
|
| `conduyt_create_custom_field` | Create a custom field (text, number, date, select, etc.) |
|
|
320
321
|
| `conduyt_update_custom_field` | Update label, options, or required status |
|
|
321
322
|
| `conduyt_delete_custom_field` | Delete a custom field |
|
package/dist/tool-annotations.js
CHANGED
|
@@ -323,6 +323,7 @@ export const TOOL_ANNOTATIONS = {
|
|
|
323
323
|
conduyt_set_chat_notifications: update("Set Chat Notifications"),
|
|
324
324
|
conduyt_update_team_chat_settings: update("Update Team Chat Settings"),
|
|
325
325
|
conduyt_list_custom_fields: ro("List Custom Fields"),
|
|
326
|
+
conduyt_get_formula_context: ro("Get Formula Context"),
|
|
326
327
|
conduyt_create_custom_field: create("Create Custom Field"),
|
|
327
328
|
conduyt_create_mirror_field: create("Create Deal Mirror Field"),
|
|
328
329
|
conduyt_update_custom_field: update("Update Custom Field"),
|
|
@@ -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 }) => {
|
|
@@ -167,7 +167,7 @@ export function registerAutomationTools(server, client) {
|
|
|
167
167
|
: await client.get(`/api/v1/automations/step-logs?${params}`);
|
|
168
168
|
return formatResult(result);
|
|
169
169
|
}));
|
|
170
|
-
strictInput(server.tool("conduyt_test_automation_node", "Test ONE node of a workflow against a real contact and see what it WOULD do (POST /api/v1/automations/{automationId}/test-node). It is a pure simulation: nothing is sent, no contact or deal is changed and no run is created, so it is read-only and safe to repeat;
|
|
170
|
+
strictInput(server.tool("conduyt_test_automation_node", "Test ONE node of a workflow against a real contact and see what it WOULD do (POST /api/v1/automations/{automationId}/test-node). It is a pure simulation: nothing is sent, no contact or deal is changed and no run is created, so it is read-only and safe to repeat; It changes no CRM data; normal API usage and rate-limit telemetry still update (the per-user rate-limit counter, 30 calls a minute, 429 beyond it, and an API key's last-used time and usage counters). Only graph (v2) workflows can be tested (422 otherwise; 422 also for a malformed saved graph or one with no trigger occurrence to simulate). nodeId is required (404 when the graph has no such node). contactId names the subject contact (a contact you may not see is 404); triggerNodeId picks which trigger occurrence to simulate; dealId (needed for a deal-triggered occurrence, refused with 400 for one that is not), companyId (company-triggered), previousStageId / previousPipelineId (a simulated deal move's origin), executionId (replay a stored run's payload; owner or admin only) and appointmentId (needs the calendar view permission) complete the occurrence. Answers { automationId, nodeId, contactId, triggerEvent, triggerNodeId, step } where step says the outcome (e.g. would run, would fail, skipped) and why. 409 means the test cannot judge it honestly (the trigger's filter rejects this sample, a find step or a step output decides it, a needed subject is missing); the message says which. Needs the automations view permission; a hidden deal automation is 404. As a POST it needs a write-tier API key (a read-tier key is refused at the scope gate, although the test changes nothing). It never runs the workflow for real." + ANSWER_USERS_DOC, {
|
|
171
171
|
automationId: z.string().uuid().describe("The workflow's UUID"),
|
|
172
172
|
nodeId: z.string().min(1).max(100).describe("The node to test (its id in the workflow graph)"),
|
|
173
173
|
contactId: z.string().uuid().optional().describe("The subject contact (UUID)"),
|
|
@@ -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)"),
|
|
@@ -11,6 +11,14 @@ const SECURE_NOTE = "Secure fields (isSecure): every read, export and outbound p
|
|
|
11
11
|
const revealRoles = z.array(z.string().min(1).max(40)).max(10).optional().describe("Roles whose members may reveal a Secure value (max 10, 1 to 40 characters each; a super admin always; an API key never)");
|
|
12
12
|
const revealGroupIds = z.array(z.string().uuid()).max(20).optional().describe("Team group UUIDs whose members may reveal a Secure value (max 20)");
|
|
13
13
|
export function registerCustomFieldTools(server, client) {
|
|
14
|
+
// (formulaparity, app batch67 formulaedit67) the day and zone a formula field is computed with; the route refuses any query parameter
|
|
15
|
+
server.tool("conduyt_get_formula_context", "Read the day and time zone this workspace's FORMULA custom fields are computed with (GET /custom-fields/formula-context): answers { today: YYYY-MM-DD, timeZone: an IANA zone }. "
|
|
16
|
+
+ "It is the server's own resolver, the one every record read, export and render uses: the workspace's time-zone setting first, then the account's stored zone when it is not the schema default, then the platform default; today is that zone's calendar day now. "
|
|
17
|
+
+ "Use it to predict a formula's value: TODAY() is this day, and a date-and-time input counts as its day in this zone (a plain date input is its stored day). "
|
|
18
|
+
+ "Read-only, no record data, any signed-in member. It takes no input: the route answers 400 unexpected_query_parameter to any query parameter, and 404 when the account is not found.", {}, async () => {
|
|
19
|
+
const result = await client.get("/api/v1/custom-fields/formula-context");
|
|
20
|
+
return formatResult(result);
|
|
21
|
+
});
|
|
14
22
|
server.tool("conduyt_list_custom_fields", "List custom field definitions. Filter by entity type (contact, deal, or company) to see available fields. Every row carries optionCount: the ACTIVE rows of a store-backed select (options.optionList \"store\"; its options read { optionList, allowOther }, the list is read with conduyt_search_custom_field_options), the choices count of an inline select / radio / multiselect, null for every other type; a single-definition answer does not carry it.", {
|
|
15
23
|
entityType: z.enum(["contact", "deal", "company"]).optional().describe("Filter by entity type"),
|
|
16
24
|
page: z.number().optional().describe("Page number (default 1)"),
|
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.114.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",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedAt": "2026-11-27T09:25:44.095Z",
|
|
3
|
-
"toolCount":
|
|
3
|
+
"toolCount": 525,
|
|
4
4
|
"totalEndpoints": 1246,
|
|
5
5
|
"counts": {
|
|
6
|
-
"covered":
|
|
6
|
+
"covered": 471,
|
|
7
7
|
"excluded": 384,
|
|
8
|
-
"planned":
|
|
8
|
+
"planned": 391,
|
|
9
9
|
"uncategorized": 0
|
|
10
10
|
},
|
|
11
11
|
"matrix": {
|
|
@@ -2688,8 +2688,10 @@
|
|
|
2688
2688
|
"reason": "custom field admin beyond read"
|
|
2689
2689
|
},
|
|
2690
2690
|
"GET /api/v1/custom-fields/formula-context": {
|
|
2691
|
-
"status": "
|
|
2692
|
-
"
|
|
2691
|
+
"status": "covered",
|
|
2692
|
+
"tools": [
|
|
2693
|
+
"conduyt_get_formula_context"
|
|
2694
|
+
]
|
|
2693
2695
|
},
|
|
2694
2696
|
"GET /api/v1/dashboard": {
|
|
2695
2697
|
"status": "covered",
|