conduyt-mcp 4.105.12 → 4.105.13

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP server for [Conduyt CRM](https://conduyt.app) — expose your CRM as AI-accessible tools. Covers the core CRM surface (contacts, deals, pipelines, custom fields, automations, messaging, and more); use `conduyt_api_catalog` to discover the full set of 600+ REST endpoints.
4
4
 
5
- ## 394 Tools
5
+ ## 399 Tools
6
6
 
7
7
  ### Discovery
8
8
  | Tool | Description |
@@ -41,6 +41,7 @@ MCP server for [Conduyt CRM](https://conduyt.app) — expose your CRM as AI-acce
41
41
  | `conduyt_create_file_upload_intent` / `conduyt_finalize_file_upload` / `conduyt_create_chat_upload_intent` / `conduyt_finalize_chat_upload` / `conduyt_upload_local_file` / `conduyt_upload_chat_attachment` | Direct-to-storage uploads (#565): intent (`POST /files/upload/intent`, `POST /chat/channels/{id}/upload/intent`; `fileName`, `size`, optional `contentType`) returns a signed PUT URL, the bytes go straight to storage, finalize (`.../finalize`, `{ uploadId }`) settles it. CRM files up to 50 MB (key scope `files`), Team Chat attachments up to 10 MB (key scope `chat`). `conduyt_upload_local_file` / `conduyt_upload_chat_attachment` do all three steps for a local path and refuse an over-cap or empty file before any call (413 wording `File is too large (12 MB). Maximum allowed: 10 MB.`). Finalize refusals, verbatim: 400 `upload_id_required`, 404 `upload_not_found`, 409 `upload_incomplete` (bytes never PUT), 409 `upload_in_progress`, 413 `file_too_large`, 422 `upload_size_mismatch`, 400/415 `file_rejected`, 429, 503 `uploads_unavailable`; finalize allows 120 s. Only a finalize 409 `upload_in_progress` is repeated (at most 4 total attempts) |
42
42
  | `conduyt_create_short_link` | Make (or reuse) the workspace's Conduyt short link for a public link-shortener address the Message check flagged (`POST /short-links`, body `{ url }`; key needs the `messages` scope, member needs communications.create). Not shortenable: our own host, merge fields, `mailto:`/`tel:`/`sms:`, or any address the Message check does not flag as a link shortener (400 `not_shortenable`). Other errors verbatim, never retried: 400 `invalid_body`, 403 `forbidden`, 413 `body_too_large`, 429 `rate_limited` (with Retry-After), 503 `short_link_unavailable` (nothing changed) |
43
43
  | `conduyt_get_deal_card_fields` / `conduyt_set_deal_card_fields` | Read / replace the kanban card fields (1-8, built-ins or `custom:<fieldKey>`) |
44
+ | `conduyt_get_import_required_rule` / `conduyt_set_import_required_rule` | (#1272) Read / replace the contact import's required-field rule (`PATCH /settings` `importRequiredContactRule`): `{ all, anyOf }`, every field of `all` plus at least one field of each `anyOf` group (two or more different fields, up to 8 groups); the read prints the derived `importRequiredRule` with `scoped`. Saved with the settings revision; a legacy account is refused 422 |
44
45
  | `conduyt_get_settings_revision` | The account `settingsRevision` (plus stored stage rules and rot days): pass it as `expectedSettingsRevision` to `conduyt_archive_pipeline` / `conduyt_delete_stage` so a stale one is refused 409 `stale_settings_revision` |
45
46
  | `conduyt_get_pipeline_rot_days` / `conduyt_set_pipeline_rot_days` | Read / set the stale-in-stage threshold per pipeline (`pipelineRotDays`, 1-90 days); only the pipelines sent change; revision-aware, retried once on a 409 |
46
47
  | `conduyt_get_deal` | Get deal details with history, including custom-field values |
@@ -258,6 +259,8 @@ The Mailchimp OAuth connect and callback are browser-only: connect Mailchimp in
258
259
  | `conduyt_react_chat_message` | React to a Team Chat message as the authenticated user/agent; an AI teammate passes `claimToken` (the turn prompt's reply claim token, plus `sourceMessageId` when it reacts to another message of the thread) and the reaction ENDS that turn (outcome reacted); 409 `reaction_stale_claim` / `turn_finished` write nothing |
259
260
  | `conduyt_stay_silent` | (#802) the turn prompt's stay_silent: ends an AI teammate's turn with no response (`POST /chat/agents/me/inbox/claim` action `silent` for the turn's `messageId`, generation and listener id read from `claimToken`); 409 `turn_finished` when it already replied or reacted |
260
261
  | `conduyt_get_chat_linked_record` | (#802) the turn prompt's linked_record: `GET /chat/channels/{id}/linked-record`, the channel's linked deal or contact as a read-only summary `{ kind, record }` under the caller's visibility; one 404 for not a member / no link / not visible |
262
+ | `conduyt_set_chat_linked_record` | (#1267) `PUT /chat/channels/{id}/linked-record` with exactly one of `dealId` or `contactId`: link a deal or contact to a general channel (replaces any link). Owner or admin member, admin-tier key with the chat scope; AI teammates refused. Returns `{ id, dealId, contactId, changed }` |
263
+ | `conduyt_unlink_chat_linked_record` | (#1267) `DELETE /chat/channels/{id}/linked-record`: remove the channel's link (idempotent, destructive to the link only; the record is untouched). Same access |
261
264
  | `conduyt_get_chat_thread` | (#684, thread view on) `GET /chat/channels/{id}/messages/{messageId}/thread`: one thread by its ROOT, `{ root, replies (oldest first), total, earlierCount, hasEarlier, earlierCursor, aiReactions, replying }`; `limit` 1-50 (default 20, the latest page), `before` = `earlierCursor`; an AI teammate reads the thread it answers in with the turn prompt's Reply parent id |
262
265
  | `conduyt_list_chat_thread_files` | (#684, thread view on) `GET /chat/channels/{id}/messages/{messageId}/files`: the files shared in one thread, oldest first, `{ data, hasMore }` (200 per read) |
263
266
  | `conduyt_mark_chat_read` | Acknowledge read up to one message (`readUpTo` = message UUID; the marker only moves forward, an older or foreign message is a no-op; same one-retry membership bootstrap) |
@@ -279,6 +282,7 @@ AI teammate turns (#802, the app listener's #655 phase 1): a turn run through Co
279
282
  | `conduyt_connect_ai_teammate` | Step 1 (`POST /chat/agents/{id}/connect`): the message to paste into Grok Bot and the teammate's token, returned ONCE (`{ token, tokenPrefix, message, toolsUrl, agent }`); the token goes into Grok Bot's masked connector field, never into a chat. Every call revokes the earlier tokens. The calling key needs the write tier and the chat and deals scopes |
280
283
  | `conduyt_set_ai_teammate_webhook` | Step 3 (`PUT /chat/agents/{id}/webhook`): `paste` (the block Grok Bot shows) OR `address` + `key`; checked, stored (the key encrypted), tested at once: `{ stored, test, status }`. The key is write-only: never returned, and any returned text has it replaced by `[hidden]`. A test that was not accepted is an error result with its one sentence (`key_refused`, `routine_gone`, `unreachable`, `not_accepted`, `rate_limited`; `teammate_not_live` is a 409 before any test) |
281
284
  | `conduyt_test_ai_teammate_webhook` | The card's Test button (`POST /chat/agents/{id}/webhook/test`): the hello again to the stored routine; `{ test, status }` |
285
+ | `conduyt_test_ai_teammate_listener` | The Settings > AI Test for a LISTENER teammate (`POST /chat/agents/{id}/test`): asks its running listener for the hello; `{ hello, test: { supported, requestedAt, helloAt, waitingUntil } }`. 409 codes agent_not_listener_provider, listener_not_listening, listener_too_old, teammate_not_live; not destructive |
282
286
  | `conduyt_get_ai_teammate_webhook` | The status the card polls (`GET /chat/agents/{id}/webhook`): `state` not_connected / waiting_for_hello / listening / not_listening, `problem { code, message }`, the address masked; poll it after a test until listening |
283
287
  | `conduyt_disconnect_ai_teammate` | `DELETE /chat/agents/{id}/webhook`: tokens revoked, the routine's key cleared, pending deliveries cancelled; the teammate and its messages stay; never blocked by billing |
284
288
 
@@ -162,6 +162,8 @@ export const TOOL_ANNOTATIONS = {
162
162
  conduyt_set_stage_rules: update("Set Stage Rules"),
163
163
  conduyt_get_deal_card_fields: ro("Get Deal Card Fields"),
164
164
  conduyt_set_deal_card_fields: update("Set Deal Card Fields"),
165
+ conduyt_get_import_required_rule: ro("Get Import Required Rule"),
166
+ conduyt_set_import_required_rule: update("Set Import Required Rule"),
165
167
  conduyt_get_settings_revision: ro("Get Settings Revision"),
166
168
  conduyt_get_pipeline_rot_days: ro("Get Pipeline Rot Days"),
167
169
  conduyt_set_pipeline_rot_days: update("Set Pipeline Rot Days"),
@@ -189,6 +191,8 @@ export const TOOL_ANNOTATIONS = {
189
191
  // (#802) ends an AI teammate's turn with outcome silent; a repeat on the claim it completed answers the same (like an acknowledgement)
190
192
  conduyt_stay_silent: update("Stay Silent on a Chat Turn"),
191
193
  conduyt_get_chat_linked_record: ro("Get Chat Linked Record"),
194
+ conduyt_set_chat_linked_record: update("Set Chat Linked Record"),
195
+ conduyt_unlink_chat_linked_record: destroy("Unlink Chat Linked Record"),
192
196
  // (#684) the thread reads recover a first-use 403 through GET /chat/channels, which creates auto-channel memberships (as conduyt_list_chat_messages)
193
197
  conduyt_get_chat_thread: update("Get Chat Thread"),
194
198
  // (#1140 A3) the Grok Bot teammate connect tools: connect mints a token and revokes the earlier ones on every call; set stores the
@@ -198,6 +202,7 @@ export const TOOL_ANNOTATIONS = {
198
202
  conduyt_connect_ai_teammate: row("Connect AI Teammate", false, true, false),
199
203
  conduyt_set_ai_teammate_webhook: row("Set AI Teammate Webhook", false, false, false),
200
204
  conduyt_test_ai_teammate_webhook: create("Test AI Teammate Webhook"),
205
+ conduyt_test_ai_teammate_listener: create("Test AI Teammate Listener"),
201
206
  conduyt_get_ai_teammate_webhook: ro("Get AI Teammate Webhook"),
202
207
  conduyt_disconnect_ai_teammate: destroy("Disconnect AI Teammate"),
203
208
  conduyt_list_chat_thread_files: update("List Chat Thread Files"),
@@ -18,6 +18,9 @@ export declare const NOT_FOUND_SENTENCE = "There is no AI teammate with that id
18
18
  /** (#1153) GET /chat/agents on a server from before #1153 refuses every API key with its session-only sentence */
19
19
  export declare const OLDER_LIST_SENTENCE = "This Conduyt server does not let an API key read the AI teammate list yet (it predates it); see the teammates in Settings > AI.";
20
20
  export declare const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot with a person's API key (an owner or admin).";
21
+ /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot), so the shared Grok Bot sentences are not used for it */
22
+ export declare const LISTENER_KEY_SENTENCE = "This is an AI teammate's own key; test a teammate's connection with a person's API key (an owner or admin).";
23
+ export declare const LISTENER_OLDER_SERVER_SENTENCE = "This Conduyt server does not have the AI teammate connection test yet (it predates it); test the teammate in Settings > AI instead.";
21
24
  export declare const NO_CREDENTIALS_SENTENCE = "Give the routine's address and key: paste (the block Grok Bot shows), or address and key.";
22
25
  /** the one sentence for a refused call, and its code when the API sent one */
23
26
  export declare function refusalOf(err: ConduytApiError): {
@@ -20,6 +20,9 @@ export const NOT_FOUND_SENTENCE = "There is no AI teammate with that id or handl
20
20
  /** (#1153) GET /chat/agents on a server from before #1153 refuses every API key with its session-only sentence */
21
21
  export const OLDER_LIST_SENTENCE = "This Conduyt server does not let an API key read the AI teammate list yet (it predates it); see the teammates in Settings > AI.";
22
22
  export const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot with a person's API key (an owner or admin).";
23
+ /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot), so the shared Grok Bot sentences are not used for it */
24
+ export const LISTENER_KEY_SENTENCE = "This is an AI teammate's own key; test a teammate's connection with a person's API key (an owner or admin).";
25
+ export const LISTENER_OLDER_SERVER_SENTENCE = "This Conduyt server does not have the AI teammate connection test yet (it predates it); test the teammate in Settings > AI instead.";
23
26
  export const NO_CREDENTIALS_SENTENCE = "Give the routine's address and key: paste (the block Grok Bot shows), or address and key.";
24
27
  function errorDetailsOf(message) {
25
28
  for (let i = message.indexOf("{"); i !== -1; i = message.indexOf("{", i + 1)) {
@@ -134,6 +137,19 @@ export function registerAiTeammateConnectTools(server, client) {
134
137
  return attempt(secrets, () => client.put(`/api/v1/chat/agents/${seg(teammateId)}/webhook`, { ...(paste !== undefined ? { paste } : {}), ...(address !== undefined ? { address } : {}), ...(key !== undefined ? { key } : {}) }), testOutcome(secrets));
135
138
  }));
136
139
  strictInput(server.tool("conduyt_test_ai_teammate_webhook", `The card's Test button (POST /api/v1/chat/agents/{id}/webhook/test): sends the hello again to the stored routine (nothing is pasted); an accepted test turns a stored connection live. Answers { test, status } like conduyt_set_ai_teammate_webhook (a test that was not accepted is an error result with its sentence); then poll conduyt_get_ai_teammate_webhook for the hello. 409 agent_webhook_not_connected when nothing is stored; 429 after 20 tests per teammate in 10 minutes. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.post(`/api/v1/chat/agents/${seg(teammateId)}/webhook/test`, {}), testOutcome([]))));
140
+ strictInput(server.tool("conduyt_test_ai_teammate_listener", `The Settings > AI Test for a LISTENER teammate (a teammate whose listener runs the conduyt CLI: Claude Code, Cowork or another coding-agent listener; POST /api/v1/chat/agents/{id}/test, no body): asks the teammate's running listener for the hello. Its next inbox page carries the test and the listener posts "Hello, I'm connected." in AI Team Chat once; read the result with conduyt_list_ai_teammates (helloTest.helloAt). Answers { hello, test: { supported, requestedAt, helloAt, waitingUntil } }. It changes nothing but the request time on the teammate (not destructive; a repeat only asks again). Owners and admins with a person's API key (the chat scope); an AI teammate's own key is refused (403 agent_route_refused). 409 with a code: agent_not_listener_provider (a Grok Bot teammate: use conduyt_test_ai_teammate_webhook), listener_not_listening (no heartbeat in the last 60 seconds), listener_too_old (the listener is older than conduyt CLI 1.91.0; mention the teammate with hello instead), teammate_not_live (its owner lost access); 402 plan_required when the workspace's plan does not include AI teammates; 429 after 20 tests in 10 minutes; 404 ai_teammates_off while the workspace's AI teammates switch is off.`, { teammateId: TEAMMATE_ID.describe("The listener teammate: its id (a UUID) or its @handle, as conduyt_list_ai_teammates lists them (any provider; a Grok Bot is refused with agent_not_listener_provider)") }, async ({ teammateId }) => {
141
+ try {
142
+ return connectResult(unwrap(await client.post(`/api/v1/chat/agents/${seg(teammateId)}/test`, {})), []);
143
+ }
144
+ catch (err) {
145
+ if (err instanceof ConduytApiError && err.code === "http") {
146
+ const r = refusalOf(err);
147
+ const sentence = r.code === "agent_route_refused" ? LISTENER_KEY_SENTENCE : r.sentence === OLDER_SERVER_SENTENCE ? LISTENER_OLDER_SERVER_SENTENCE : r.sentence;
148
+ return connectError(sentence, [], { status: r.status, ...(r.code ? { code: r.code } : {}) });
149
+ }
150
+ throw err;
151
+ }
152
+ }));
137
153
  strictInput(server.tool("conduyt_get_ai_teammate_webhook", `The Grok Bot connection's status (GET /api/v1/chat/agents/{id}/webhook), what the Settings card polls: { state (not_connected | waiting_for_hello | listening | not_listening), label, problem: { code, message } | null (the sentence of what to fix), waitingUntil, connected, address (masked), lastAttempt, tokenUsedAt, lastMessageAt }. Never carries the key. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.get(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
138
154
  strictInput(server.tool("conduyt_disconnect_ai_teammate", `Disconnect a Grok Bot teammate (DELETE /api/v1/chat/agents/{id}/webhook; never blocked by billing): its tokens are revoked, the routine's key is cleared and pending deliveries are cancelled; the teammate and its messages stay. Answers { disconnected, revokedKeys, webhook, cancelledDeliveries }. Safe to repeat. Connect it again with conduyt_connect_ai_teammate then conduyt_set_ai_teammate_webhook. ${WHO.replace(" and 402 plan_required when the workspace is not entitled", "")}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.del(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
139
155
  }
@@ -14,4 +14,7 @@ export declare const MAX_STAGE_REQUIRED_DOCUMENTS = 20;
14
14
  export declare const MAX_CLOSES_OTHERS_REASON_LENGTH = 200;
15
15
  export declare const MIN_PIPELINE_ROT_DAYS = 1;
16
16
  export declare const MAX_PIPELINE_ROT_DAYS = 90;
17
+ /** (#1272, app #1255 c) the keys the import's required-contact rule takes: the app's CONTACT_REQUIRED_FIELD_KEYS, in its order */
18
+ export declare const IMPORT_RULE_FIELDS: readonly ["firstName", "lastName", "email", "phone", "company", "jobTitle", "source", "addressLine1", "addressLine2", "city", "state", "zip", "country", "linkedin", "twitter", "website"];
19
+ export declare const MAX_IMPORT_RULE_GROUPS = 8;
17
20
  export declare function registerBoardSettingsTools(server: McpServer, client: ConduytClient): void;
@@ -26,6 +26,11 @@ const cardField = z.union([
26
26
  z.enum(DEAL_CARD_FIELDS),
27
27
  z.string().regex(CUSTOM_FIELD_RE, "custom card fields are custom:<deal custom field key>"),
28
28
  ]);
29
+ /** (#1272, app #1255 c) the keys the import's required-contact rule takes: the app's CONTACT_REQUIRED_FIELD_KEYS, in its order */
30
+ export const IMPORT_RULE_FIELDS = ["firstName", "lastName", "email", "phone", "company", "jobTitle", "source", "addressLine1", "addressLine2", "city", "state", "zip", "country", "linkedin", "twitter", "website"];
31
+ export const MAX_IMPORT_RULE_GROUPS = 8;
32
+ const importRuleField = z.enum(IMPORT_RULE_FIELDS);
33
+ const importRuleGroup = z.array(importRuleField).min(2).max(IMPORT_RULE_FIELDS.length).refine((g) => new Set(g).size === g.length, "each anyOf group needs two or more different fields");
29
34
  const isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
30
35
  export function registerBoardSettingsTools(server, client) {
31
36
  strictInput(server.tool("conduyt_get_stage_rules", "Read the per-stage rules (settings.pipelineStageRules) as { pipelineId: { stageId: { requiredFields, requiredDocuments, lostReasonLabel, lostReasonOptions, lostReasonAllowOther, entryByAutomationOnly, closesOtherOpenDeals, closesOtherOpenDealsReason, assignsContactOwner } } }, optionally for one pipeline or one stage. A deal may enter a stage only when its requiredFields are filled (built-ins value, expectedCloseDate, contactId, assignedTo, lostReason, or custom:<fieldKey> for a deal custom field) and it has at least requiredDocuments documents attached. entryByAutomationOnly: true (absent = off) means only an automation run can move or create a deal INTO the stage; every other entry, admins and API keys included, is refused 422 stage_automation_only (moving out stays free). What ENTERING the stage does (each absent = off): closesOtherOpenDeals: true marks every OTHER open deal card of the same contact, in any pipeline, lost (with closesOtherOpenDealsReason, or \"Closed automatically: another card reached <stage>\"); assignsContactOwner: true makes the owner of the entering card the contact's owner (the previous contact owner stays as a collaborator). Set one stage with conduyt_set_stage_rules. Pipelines your key cannot see are left out.", {
@@ -92,4 +97,12 @@ export function registerBoardSettingsTools(server, client) {
92
97
  strictInput(server.tool("conduyt_set_pipeline_rot_days", "Set the stale-in-stage threshold of ONE or more pipelines (settings.pipelineRotDays; admin key, settings:edit): days without activity (integer 1-90) before a deal in the pipeline reads \"Stale in stage\". Only the pipelines you send change; every other pipeline keeps its value. The pipeline must be an ACTIVE pipeline of the account (422 for an unknown or archived one). Saved with the settings revision; a stale revision is re-read and retried once, then the conflict is returned with the current settings.", {
93
98
  days: z.record(z.string().uuid(), z.number().int().min(MIN_PIPELINE_ROT_DAYS).max(MAX_PIPELINE_ROT_DAYS)).refine((d) => Object.keys(d).length > 0, "Pass at least one pipeline").describe("Pipeline UUID to days (1-90), e.g. { \"<pipelineId>\": 14 }"),
94
99
  }, async ({ days }) => patchGeneralSettingsMerged(client, () => ({ pipelineRotDays: days }))));
100
+ server.tool("conduyt_get_import_required_rule", "Read the rule the contact import applies to each row (GET /api/v1/settings, importRequiredRule): { all: [fields every row needs], anyOf: [[two or more fields, at least one needed]], scoped }. scoped true = the rule is the account's own either/or rule (its own settings.importRequiredContactRule, or the new-account default); scoped false = the rule is being resolved from a legacy flat requiredContactFields list or the legacy default. scoped does not say whether conduyt_set_import_required_rule works: a set is refused 422 only for an account without the either/or import rule marker (a legacy account), which the 422 message reports; on a marked account the saved rule is then the one resolved (scoped true).", {}, async () => {
101
+ const result = (await client.get("/api/v1/settings"));
102
+ return formatResult({ data: { importRequiredRule: result?.data?.importRequiredRule ?? null } });
103
+ });
104
+ strictInput(server.tool("conduyt_set_import_required_rule", `Set the contact import's required-field rule (PATCH /api/v1/settings importRequiredContactRule; settings:edit). REPLACES the rule whole: every field of \`all\` is required on each row, and per group of \`anyOf\` (two or more different fields, up to ${MAX_IMPORT_RULE_GROUPS} groups) at least one of its fields is. Fields: ${IMPORT_RULE_FIELDS.join(", ")}. An empty all with no anyOf requires nothing. Saved with the settings revision (one retry on a 409). Only an account created on the either/or import rule can save it: a legacy account (BDA's flat requiredContactFields list, for one) is refused 422 "importRequiredContactRule applies only to accounts created on the either/or import rule", and a group with fewer than two different fields 422 as well. Read it back with conduyt_get_import_required_rule.`, {
105
+ all: z.array(importRuleField).max(IMPORT_RULE_FIELDS.length).describe("Fields every imported row needs (may be empty)"),
106
+ anyOf: z.array(importRuleGroup).max(MAX_IMPORT_RULE_GROUPS).describe("Groups of two or more different fields; each row needs at least one field of every group (may be empty)"),
107
+ }, async ({ all, anyOf }) => patchGeneralSettingsMerged(client, () => ({ importRequiredContactRule: { all, anyOf } }))));
95
108
  }
@@ -199,6 +199,22 @@ export function registerChatTools(server, client) {
199
199
  const result = await client.get(`/api/v1/chat/channels/${channelId}/linked-record`);
200
200
  return formatResult(result);
201
201
  }));
202
+ strictInput(server.tool("conduyt_set_chat_linked_record", "(#1267, app #1259) Link a deal OR a contact to a GENERAL Team Chat channel, replacing any link it has (PUT /api/v1/chat/channels/{id}/linked-record with exactly one of { dealId } or { contactId }; one link at a time, a deal clears a contact and the other way round). Needs an admin-tier API key that holds the chat scope (and deals or contacts for the record you link) created by an owner or admin who is a member of the channel; an AI teammate's key is refused 403 agent_route_refused, a lower tier or a key without the chat scope 403. Returns { id, dealId, contactId, changed } (changed false when it was already that record). Refusals: 404 (not a member, no such channel, or a record that does not exist or you may not read: one identical answer), 409 (the channel's record is fixed: a deal, contact, DM or auto room, or a room created with a record; or that record is already linked to another channel), 400 (not exactly one id).", {
203
+ channelId: z.string().uuid().describe("Channel UUID (a general channel you are a member of)"),
204
+ dealId: z.string().uuid().optional().describe("The deal to link (send this or contactId, never both)"),
205
+ contactId: z.string().uuid().optional().describe("The contact to link (send this or dealId, never both)"),
206
+ }, async ({ channelId, dealId, contactId }) => {
207
+ if ((dealId === undefined) === (contactId === undefined))
208
+ throw new Error("Pass exactly one of dealId or contactId.");
209
+ if (dealId !== undefined)
210
+ return formatResult(await client.put(`/api/v1/chat/channels/${channelId}/linked-record`, { dealId }));
211
+ const result = await client.put(`/api/v1/chat/channels/${channelId}/linked-record`, { contactId });
212
+ return formatResult(result);
213
+ }));
214
+ strictInput(server.tool("conduyt_unlink_chat_linked_record", "(#1267, app #1259) DESTRUCTIVE to the link, not to the record: remove a general Team Chat channel's linked deal or contact (DELETE /api/v1/chat/channels/{id}/linked-record, no body). Idempotent: a channel with no link answers changed false. The deal or contact itself is untouched and conduyt_set_chat_linked_record links it again. Same access as conduyt_set_chat_linked_record: owner or admin who is a member, an admin-tier key with the chat scope; an AI teammate's key is refused. Returns { id, dealId: null, contactId: null, changed }. 404 not a member or no such channel, 409 the channel's record is fixed (a deal, contact, DM or auto room).", { channelId: z.string().uuid().describe("Channel UUID (a general channel you are a member of)") }, async ({ channelId }) => {
215
+ const result = await client.del(`/api/v1/chat/channels/${channelId}/linked-record`);
216
+ return formatResult(result);
217
+ }));
202
218
  strictInput(server.tool("conduyt_get_chat_thread", "(#684, only while the workspace's thread view is on) Read ONE Team Chat thread by its ROOT, the top-level message (GET /api/v1/chat/channels/{id}/messages/{messageId}/thread): { root, replies (oldest first), total (every counted reply), earlierCount, hasEarlier, earlierCursor (send as before for the page below), aiReactions: [{ messageId, agent, emoji, at }] (an AI teammate's turn that ended with a reaction instead of a reply: \"<name> reacted <emoji>. No reply needed.\" under messageId), replying: [{ userId }] (AI teammates whose turn on this thread is running) }. Without before: the LATEST limit replies (default 20, 1 to 50). Counted replies are not deleted, inside the 90-day window and under the caller's deal visibility. A deleted root is served as stored (deletedAt set, body \"Message deleted\"). An AI teammate reads the whole thread it is answering in with this: pass the turn prompt's Channel id and its Reply parent id (the thread's root), then page back with before while hasEarlier. Members only: a 403 'Not a member of this channel' is recovered once like the other reads. Refusals are error results with a plain sentence, never retried: 409 team_chat_threads_off (the thread view is off), 404 (a reply id, an unknown or hidden message, a root past the window with no reply inside it, or a server that predates the thread view), 400 limit / before.", {
203
219
  channelId: z.string().uuid().describe("Channel UUID"),
204
220
  messageId: z.string().uuid().describe("The thread's ROOT message UUID (a top-level message; for an AI teammate's turn: the Reply parent id)"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.12",
3
+ "version": "4.105.13",
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",
@@ -150,16 +150,6 @@
150
150
  "status": "excluded",
151
151
  "reason": "(#599) the single-use pair-code exchange that MINTS the agent's key: the listener's first call (npm CLI `conduyt agent pair` / `listen --pair-code`), never made with an existing key"
152
152
  },
153
- {
154
- "match": "PUT /api/v1/chat/channels/:id/linked-record",
155
- "status": "excluded",
156
- "reason": "(batch22 link1259) session-only: linking a deal or contact to a general channel is an owner/admin action from a signed-in session; every API key, an AI teammate's included, is refused, so a tool could never succeed"
157
- },
158
- {
159
- "match": "DELETE /api/v1/chat/channels/:id/linked-record",
160
- "status": "excluded",
161
- "reason": "(batch22 link1259) session-only: unlinking a general channel's record is an owner/admin action from a signed-in session; every API key, an AI teammate's included, is refused, so a tool could never succeed"
162
- },
163
153
  {
164
154
  "match": "PATCH /api/v1/chat/channels/:id/agents",
165
155
  "status": "excluded",
@@ -1,10 +1,10 @@
1
1
  {
2
- "generatedAt": "2026-11-09T23:34:57.996Z",
3
- "toolCount": 394,
4
- "totalEndpoints": 1176,
2
+ "generatedAt": "2026-11-10T02:51:13.093Z",
3
+ "toolCount": 399,
4
+ "totalEndpoints": 1177,
5
5
  "counts": {
6
- "covered": 348,
7
- "excluded": 366,
6
+ "covered": 351,
7
+ "excluded": 364,
8
8
  "planned": 462,
9
9
  "uncategorized": 0
10
10
  },
@@ -1375,6 +1375,12 @@
1375
1375
  "status": "excluded",
1376
1376
  "reason": "(#599) creating, removing and pairing an AI teammate are session-only (assertSessionOnly): an admin manages them in Settings > AI; every API key is refused. (#1153) GET /chat/agents is covered by conduyt_list_ai_teammates and the Grok Bot connect routes by their five tools (a covered endpoint is never matched here)"
1377
1377
  },
1378
+ "POST /api/v1/chat/agents/:id/test": {
1379
+ "status": "covered",
1380
+ "tools": [
1381
+ "conduyt_test_ai_teammate_listener"
1382
+ ]
1383
+ },
1378
1384
  "GET /api/v1/chat/agents/:id/webhook": {
1379
1385
  "status": "covered",
1380
1386
  "tools": [
@@ -1466,12 +1472,16 @@
1466
1472
  ]
1467
1473
  },
1468
1474
  "PUT /api/v1/chat/channels/:id/linked-record": {
1469
- "status": "excluded",
1470
- "reason": "(batch22 link1259) session-only: linking a deal or contact to a general channel is an owner/admin action from a signed-in session; every API key, an AI teammate's included, is refused, so a tool could never succeed"
1475
+ "status": "covered",
1476
+ "tools": [
1477
+ "conduyt_set_chat_linked_record"
1478
+ ]
1471
1479
  },
1472
1480
  "DELETE /api/v1/chat/channels/:id/linked-record": {
1473
- "status": "excluded",
1474
- "reason": "(batch22 link1259) session-only: unlinking a general channel's record is an owner/admin action from a signed-in session; every API key, an AI teammate's included, is refused, so a tool could never succeed"
1481
+ "status": "covered",
1482
+ "tools": [
1483
+ "conduyt_unlink_chat_linked_record"
1484
+ ]
1475
1485
  },
1476
1486
  "POST /api/v1/chat/channels/:id/members": {
1477
1487
  "status": "planned",
@@ -4470,6 +4480,7 @@
4470
4480
  "conduyt_get_deal_card_fields",
4471
4481
  "conduyt_get_settings_revision",
4472
4482
  "conduyt_get_pipeline_rot_days",
4483
+ "conduyt_get_import_required_rule",
4473
4484
  "conduyt_get_contact_table_defaults",
4474
4485
  "conduyt_set_contact_table_defaults",
4475
4486
  "conduyt_get_call_recording_settings",