conduyt-mcp 4.105.18 → 4.105.19

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.
@@ -2,6 +2,7 @@ import { annotateRegistrations } from "./tool-annotations.js";
2
2
  import { registerDiscoveryTools } from "./tools/discovery.js";
3
3
  import { registerContactTools } from "./tools/contacts.js";
4
4
  import { registerDealTools } from "./tools/deals.js";
5
+ import { registerDealProfileTools } from "./tools/deal-profile.js";
5
6
  import { registerTaskTools } from "./tools/tasks.js";
6
7
  import { registerPipelineTools } from "./tools/pipelines.js";
7
8
  import { registerActivityTools } from "./tools/activities.js";
@@ -67,6 +68,7 @@ export function registerAllTools(server, client) {
67
68
  registerDiscoveryTools(server, client);
68
69
  registerContactTools(server, client);
69
70
  registerDealTools(server, client);
71
+ registerDealProfileTools(server, client);
70
72
  registerTaskTools(server, client);
71
73
  registerPipelineTools(server, client);
72
74
  registerActivityTools(server, client);
@@ -155,6 +155,16 @@ export const TOOL_ANNOTATIONS = {
155
155
  conduyt_get_invoice_reminders: ro("Get Invoice Reminders"),
156
156
  conduyt_set_invoice_reminders_paused: create("Set Invoice Reminders Paused"), // not idempotent by the parity26 ruling: the same value again changes nothing but still appends an audit record (invoices/[id]/reminders/route.ts)
157
157
  conduyt_get_invoice_billing_summary: ro("Get Invoice Billing Summary"),
158
+ // (parity28, batch28) the Deal profile and the partner push
159
+ conduyt_get_deal_profile: ro("Get Deal Profile"),
160
+ conduyt_update_deal_profile: update("Update Deal Profile"), // PATCH of the primary contact's bound fields; idempotent: the route skips identical values and audits only a real write (profile/route.ts, Codex parity28-r1 P2)
161
+ conduyt_reveal_deal_profile_field: create("Reveal Deal Profile Field"), // a GET that appends the audit row deal_profile.reveal on every reveal of a stored value, so it is not read-only (Codex mcp359 policy)
162
+ conduyt_get_deal_profile_settings: ro("Get Deal Profile Settings"),
163
+ conduyt_set_deal_profile_settings: row("Set Deal Profile Settings", false, true, false), // PUT replaces the whole binding; not idempotent: every save appends settings_deal_profile_updated (Codex parity28-r1 P2)
164
+ conduyt_remove_deal_profile_settings: row("Remove Deal Profile Settings", false, true, false), // PUT dealProfile null discards the stored binding; every call appends the audit row
165
+ conduyt_get_deal_partner_pushes: ro("Get Deal Partner Pushes"),
166
+ conduyt_preview_deal_partner_push: ro("Preview Deal Partner Push"),
167
+ conduyt_push_deal_to_partner: create("Push Deal to Partner"), // sends the card to the partner; non-destructive to CRM data, not idempotent (every executed press is a new attempt)
158
168
  conduyt_list_tax_rates: ro("List Tax Rates"),
159
169
  conduyt_create_tax_rate: create("Create Tax Rate"),
160
170
  conduyt_update_tax_rate: update("Update Tax Rate"),
@@ -0,0 +1,6 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /** (parity28, batch28) the Deal profile (the deal page's tabs of the primary contact's bound fields), the partner push and the workspace binding. */
4
+ export declare const PUSH_PARTNERS: readonly ["creditors_relief", "delancey_street"];
5
+ export declare const PUSH_ACTIONS: readonly ["create", "update"];
6
+ export declare function registerDealProfileTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ import { strictInput } from "./strict.js";
4
+ /** (parity28, batch28) the Deal profile (the deal page's tabs of the primary contact's bound fields), the partner push and the workspace binding. */
5
+ export const PUSH_PARTNERS = ["creditors_relief", "delancey_street"];
6
+ export const PUSH_ACTIONS = ["create", "update"];
7
+ const PROFILE_KEYS_MAX = 100;
8
+ const KEY_MAX = 100;
9
+ const PATCH_CODES = "400 profile_key_not_bound (keys lists them), profile_field_invalid (key), deal_profile_not_enabled, invalid_body; 403 deal_not_editable or contacts_permission_required; 404 deal not found; 409 profile_field_changed { key, current } (nothing written), profile_conflict or deal_has_no_contact; 422 stage_automation_only (the card sits in a stage only automation may change; nothing written); 503 profile_busy (the contact stayed locked; nothing written, retry after the Retry-After seconds).";
10
+ const PUSH_CODES = "403 deal_not_editable / push_not_permitted; 404; 409 partner_disabled, partner_not_enabled, push_in_flight, needs_link, action_changed (the current state comes back), deal_has_no_contact, contact_busy, reconcile_needs_admin, reconcile_ambiguous; 422 profile_incomplete (missing[] names each gap; nothing written, no partner call) or stage_automation_only (the card sits in a stage only automation may change); 503 deal_busy or partner_auth.";
11
+ /** fields: 1 to 100 keys; expected: any number of keys (the server caps only fields); both: key length 1 to 100 */
12
+ const keyed = (min, max) => z.record(z.string().min(1).max(KEY_MAX), z.unknown()).refine((o) => Object.keys(o).length >= min && Object.keys(o).length <= max, { message: `must hold ${min} to ${max} keys` });
13
+ export function registerDealProfileTools(server, client) {
14
+ const dealId = z.string().uuid().describe("Deal UUID");
15
+ server.tool("conduyt_get_deal_profile", "Read a deal's Deal profile (GET /api/v1/deals/{id}/profile): the CONTACT custom fields the workspace binds in settings.dealProfile, read from the card's PRIMARY contact (one value per contact; nothing is stored on the deal), arranged in tabs, plus the partner readiness (ready of total: readiness fields are needed to send to a partner, never to save or work the card). { enabled: false } when the workspace has no binding or the card is outside its pipelines. A sensitive field is answered masked (last 4); conduyt_reveal_deal_profile_field returns the full value. Every answer carries cardKey, the same value the deal read answers as profileCardKey. Needs deals:view on the card (an API key needs the deals AND contacts scopes). 404 when the deal does not exist or the caller cannot see it.", { id: dealId }, async ({ id }) => formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/profile`)));
16
+ strictInput(server.tool("conduyt_update_deal_profile", `Edit Deal profile fields (PATCH /api/v1/deals/{id}/profile): writes the bound CONTACT custom fields of the card's primary contact through the contact write path (partial merge of only the submitted keys, audited as contact.updated). Needs deals:edit, the card's edit scope AND contacts:edit. fields: bound contact field key -> new value (1 to 100 keys; null clears). expected (optional): key -> the value you last saw (a sensitive field's token from conduyt_get_deal_profile, never its mask); every supplied key is checked under the contact lock, a mismatch answers 409 profile_field_changed with the current value and NOTHING is written; leave expected off to overwrite (latest edit wins). Returns the fresh profile. A value identical to the stored one is skipped and nothing is audited for it, so repeating the same call changes nothing more. ${PATCH_CODES}`, {
17
+ id: dealId,
18
+ fields: keyed(1, PROFILE_KEYS_MAX).describe("Bound contact field key -> new value (null clears); 1 to 100 keys, each key 1 to 100 characters"),
19
+ expected: keyed(0, Infinity).optional().describe("Optional: key -> the value you last saw (a sensitive field's token); a mismatch writes nothing (409 profile_field_changed)"),
20
+ }, async ({ id, fields, expected }) => formatResult(await client.patch(`/api/v1/deals/${encodeURIComponent(id)}/profile`, { fields, expected }))));
21
+ strictInput(server.tool("conduyt_reveal_deal_profile_field", "Reveal ONE sensitive Deal profile field in full (GET /api/v1/deals/{id}/profile/reveal?key=). Allowed only for a caller in the binding's reveal set (settings.dealProfile revealRoles / revealGroupIds; a super admin always) with contacts:view on a card they can see. Every reveal of a stored value appends the audit row deal_profile.reveal (user, field, deal), so each call is recorded; an empty field answers value null and is not audited. 400 invalid_query, profile_key_not_sensitive or deal_profile_not_enabled; 403 reveal_not_allowed or contacts_permission_required; 404.", { id: dealId, key: z.string().min(1).refine((v) => v.trim() !== "", { message: "key must not be blank" }).describe("The sensitive bound field key (exactly one)") }, async ({ id, key }) => formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/profile/reveal?${new URLSearchParams({ key })}`))));
22
+ server.tool("conduyt_get_deal_profile_settings", "Read the workspace's Deal profile binding (GET /api/v1/settings/deal-profile; settings:view): { dealProfile (as stored), valid, danglingKeys (bound keys that name no contact custom field definition) }.", {}, async () => formatResult(await client.get("/api/v1/settings/deal-profile")));
23
+ strictInput(server.tool("conduyt_set_deal_profile_settings", "REPLACE the workspace's Deal profile binding (PUT /api/v1/settings/deal-profile; settings:edit, and only an owner or admin: a delegated holder is refused 403 deal_profile_admin_only; audited as settings_deal_profile_updated): the whole object is replaced, nothing merges, so read the current one with conduyt_get_deal_profile_settings first. dealProfile holds enabled, pipelineIds (null or absent = every pipeline), generalTab { label }, tabs (up to 12: key, label, fields of { key (a CONTACT custom field key), label, control, options, span, sensitive, default, requiredFor, showWhen, validate }), repeating slot tables, footerNote, revealRoles / revealGroupIds. Every pipeline and member group named must be this workspace's. No custom field definition is created or altered. 422 invalid_deal_profile (shape, a foreign pipeline or member group).", { dealProfile: z.record(z.string(), z.unknown()).describe("The whole binding object (validated by the server)") }, async ({ dealProfile }) => formatResult(await client.put("/api/v1/settings/deal-profile", { dealProfile }))));
24
+ strictInput(server.tool("conduyt_remove_deal_profile_settings", "REMOVE the workspace's Deal profile binding (PUT /api/v1/settings/deal-profile with dealProfile null; settings:edit, and only an owner or admin: a delegated holder is refused 403 deal_profile_admin_only): the deal page's Details card returns to its plain view and the stored binding (tabs, rules, reveal set) is DISCARDED, so read and keep a copy with conduyt_get_deal_profile_settings first. No custom field definition is touched.", {}, async () => formatResult(await client.put("/api/v1/settings/deal-profile", { dealProfile: null }))));
25
+ server.tool("conduyt_get_deal_partner_pushes", "The deal page's Push to partner card (GET /api/v1/deals/{id}/partner-pushes): { enabled: false } when the workspace has no enabled partner, else the partners (Creditors Relief; Delancey Street listed, disabled), the card's partner id (the deal field oes_number) and its display (CRL-<id>), a pending create (sending, or unknown after an ambiguous answer: the next push checks the partner first), the newest four pushes and canPush (the card's edit scope and closer or above). Needs deals:view on the card; 404 when the deal does not exist or the caller cannot see it.", { id: dealId }, async ({ id }) => formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes`)));
26
+ server.tool("conduyt_preview_deal_partner_push", "Preview what the next partner push would send (GET /api/v1/deals/{id}/partner-pushes/preview): the action (create when the card has no OES #, update when it has one), the partner endpoint, the payload rows (SSN and bank numbers masked to the last 4), the readiness gaps (missing[]; a push answers 422 profile_incomplete while any remain) and the policy warnings. Nothing is written and no partner is called. Same gates as the push: deals:edit, the card's edit scope, closer or above. 403 deal_not_editable / push_not_permitted; 404; 409 partner_disabled (delancey_street is disabled in v1), partner_not_enabled, deal_has_no_contact.", { id: dealId, partner: z.enum(PUSH_PARTNERS).optional().describe("creditors_relief (default) or delancey_street") }, async ({ id, partner }) => {
27
+ if (partner === undefined)
28
+ return formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes/preview`));
29
+ return formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes/preview?partner=${partner}`));
30
+ });
31
+ strictInput(server.tool("conduyt_push_deal_to_partner", `Push a deal to a partner (POST /api/v1/deals/{id}/partner-pushes): ONE press of the deal page's Push to partner, which SENDS the card's data to the partner and cannot be recalled. One partner record per card: a card without an OES # creates the record (the contact, one debt per creditor, then the bank account when its details are filled) and stamps the partner's id on the card; a card with an OES # can only update that record's contact. action is what you saw (create or update): the server decides from the locked card and answers 409 action_changed with the current state when they differ (call conduyt_preview_deal_partner_push first). An executed attempt answers 200 with result accepted, found, updated, refused (nothing saved on the deal), unknown (no definite answer: the next push checks the partner before creating), needs_link (the partner created the record but the card could not carry its id; an admin links it by hand) or erased. Needs deals:edit, the card's edit scope and closer or above. idempotencyKey (1-255 printable ASCII) is sent as the Idempotency-Key header: one key per push press, reused ONLY to retry the SAME request (same key + same body replays the first answer; a different body is 422 idempotency_request_conflict). A refusal decided before any partner call (the 403s, partner_disabled, partner_not_enabled, push_in_flight, needs_link, action_changed, deal_has_no_contact, contact_busy, profile_incomplete, deal_busy) releases the key, so the SAME key may be retried at once; an executed attempt (accepted, found, updated, refused, unknown) and reconcile_needs_admin, reconcile_ambiguous or partner_auth spend it: a retry with that key answers 409 idempotency_key_spent, so verify what happened before sending a NEW key. 409 idempotency_in_progress: wait Retry-After and retry with the SAME key. A key starting with forgotten: is reserved (400 idempotency_key_reserved). Rare wrapper outcomes: 409 idempotency_conflict_retry (a concurrent claim could not be resolved, nothing ran: retry with the SAME key); 503 idempotency_claim_held (the release of a failed attempt's claim could not be confirmed: retry with a NEW key); 503 idempotency_outcome_unknown (the success could not be confirmed and the push may have gone through: verify the outcome before any new key). ${PUSH_CODES}`, {
32
+ id: dealId,
33
+ partner: z.enum(PUSH_PARTNERS).describe("creditors_relief (Forth) or delancey_street (disabled in v1)"),
34
+ action: z.enum(PUSH_ACTIONS).describe("What the card showed: create (no OES # yet) or update (the card has one)"),
35
+ idempotencyKey: z.string().regex(/^[!-~](?:[ -~]{0,253}[!-~])?$/, "idempotencyKey must be 1-255 printable ASCII characters, not blank").optional().describe("Sent as the Idempotency-Key header; reuse it ONLY to retry the SAME request"),
36
+ }, async ({ id, partner, action, idempotencyKey }) => formatResult(await client.post(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes`, { partner, action }, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined))));
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.18",
3
+ "version": "4.105.19",
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-11T06:40:40.006Z",
3
- "toolCount": 416,
4
- "totalEndpoints": 1194,
2
+ "generatedAt": "2026-11-11T19:13:30.779Z",
3
+ "toolCount": 425,
4
+ "totalEndpoints": 1202,
5
5
  "counts": {
6
- "covered": 368,
6
+ "covered": 376,
7
7
  "excluded": 368,
8
8
  "planned": 458,
9
9
  "uncategorized": 0
@@ -2641,6 +2641,42 @@
2641
2641
  "status": "planned",
2642
2642
  "reason": "deal subroutes beyond core CRUD (history, files, links)"
2643
2643
  },
2644
+ "GET /api/v1/deals/:id/partner-pushes": {
2645
+ "status": "covered",
2646
+ "tools": [
2647
+ "conduyt_get_deal_partner_pushes"
2648
+ ]
2649
+ },
2650
+ "POST /api/v1/deals/:id/partner-pushes": {
2651
+ "status": "covered",
2652
+ "tools": [
2653
+ "conduyt_push_deal_to_partner"
2654
+ ]
2655
+ },
2656
+ "GET /api/v1/deals/:id/partner-pushes/preview": {
2657
+ "status": "covered",
2658
+ "tools": [
2659
+ "conduyt_preview_deal_partner_push"
2660
+ ]
2661
+ },
2662
+ "GET /api/v1/deals/:id/profile": {
2663
+ "status": "covered",
2664
+ "tools": [
2665
+ "conduyt_get_deal_profile"
2666
+ ]
2667
+ },
2668
+ "PATCH /api/v1/deals/:id/profile": {
2669
+ "status": "covered",
2670
+ "tools": [
2671
+ "conduyt_update_deal_profile"
2672
+ ]
2673
+ },
2674
+ "GET /api/v1/deals/:id/profile/reveal": {
2675
+ "status": "covered",
2676
+ "tools": [
2677
+ "conduyt_reveal_deal_profile_field"
2678
+ ]
2679
+ },
2644
2680
  "POST /api/v1/deals/:id/tags": {
2645
2681
  "status": "covered",
2646
2682
  "tools": [
@@ -4620,6 +4656,19 @@
4620
4656
  "status": "planned",
4621
4657
  "reason": "account settings read/update surfaces"
4622
4658
  },
4659
+ "GET /api/v1/settings/deal-profile": {
4660
+ "status": "covered",
4661
+ "tools": [
4662
+ "conduyt_get_deal_profile_settings"
4663
+ ]
4664
+ },
4665
+ "PUT /api/v1/settings/deal-profile": {
4666
+ "status": "covered",
4667
+ "tools": [
4668
+ "conduyt_set_deal_profile_settings",
4669
+ "conduyt_remove_deal_profile_settings"
4670
+ ]
4671
+ },
4623
4672
  "GET /api/v1/settings/delivery-guard": {
4624
4673
  "status": "planned",
4625
4674
  "reason": "account settings read/update surfaces"