conduyt-mcp 4.101.0 → 4.103.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 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
- ## 299 Tools
5
+ ## 373 Tools
6
6
 
7
7
  ### Discovery
8
8
  | Tool | Description |
@@ -14,7 +14,8 @@ MCP server for [Conduyt CRM](https://conduyt.app) — expose your CRM as AI-acce
14
14
  ### Contacts
15
15
  | Tool | Description |
16
16
  |------|-------------|
17
- | `conduyt_list_contacts` | List and search contacts with filters (search, exact `email`, `tag` names, `tagId` uuids: ANY-of, repeatable up to 20, `meta.total` counts the filtered set) |
17
+ | `conduyt_list_contacts` | List and search contacts with filters (search, exact `email`, `tag` names, `tagId` uuids: ANY-of, repeatable up to 20). `meta.total` can be null with `meta.total_deferred` true; `meta.has_more` is always exact |
18
+ | `conduyt_count_contacts` | The exact total of a contacts list filter (`GET /contacts/count`, the filters shared with the list, not the list-only deal-context filters: with those, page with `meta.has_more` instead; read scope): `{ total, age_ms?, total_capped?, pending?, timed_out? }`; `pending` = ask again in a few seconds, `timed_out` = narrow the filter |
18
19
  | `conduyt_get_contact` | Get full contact details with timeline; `hasOutboundSms` = the workspace has ever provably texted the contact; `hasOutboundEmail` = the same for email; `duplicateProposals` and `heldIdentifiers` = the open possible-duplicate lines and held identifiers |
19
20
  | `conduyt_create_contact` | Create a new contact (a 409 with `existingId`, `rule`, `ruleVersion`, `matchedOn`, `reason` means the identity policy identified the incoming person with that record: confirm the identity (name, company) before updating it, a shared phone or email is not proof, and the server creates (with a passive duplicate proposal) a different person on a shared identifier; 409 `identifier_changed` / `owner_busy` and 503 `IDENTITY_INDEX_NOT_READY` are retryable, nothing written; with `callId`: the lead for a contact-less inbound call, linked in the same transaction; the server derives source "Inbound Call" and the owner) |
20
21
  | `conduyt_update_contact` | Update contact fields (incl. `assignedTo`; `keepPreviousOwnerAsCollaborator: true` with a reassignment keeps the previous owner as a read-only collaborator instead of releasing them, 400 without `assignedTo`); optional `expectedRevision` (0..2147483647) refuses a stale save with 409 `contact_changed` (code + current revision in the error) |
@@ -37,6 +38,7 @@ MCP server for [Conduyt CRM](https://conduyt.app) — expose your CRM as AI-acce
37
38
  | `conduyt_get_calling_hours` / `conduyt_update_calling_hours` | Read the window the dialer enforces (`effectiveCallingWindow`: `source`, `enabled`, `start`/`end` HH:MM, `timezone` or null = contact zone, then number area code, then account) / set `settings.callingWindow` (`enabled`, `start`, `end` always sent, `end` after `start`, `timezone` trimmed and recognised by the API (omit keeps the stored zone, null clears it); `enabled: false` needs `acknowledgeAnyHour: true`, else 400 `calling_hours_acknowledgement_required`) |
38
39
  | `conduyt_list_email_opt_outs` / `conduyt_add_email_opt_out` / `conduyt_resubscribe_email_opt_out` | The email opt-out list (owner / admin key; hash-only rows `{ id, source, reason, createdAt }`): list (`page`, `perPage` 1-100), add an address by hand (`reason` 1-200 required; 201 new row, 200 when an unsubscribe-link or Mailchimp row is promoted to manual, 409 with the existing row when already listed by hand) and take an address off (`{ removed }`) |
39
40
  | `conduyt_get_my_profile` | Read the caller's own identity (`GET /users/me`, same as `/auth/me`): `data.user` incl. `ringtone` (the incoming-ring slug, null = Conduyt Default), `data.account`, role, permissions, `apiKey`, `accounts`. Editing the profile is a signed-in person's action and is not exposed to API keys |
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) |
40
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) |
41
43
  | `conduyt_get_deal_card_fields` / `conduyt_set_deal_card_fields` | Read / replace the kanban card fields (1-8, built-ins or `custom:<fieldKey>`) |
42
44
  | `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` |
@@ -148,7 +150,7 @@ No tool carries call audio. Fetch it with `GET {API base}/api/v1/dialer/call/{id
148
150
  ### Companies
149
151
  | Tool | Description |
150
152
  |------|-------------|
151
- | `conduyt_list_companies` | List and search companies |
153
+ | `conduyt_list_companies` | List and search companies (`count_mode: none` skips the total: `meta.total` null, `meta.has_more` exact) |
152
154
  | `conduyt_get_company` | Get company with contacts and deals |
153
155
  | `conduyt_create_company` | Create a new company record |
154
156
  | `conduyt_update_company` | Update company details |
@@ -397,7 +399,7 @@ A refused call (HTTP 4xx/5xx) fails the tool with this text, stable across tools
397
399
  Conduyt API <status>: <server message>[ [Retry-After: <N>s]][ <details>]
398
400
  ```
399
401
 
400
- `[Retry-After: Ns]` appears only when the server sent the header (shown, never acted on: a mutation is never retried).
402
+ `[Retry-After: Ns]` appears only when the server sent the header (shown, never acted on: a mutation is never retried; the one exception is the finalize POST of the upload convenience tools `conduyt_upload_local_file` and `conduyt_upload_chat_attachment`: on a 409 `upload_in_progress` only, at most 4 total attempts, the Retry-After is honoured (capped at 10 s, 5 s when absent or unreadable); finalize is idempotent on the server for the same upload id, so a repeat cannot double-finalize).
401
403
  `<details>` appears only when the body had more than `error`: it is ONE JSON object and the FINAL token. To extract it, try
402
404
  each `{` from the left until the rest of the text parses as JSON (a server message may itself contain a brace). The object
403
405
  carries scalars first (`code`, revision), then nested objects whole; `HealthFixRefusal.row` is always whole, any other nested
package/dist/client.d.ts CHANGED
@@ -12,7 +12,7 @@ export declare class ConduytApiError extends Error {
12
12
  readonly code: "http" | "timeout" | "response_too_large" | "network";
13
13
  readonly retryable: boolean;
14
14
  /** The response's Retry-After, in seconds, when it sent one (a busy 503 / a 429): surfaced to the agent, never used
15
- * to replay a mutation. */
15
+ * to replay a mutation. Exception (finalize of the convenience upload tools/commands only): on a 409 upload_in_progress the finalize POST is repeated, at most 4 total attempts, the Retry-After honoured and capped at 10 s, 5 s when absent or unreadable. */
16
16
  readonly retryAfterSeconds: number | null;
17
17
  constructor(opts: {
18
18
  message: string;
package/dist/client.js CHANGED
@@ -11,7 +11,7 @@ export class ConduytApiError extends Error {
11
11
  code;
12
12
  retryable;
13
13
  /** The response's Retry-After, in seconds, when it sent one (a busy 503 / a 429): surfaced to the agent, never used
14
- * to replay a mutation. */
14
+ * to replay a mutation. Exception (finalize of the convenience upload tools/commands only): on a 409 upload_in_progress the finalize POST is repeated, at most 4 total attempts, the Retry-After honoured and capped at 10 s, 5 s when absent or unreadable. */
15
15
  retryAfterSeconds;
16
16
  constructor(opts) {
17
17
  super(opts.message, opts.cause !== undefined ? { cause: opts.cause } : undefined);
@@ -33,6 +33,7 @@ import { registerBatchOperationTools } from "./tools/batch-operations.js";
33
33
  import { registerDncTools } from "./tools/dnc.js";
34
34
  import { registerEmailOptOutTools } from "./tools/email-opt-out.js";
35
35
  import { registerShortLinkTools } from "./tools/short-links.js";
36
+ import { registerDirectUploadTools } from "./tools/direct-uploads.js";
36
37
  import { registerMyProfileTools } from "./tools/my-profile.js";
37
38
  import { registerSavedFilterTools } from "./tools/saved-filters.js";
38
39
  import { registerDripCampaignTools } from "./tools/drip-campaigns.js";
@@ -94,6 +95,7 @@ export function registerAllTools(server, client) {
94
95
  registerDncTools(server, client);
95
96
  registerEmailOptOutTools(server, client);
96
97
  registerShortLinkTools(server, client);
98
+ registerDirectUploadTools(server, client);
97
99
  registerMyProfileTools(server, client);
98
100
  registerSavedFilterTools(server, client);
99
101
  registerDripCampaignTools(server, client);
@@ -11,6 +11,7 @@ export const TOOL_ANNOTATIONS = {
11
11
  conduyt_search: ro("Search CRM Records"),
12
12
  conduyt_mcp_coverage: ro("Get MCP Coverage Matrix"),
13
13
  conduyt_list_contacts: ro("List Contacts"),
14
+ conduyt_count_contacts: ro("Count Contacts"),
14
15
  conduyt_get_contact: ro("Get Contact"),
15
16
  conduyt_create_contact: create("Create Contact"),
16
17
  conduyt_update_contact: update("Update Contact"),
@@ -222,6 +223,12 @@ export const TOOL_ANNOTATIONS = {
222
223
  conduyt_add_email_opt_out: update("Add Email Opt-Out"), // a repeat is refused 409 (already listed by hand) before any write, so it lands on the same state; adding a block is protective
223
224
  conduyt_resubscribe_email_opt_out: destroy("Resubscribe Email Address"), // consent change: removing the row re-enables every customer-facing email to the address
224
225
  conduyt_get_my_profile: ro("Get My Profile"),
226
+ conduyt_create_file_upload_intent: create("Create File Upload Intent"), // mints a pending upload record and a signed PUT target; each call is a new upload id
227
+ conduyt_finalize_file_upload: update("Finalize File Upload"), // finalizing the same upload again answers the same body
228
+ conduyt_create_chat_upload_intent: create("Create Chat Upload Intent"),
229
+ conduyt_finalize_chat_upload: update("Finalize Chat Upload"), // finalizing again answers the same body
230
+ conduyt_upload_local_file: create("Upload Local File"), // reads a local file and PUTs it to the signed storage URL; each call stores a new file
231
+ conduyt_upload_chat_attachment: create("Upload Chat Attachment"),
225
232
  conduyt_create_short_link: update("Create Short Link"), // one link per account and target: a repeat returns the same link (idempotent), nothing existing is changed
226
233
  conduyt_list_saved_filters: ro("List Saved Filters"),
227
234
  conduyt_create_saved_filter: create("Create Saved Filter"),
@@ -5,7 +5,7 @@ import { formatResult } from "../client.js";
5
5
  * matching → Run Batch" action and the Run Batch page. Admins and owners only.
6
6
  */
7
7
  export function registerBatchOperationTools(server, client) {
8
- server.tool("conduyt_create_batch_operation", "Queue a Run Batch: ONE task applied to many contacts, logged with progress and cancel (no undo). Tasks: enroll (automationId of a published workflow), delete (the #73 engine: cleanup runs, contacts with an upcoming appointment are kept), add_tag / remove_tag (params.tagId), assign (params.userId — one rep) or a round-robin pool (params.userIds, 2–50 reps rotated in order; a rep who is no longer an active member is skipped), set_source (params.source — OVERWRITES the lead source), set_status (params.status — one of the account's lead statuses; a lead with a won deal keeps its status). Pick the contacts ONE way: contactIds (up to 50,000), filterPayload (universal filters), or filter + expectedTotal — the same filter you would give conduyt_list_contacts plus the meta.total it returned; the server re-counts and refuses with 409 expected_total_mismatch when the set moved, then freezes the matching ids (max 50,000). The run is processed in the background; poll conduyt_get_batch_operation. Requires the admin or owner role and an active subscription.", {
8
+ server.tool("conduyt_create_batch_operation", "Queue a Run Batch: ONE task applied to many contacts, logged with progress and cancel (no undo). Tasks: enroll (automationId of a published workflow), delete (the #73 engine: cleanup runs, contacts with an upcoming appointment are kept), add_tag / remove_tag (params.tagId), assign (params.userId - one rep) or a round-robin pool (params.userIds, 2–50 reps rotated in order; a rep who is no longer an active member is skipped), set_source (params.source - OVERWRITES the lead source), set_status (params.status - one of the account's lead statuses; a lead with a won deal keeps its status). Pick the contacts ONE way: contactIds (up to 50,000), filterPayload (universal filters), or filter + expectedTotal - the same filter you would give conduyt_list_contacts plus the meta.total it returned (when the list answers meta.total null with meta.total_deferred true and has_more, use the total from conduyt_count_contacts for the same SHARED filter; with a deal-context filter see below); the server re-counts and refuses with 409 expected_total_mismatch when the set moved, then freezes the matching ids (max 50,000). Deal-context filters (deal_context_owners, deal_context_stages, deal_context_statuses) exist only on the list, not on conduyt_count_contacts: for a list that uses one of them do not take a total from the count tool (it would count a broader set); page the list with has_more and tally the rows instead. The run is processed in the background; poll conduyt_get_batch_operation. Requires the admin or owner role and an active subscription.", {
9
9
  name: z.string().min(1).max(256).describe("A name for the run (shown on the Run Batch page)"),
10
10
  operation: z.enum(["enroll", "delete", "add_tag", "remove_tag", "assign", "set_source", "set_status"]).describe("The task"),
11
11
  automationId: z.string().uuid().optional().describe("enroll only: the published workflow"),
@@ -13,8 +13,8 @@ export function registerBatchOperationTools(server, client) {
13
13
  comment: z.string().max(2000).optional().describe("Why this run (stored with it)"),
14
14
  contactIds: z.array(z.string().uuid()).min(1).max(50_000).optional().describe("Explicit contacts"),
15
15
  filterPayload: z.array(z.record(z.string(), z.unknown())).min(1).optional().describe("Universal filter rules (the Smart View filter shape)"),
16
- filter: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional().describe("The contact list filter parameters, exactly as for conduyt_list_contacts; at least one non-empty value"),
17
- expectedTotal: z.number().int().positive().optional().describe("With filter: the total the list showed for it (meta.total)"),
16
+ filter: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional().describe("The contact list filter parameters as for conduyt_list_contacts (the filters shared with conduyt_count_contacts; the list-only deal_context_owners / deal_context_stages / deal_context_statuses cannot be counted there: page by has_more and tally rows); at least one non-empty value"),
17
+ expectedTotal: z.number().int().positive().optional().describe("With filter: the total the list showed for it (meta.total), or the total from conduyt_count_contacts when meta.total was null (total_deferred); not for a deal-context filter (list-only, the count tool cannot express it): tally rows by has_more"),
18
18
  }, async (params) => {
19
19
  const body = { name: params.name, operation: params.operation };
20
20
  if (params.automationId)
@@ -118,9 +118,9 @@ export function registerBulkTools(server, client) {
118
118
  const result = await client.post("/api/v1/bulk/contacts/delete", params);
119
119
  return formatResult(result);
120
120
  });
121
- server.tool("conduyt_bulk_delete_contacts_matching", "Soft-delete EVERY contact a list filter matches, across pages (#73, 2026-09-15) — the contacts page's \"Select all N matching\" action. FIRST CALL: pass the same filter you would give conduyt_list_contacts (search, tag, tags, source, reachability, company, company_id, assigned_to, created_from/to, updated_from/to, min_score, import_id, smart_view, smartListId, filters JSON, master_status, exclude_master_status, cf[key]) and expectedTotal = the meta.total that filter returned. The server re-counts and refuses when the set moved (409 expected_total_mismatch), refuses when some matching contacts are shared with you but not yours to delete (409 not_all_editable), then FREEZES the matching ids (max 50,000; 422 above) and deletes only those. Contacts with an upcoming appointment are kept (keptWithAppointments). If done=false the response carries remainingIds AND a signed continuation token: CALL AGAIN with ids = remainingIds and continuation = that token, verbatim (no filter, no expectedTotal) until done=true; busy=true means wait a moment first. The token is bound to you, this account and exactly those ids and expires after 2 hours (403 continuation_*); a continuation without it is refused. Empty filters are refused. Requires contacts:delete and an active subscription.", {
122
- filter: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional().describe("First call: the contact list filter parameters, exactly as for conduyt_list_contacts; at least one non-empty value"),
123
- expectedTotal: z.number().int().positive().optional().describe("First call: the total the list showed for this filter (meta.total)"),
121
+ server.tool("conduyt_bulk_delete_contacts_matching", "Soft-delete EVERY contact a list filter matches, across pages (#73, 2026-09-15) - the contacts page's \"Select all N matching\" action. FIRST CALL: pass the same filter you would give conduyt_list_contacts (search, tag, tags, source, reachability, company, company_id, assigned_to, created_from/to, updated_from/to, min_score, import_id, smart_view, smartListId, filters JSON, master_status, exclude_master_status, cf[key]) and expectedTotal = the meta.total that filter returned (when the list answers meta.total null with meta.total_deferred true and has_more, get the exact total from conduyt_count_contacts with the same SHARED filter; with a deal-context filter see below). Deal-context filters (deal_context_owners, deal_context_stages, deal_context_statuses) exist only on the list, not on conduyt_count_contacts: for a list that uses one of them do not take a total from the count tool (it would count a broader set); page the list with has_more and tally the rows instead. The server re-counts and refuses when the set moved (409 expected_total_mismatch), refuses when some matching contacts are shared with you but not yours to delete (409 not_all_editable), then FREEZES the matching ids (max 50,000; 422 above) and deletes only those. Contacts with an upcoming appointment are kept (keptWithAppointments). If done=false the response carries remainingIds AND a signed continuation token: CALL AGAIN with ids = remainingIds and continuation = that token, verbatim (no filter, no expectedTotal) until done=true; busy=true means wait a moment first. The token is bound to you, this account and exactly those ids and expires after 2 hours (403 continuation_*); a continuation without it is refused. Empty filters are refused. Requires contacts:delete and an active subscription.", {
122
+ filter: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional().describe("First call: the contact list filter parameters as for conduyt_list_contacts (the filters shared with conduyt_count_contacts; the list-only deal_context_owners / deal_context_stages / deal_context_statuses cannot be counted there: page by has_more and tally rows); at least one non-empty value"),
123
+ expectedTotal: z.number().int().positive().optional().describe("First call: the total the list showed for this filter (meta.total), or the total from conduyt_count_contacts when meta.total was null (total_deferred); not for a deal-context filter (list-only, the count tool cannot express it): tally rows by has_more"),
124
124
  ids: z.array(z.string().uuid()).min(1).max(50_000).optional().describe("Continuation: the remainingIds from the previous response, in the same order (send INSTEAD of filter/expectedTotal)"),
125
125
  continuation: z.string().max(2_000).optional().describe("Continuation: the `continuation` token from the previous response, verbatim (required with ids)"),
126
126
  }, async (params) => {
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
3
  export function registerCompanyTools(server, client) {
4
- server.tool("conduyt_list_companies", "List and search companies. Returns name, domain, industry, contact count, deal count, and total deal value.", {
4
+ server.tool("conduyt_list_companies", "List and search companies. Returns name, domain, industry, contact count, deal count, and total deal value. `count_mode: \"none\"` skips the total count (a picker that only lists names): meta.total is then null and meta.has_more says whether another page exists.", {
5
5
  search: z.string().optional().describe("Search by company name, domain, or phone"),
6
6
  industry: z.string().optional().describe("Filter by industry"),
7
7
  size: z.enum(["1-10", "11-50", "51-200", "201-500", "501-1000", "1001+"]).optional().describe("Filter by company size"),
@@ -9,7 +9,8 @@ export function registerCompanyTools(server, client) {
9
9
  order: z.enum(["asc", "desc"]).optional().describe("Sort order (default: desc)"),
10
10
  page: z.number().optional().describe("Page number (default 1)"),
11
11
  per_page: z.number().optional().describe("Results per page (default 50, max 200)"),
12
- }, async ({ search, industry, size, sort, order, page, per_page }) => {
12
+ count_mode: z.enum(["exact", "none"]).optional().describe("exact (default) counts every matching company into meta.total. none skips that count: meta.total is then null and meta.has_more says whether another page exists."),
13
+ }, async ({ search, industry, size, sort, order, page, per_page, count_mode }) => {
13
14
  const params = new URLSearchParams();
14
15
  if (search)
15
16
  params.set("search", search);
@@ -25,6 +26,8 @@ export function registerCompanyTools(server, client) {
25
26
  params.set("page", String(page));
26
27
  if (per_page)
27
28
  params.set("per_page", String(per_page));
29
+ if (count_mode)
30
+ params.set("count_mode", count_mode);
28
31
  const result = await client.get(`/api/v1/companies?${params}`);
29
32
  return formatResult(result);
30
33
  });
@@ -21,5 +21,7 @@ export declare const MERGE_PREVIEW_MAX = 50;
21
21
  export declare const MERGE_PREVIEW_TTL_MS: number;
22
22
  export declare const EMAIL_LOOKUP_NOTE = "Exact email lookup: one address, or up to 20 distinct addresses in an array. Each is trimmed and lower-cased and matches the contact's primary email OR any secondary email slot (email_2 and up); it is an exact match, not a substring search (use `search` for partial text). Combines with every other filter (AND) inside your account and visibility. An empty or invalid address, or more than 20 distinct addresses, is a 400. On a workspace whose identifier index is still being built, the lookup answers 422 when the stored spellings of the requested addresses exceed its stored-spelling bind budget (a count of spellings, not of contacts; other filters do not help); ask support to complete the identifier backfill. Send addresses once; duplicates collapse.";
23
23
  export declare const TAG_FILTER_NOTE = "Filter by tag NAME: one name, or up to 20 distinct names in an array (the contact carries ANY of them). Names match case-insensitively within your account. Cannot be combined with tagId (400). To filter by tag id use tagId.";
24
- export declare const TAG_ID_FILTER_NOTE = "Filter by tag ID (uuid): one id, or up to 20 distinct ids in an array (the contact carries ANY of them). A malformed id or more than 20 ids is a 400; an id that is not a tag of your account matches nothing; a merged-away tag id follows its alias to the live tag. Cannot be combined with tag (400). The returned total (meta.total) counts the filtered set, so tagId with per_page=1 is a cheap count of the contacts holding a tag.";
24
+ export declare const TAG_ID_FILTER_NOTE = "Filter by tag ID (uuid): one id, or up to 20 distinct ids in an array (the contact carries ANY of them). A malformed id or more than 20 ids is a 400; an id that is not a tag of your account matches nothing; a merged-away tag id follows its alias to the live tag. Cannot be combined with tag (400). meta.total counts the filtered set when present, but it can be null with total_deferred; per_page 1 is only an existence probe. Use conduyt_count_contacts with tagId for the exact total.";
25
+ /** (slow566b, app main 9aef66389) the contacts list may not count: how a caller gets the exact total */
26
+ export declare const LIST_TOTAL_NOTE = "`meta.total` can be null: then `meta.total_deferred` is true and the page was not counted (the unfiltered list and a Smart View answer a cached total, `meta.total_age_ms`, null until first counted; a filter without an index of its own is never counted here). `meta.has_more` is always exact, so page on by `has_more`, never by `total`. For the exact total call conduyt_count_contacts (GET /contacts/count), which takes the SHARED filters only: with dealContextOwners, dealContextStages or dealContextStatuses (list-only) the count route cannot answer (dropping them counts a broader set), so page with has_more instead. A search stops counting at 10,000 (`meta.total_capped`).";
25
27
  export declare function registerContactTools(server: McpServer, client: ConduytClient): void;
@@ -73,10 +73,13 @@ export const EMAIL_LOOKUP_NOTE = "Exact email lookup: one address, or up to 20 d
73
73
  /** (API ?tag= / ?tagId=, #506) both are repeatable and capped at 20 distinct values; the API reads every occurrence (ANY-of) and refuses tagId together with tag */
74
74
  const TAG_FILTER_MAX = 20;
75
75
  export const TAG_FILTER_NOTE = "Filter by tag NAME: one name, or up to 20 distinct names in an array (the contact carries ANY of them). Names match case-insensitively within your account. Cannot be combined with tagId (400). To filter by tag id use tagId.";
76
- export const TAG_ID_FILTER_NOTE = "Filter by tag ID (uuid): one id, or up to 20 distinct ids in an array (the contact carries ANY of them). A malformed id or more than 20 ids is a 400; an id that is not a tag of your account matches nothing; a merged-away tag id follows its alias to the live tag. Cannot be combined with tag (400). The returned total (meta.total) counts the filtered set, so tagId with per_page=1 is a cheap count of the contacts holding a tag.";
76
+ export const TAG_ID_FILTER_NOTE = "Filter by tag ID (uuid): one id, or up to 20 distinct ids in an array (the contact carries ANY of them). A malformed id or more than 20 ids is a 400; an id that is not a tag of your account matches nothing; a merged-away tag id follows its alias to the live tag. Cannot be combined with tag (400). meta.total counts the filtered set when present, but it can be null with total_deferred; per_page 1 is only an existence probe. Use conduyt_count_contacts with tagId for the exact total.";
77
+ /** (slow566b, app main 9aef66389) the contacts list may not count: how a caller gets the exact total */
78
+ export const LIST_TOTAL_NOTE = "`meta.total` can be null: then `meta.total_deferred` is true and the page was not counted (the unfiltered list and a Smart View answer a cached total, `meta.total_age_ms`, null until first counted; a filter without an index of its own is never counted here). `meta.has_more` is always exact, so page on by `has_more`, never by `total`. For the exact total call conduyt_count_contacts (GET /contacts/count), which takes the SHARED filters only: with dealContextOwners, dealContextStages or dealContextStatuses (list-only) the count route cannot answer (dropping them counts a broader set), so page with has_more instead. A search stops counting at 10,000 (`meta.total_capped`).";
77
79
  export function registerContactTools(server, client) {
78
80
  const mergePreviews = createMergePreviewStore();
79
- server.tool("conduyt_list_contacts", "List and search contacts with filtering. To find the contact(s) holding a known email address, pass `email` (exact match on the primary or any secondary email); `search` is a substring search. To list the contacts carrying a tag (or any of several tags), pass `tagId` (uuid) or `tag` (name); meta.total is the count of that filtered set. Returns paginated results with name, email, phone, tags, source, and assignee. Each row carries `revision` (integer save revision; pass it back as expectedRevision on conduyt_update_contact or the collaborator tools).", {
81
+ /** the filter parameters conduyt_list_contacts and conduyt_count_contacts share (GET /contacts and GET /contacts/count read the same ones) */
82
+ const contactFilterShape = {
80
83
  search: z.string().optional().describe("Search by name, email, or phone number"),
81
84
  email: z.union([EMAIL_LOOKUP_ONE, z.array(EMAIL_LOOKUP_ONE).min(1).max(20)]).optional().describe(EMAIL_LOOKUP_NOTE),
82
85
  tag: z.union([z.string().trim().min(1), z.array(z.string().trim().min(1)).min(1).max(TAG_FILTER_MAX)]).optional().describe(TAG_FILTER_NOTE),
@@ -85,9 +88,25 @@ export function registerContactTools(server, client) {
85
88
  assignedTo: z.string().optional().describe("Filter by assigned user ID"),
86
89
  masterStatus: z.array(z.string().trim().min(1).max(40)).max(20).optional().describe("Only contacts whose LEAD (master) status is one of these: 'open', 'won', 'lost', 'abandoned', 'disqualified' or an account custom status. Unknown values are a 400."),
87
90
  excludeMasterStatus: z.array(z.string().trim().min(1).max(40)).max(20).optional().describe("Hide contacts whose lead status is one of these — e.g. ['won','lost','abandoned','disqualified'] is the 'Active' view. Naming a status in both lists is a 400."),
88
- page: z.number().optional().describe("Page number (default 1)"),
89
- per_page: z.number().optional().describe("Results per page (default 25, max 100)"),
90
- }, async ({ search, email, tag, tagId, source, assignedTo, masterStatus, excludeMasterStatus, page, per_page }) => {
91
+ // the rest of the filters GET /contacts and GET /contacts/count both read (app main 9aef66389); each maps to the query param of the same meaning
92
+ company: z.string().optional().describe("Filter by company name (query param `company`)"),
93
+ companyId: z.string().optional().describe("Filter by company id (query param `company_id`)"),
94
+ createdFrom: z.string().optional().describe("Created on or after this date/time (query param `created_from`)"),
95
+ createdTo: z.string().optional().describe("Created on or before this date/time (query param `created_to`)"),
96
+ updatedFrom: z.string().optional().describe("Updated on or after this date/time (query param `updated_from`)"),
97
+ updatedTo: z.string().optional().describe("Updated on or before this date/time (query param `updated_to`)"),
98
+ importId: z.string().optional().describe("Only contacts from this import job (query param `import_id`)"),
99
+ minScore: z.number().int().optional().describe("Minimum lead score (query param `min_score`)"),
100
+ smartView: z.string().optional().describe("Smart View: a Smart View id, or a built-in view such as needs_follow_up, hot_leads, new_this_week, recently_won, untagged, missing_email, missing_phone (query param `smart_view`)"),
101
+ smartListId: z.string().optional().describe("Smart List id (uuid); a non-uuid is a 400 invalid_smart_list_id, an unknown list a 404 smart_list_not_found (query param `smartListId`)"),
102
+ tags: z.string().optional().describe("Comma-separated tag names (query param `tags`; the same set the Run Batch / bulk delete filters use). Prefer `tag` / `tagId` for new calls"),
103
+ filters: z.string().optional().describe("The filter builder's JSON, as a string (query param `filters`)"),
104
+ reachability: z.string().optional().describe("Reachability filter (query param `reachability`)"),
105
+ cf: z.string().optional().describe("Compact custom-field filters: fieldKey=value pairs (comma-separated) or a JSON object; a value can be exact, __notempty__ or __empty__ (query param `cf`)"),
106
+ customFieldFilters: z.record(z.string(), z.string()).optional().describe("Filter by contact custom fields: { fieldKey: exact value | '__notempty__' | '__empty__' }; each is sent as `cf[fieldKey]`. The key must be a contact custom-field of the account"),
107
+ };
108
+ const contactFilterParams = (f) => {
109
+ const { search, email, tag, tagId, source, assignedTo, masterStatus, excludeMasterStatus } = f;
91
110
  const params = new URLSearchParams();
92
111
  if (search)
93
112
  params.set("search", search);
@@ -107,6 +126,34 @@ export function registerContactTools(server, client) {
107
126
  params.set("master_status", masterStatus.join(","));
108
127
  if (excludeMasterStatus?.length)
109
128
  params.set("exclude_master_status", excludeMasterStatus.join(","));
129
+ const plain = [
130
+ ["company", f.company], ["company_id", f.companyId], ["created_from", f.createdFrom], ["created_to", f.createdTo],
131
+ ["updated_from", f.updatedFrom], ["updated_to", f.updatedTo], ["import_id", f.importId], ["min_score", f.minScore],
132
+ ["smart_view", f.smartView], ["smartListId", f.smartListId], ["tags", f.tags], ["filters", f.filters], ["reachability", f.reachability], ["cf", f.cf],
133
+ ];
134
+ for (const [name, value] of plain)
135
+ if (value !== undefined && value !== "")
136
+ params.set(name, String(value));
137
+ for (const [key, value] of Object.entries(f.customFieldFilters ?? {}))
138
+ params.set(`cf[${key}]`, value);
139
+ return params;
140
+ };
141
+ server.tool("conduyt_list_contacts", "List and search contacts with filtering. To find the contact(s) holding a known email address, pass `email` (exact match on the primary or any secondary email); `search` is a substring search. To list the contacts carrying a tag (or any of several tags), pass `tagId` (uuid) or `tag` (name). Returns paginated results with name, email, phone, tags, source, and assignee. Each row carries `revision` (integer save revision; pass it back as expectedRevision on conduyt_update_contact or the collaborator tools). " + LIST_TOTAL_NOTE, {
142
+ ...contactFilterShape,
143
+ // list-only filters (GET /contacts reads them; GET /contacts/count does not)
144
+ dealContextOwners: z.string().optional().describe("Deal-context filter: comma-separated owner ids (query param `deal_context_owners`; list only, the count route does not read it)"),
145
+ dealContextStages: z.string().optional().describe("Deal-context filter: comma-separated stage ids (query param `deal_context_stages`; list only)"),
146
+ dealContextStatuses: z.string().optional().describe("Deal-context filter: comma-separated deal statuses (query param `deal_context_statuses`; list only)"),
147
+ page: z.number().optional().describe("Page number (default 1)"),
148
+ per_page: z.number().optional().describe("Results per page (default 25, max 100)"),
149
+ }, async ({ page, per_page, dealContextOwners, dealContextStages, dealContextStatuses, ...filter }) => {
150
+ const params = contactFilterParams(filter);
151
+ if (dealContextOwners)
152
+ params.set("deal_context_owners", dealContextOwners);
153
+ if (dealContextStages)
154
+ params.set("deal_context_stages", dealContextStages);
155
+ if (dealContextStatuses)
156
+ params.set("deal_context_statuses", dealContextStatuses);
110
157
  if (page)
111
158
  params.set("page", String(page));
112
159
  if (per_page)
@@ -114,6 +161,11 @@ export function registerContactTools(server, client) {
114
161
  const result = await client.get(`/api/v1/contacts?${params}`);
115
162
  return formatResult(result);
116
163
  });
164
+ server.tool("conduyt_count_contacts", "Count the contacts a list filter matches (GET /contacts/count): the exact total when conduyt_list_contacts answers `meta.total: null` with `meta.total_deferred: true`. Takes the SHARED subset of conduyt_list_contacts filters (no page, per_page or sort, and NOT dealContextOwners / dealContextStages / dealContextStatuses, which exist only on the list): with a deal-context filter the exact total is not available here (dropping it counts a broader set), so page the list with has_more instead. Answers `{ total, age_ms?, total_capped?, pending?, timed_out? }`: a cached list (the unfiltered list, or a Smart View alone) answers its cached exact count while under a minute old (`age_ms`), else recounts; `total: null` with `pending: true` = another request is recounting and nothing is cached yet, ask again in a few seconds; `total: null` with `timed_out: true` = the count could not finish within 30 s (narrow the filter); a `search` counts up to 10,000 (`total_capped: true` = more match). Use the total as `expectedTotal` for conduyt_bulk_delete_contacts_matching or conduyt_create_batch_operation.", contactFilterShape, async (filter) => {
165
+ const params = contactFilterParams(filter);
166
+ const result = await client.get(`/api/v1/contacts/count?${params}`);
167
+ return formatResult(result);
168
+ });
117
169
  server.tool("conduyt_get_contact", "Get a single contact with full details — profile, tags, custom fields, timeline, deals, and activity history. Includes `revision` (integer save revision): pass it as expectedRevision on conduyt_update_contact or the collaborator tools so a newer change is never overwritten. Includes `hasOutboundSms` (boolean): true when this workspace has ever PROVABLY texted the contact (a proven send only: not a draft, a queued row or a pre-send failure); use it to pick the `context` for conduyt_check_message (false = 'first', true = 'conversation'). Also includes `hasOutboundEmail` (boolean): the same for email (true when at least one outbound email to the contact was proven sent, so a genuine \"Re:\" reply is a conversation and not flagged); use it to pick the `context` for an email check. Also includes `duplicateProposals` (the open and not-sure possible-duplicate lines on this record, each naming the other record as far as your key may see it) and `heldIdentifiers` (emails or phones held from this record because another record owns them, value-free), each the FIRST page only, with duplicateProposalsTotal, duplicateProposalsNextCursor, duplicateProposalsMembershipRevision, heldIdentifiersTotal, heldIdentifiersNextCursor and heldIdentifiersMembershipRevision (page on with conduyt_list_duplicate_proposals, passing the next cursors as cursor / held_cursor); list or decide them with conduyt_list_duplicate_proposals / conduyt_decide_duplicate_proposal.", {
118
170
  id: z.string().describe("Contact UUID"),
119
171
  }, async ({ id }) => {
@@ -0,0 +1,41 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /**
4
+ * Direct-to-storage uploads (#565; app routes POST /api/v1/files/upload/intent + /finalize and
5
+ * POST /api/v1/chat/channels/{id}/upload/intent + /finalize). The bytes go straight to the signed storage URL; the API never
6
+ * carries the file. The four routes are exposed one to one, plus ONE convenience tool per surface that runs the whole flow
7
+ * (intent, PUT the bytes of a local file, finalize). Every API call is sent once: a refusal reaches the agent verbatim.
8
+ * The only repeat is finalize on 409 upload_in_progress, which the API documents as retryable (finalizing again answers the
9
+ * same body), and only inside the convenience tools.
10
+ */
11
+ /** the app's caps (lib/file-upload-policy.ts CRM_FILE_MAX_BYTES, lib/chat-upload-policy.ts CHAT_UPLOAD_MAX_BYTES) */
12
+ export declare const FILE_UPLOAD_MAX_BYTES: number;
13
+ export declare const CHAT_UPLOAD_MAX_BYTES: number;
14
+ export declare const tooLargeMessage: (size: number, max: number) => string;
15
+ /** both app finalize routes set maxDuration = 120 (finalize reads the staged object back and rewrites it), above the client's 30 s default */
16
+ export declare const FINALIZE_TIMEOUT_MS = 120000;
17
+ /** finalize retry on 409 upload_in_progress: exactly `attempts` calls; between them the refusal's Retry-After (capped at maxDelayMs)
18
+ * or, when it sent none or an unreadable one, delayMs. `sleep` is module state so tests can spy on the scheduled delay. */
19
+ export declare const finalizeRetry: {
20
+ attempts: number;
21
+ delayMs: number;
22
+ maxDelayMs: number;
23
+ sleep: (ms: number) => Promise<unknown>;
24
+ };
25
+ /** the milliseconds to wait before finalizing again; pure */
26
+ export declare function finalizeWaitMs(err: unknown): number;
27
+ /** Everything the end-to-end tools do after the argument checks; exported for the tests. */
28
+ export declare function runDirectUpload(client: ConduytClient, o: {
29
+ intentPath: string;
30
+ finalizePath: string;
31
+ maxBytes: number;
32
+ filePath: string;
33
+ fileName?: string;
34
+ contentType?: string;
35
+ }): Promise<{
36
+ content: Array<{
37
+ type: "text";
38
+ text: string;
39
+ }>;
40
+ }>;
41
+ export declare function registerDirectUploadTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,113 @@
1
+ import { createReadStream } from "node:fs";
2
+ import { stat } from "node:fs/promises";
3
+ import { basename, resolve } from "node:path";
4
+ import { Readable } from "node:stream";
5
+ import { z } from "zod";
6
+ import { formatResult, formatToolError } from "../client.js";
7
+ import { strictInput } from "./strict.js";
8
+ /**
9
+ * Direct-to-storage uploads (#565; app routes POST /api/v1/files/upload/intent + /finalize and
10
+ * POST /api/v1/chat/channels/{id}/upload/intent + /finalize). The bytes go straight to the signed storage URL; the API never
11
+ * carries the file. The four routes are exposed one to one, plus ONE convenience tool per surface that runs the whole flow
12
+ * (intent, PUT the bytes of a local file, finalize). Every API call is sent once: a refusal reaches the agent verbatim.
13
+ * The only repeat is finalize on 409 upload_in_progress, which the API documents as retryable (finalizing again answers the
14
+ * same body), and only inside the convenience tools.
15
+ */
16
+ /** the app's caps (lib/file-upload-policy.ts CRM_FILE_MAX_BYTES, lib/chat-upload-policy.ts CHAT_UPLOAD_MAX_BYTES) */
17
+ export const FILE_UPLOAD_MAX_BYTES = 50 * 1024 * 1024;
18
+ export const CHAT_UPLOAD_MAX_BYTES = 10 * 1024 * 1024;
19
+ /** the app's own wording (lib/direct-upload.ts mb()) so a client-side refusal reads the same as the server's 413 */
20
+ const mb = (bytes) => `${Math.round((bytes / 1024 / 1024) * 10) / 10} MB`;
21
+ export const tooLargeMessage = (size, max) => `File is too large (${mb(size)}). Maximum allowed: ${mb(max)}.`;
22
+ /** both app finalize routes set maxDuration = 120 (finalize reads the staged object back and rewrites it), above the client's 30 s default */
23
+ export const FINALIZE_TIMEOUT_MS = 120_000;
24
+ /** finalize retry on 409 upload_in_progress: exactly `attempts` calls; between them the refusal's Retry-After (capped at maxDelayMs)
25
+ * or, when it sent none or an unreadable one, delayMs. `sleep` is module state so tests can spy on the scheduled delay. */
26
+ export const finalizeRetry = {
27
+ attempts: 4,
28
+ delayMs: 5000,
29
+ maxDelayMs: 10_000,
30
+ sleep: (ms) => new Promise((r) => setTimeout(r, ms)),
31
+ };
32
+ /** the milliseconds to wait before finalizing again; pure */
33
+ export function finalizeWaitMs(err) {
34
+ const ra = err?.retryAfterSeconds;
35
+ return typeof ra === "number" && Number.isFinite(ra) && ra >= 0 ? Math.min(ra * 1000, finalizeRetry.maxDelayMs) : finalizeRetry.delayMs;
36
+ }
37
+ const unwrap = (r) => (r && typeof r === "object" && "data" in r ? r.data : r);
38
+ const FILE_SCOPE = "an API key needs the 'files' scope and the member files.create";
39
+ const CHAT_SCOPE = "an API key needs the 'chat' scope and the member communications.create and membership of the channel";
40
+ const INTENT_ERRORS = "Errors, surfaced verbatim and never retried: 400 file_name_required / file_type_not_allowed / file_size_required / file_empty; 413 file_too_large; 429 (rate limited, Retry-After in the error); 503 uploads_unavailable (nothing changed).";
41
+ const FINALIZE_ERRORS = "Errors, surfaced verbatim: 400 upload_id_required; 404 upload_not_found (malformed, unknown, expired or someone else's upload: upload again); 409 upload_incomplete (the bytes were never PUT, or not all of them: upload again; not retried); 409 upload_in_progress (still being saved: finalize again, same body); 413 file_too_large (the stored object is over the cap); 422 upload_size_mismatch (the stored size is not the declared one: upload again); 400/415 file_rejected (the content check refused the bytes; the status and message are the check's); 429 (rate limited, Retry-After in the error); 503 uploads_unavailable (try again shortly). Finalize allows 120 seconds.";
42
+ /** Everything the end-to-end tools do after the argument checks; exported for the tests. */
43
+ export async function runDirectUpload(client, o) {
44
+ const abs = resolve(o.filePath);
45
+ let st;
46
+ try {
47
+ st = await stat(abs);
48
+ }
49
+ catch {
50
+ return formatToolError(`Cannot read '${o.filePath}': no such file. Nothing was uploaded.`);
51
+ }
52
+ if (!st.isFile())
53
+ return formatToolError(`'${o.filePath}' is not a regular file. Nothing was uploaded.`);
54
+ // the size cap is checked BEFORE the intent call, with the server's wording
55
+ if (st.size === 0)
56
+ return formatToolError("The file is empty.");
57
+ if (st.size > o.maxBytes)
58
+ return formatToolError(tooLargeMessage(st.size, o.maxBytes));
59
+ const body = { fileName: o.fileName ?? basename(abs), size: st.size };
60
+ if (o.contentType !== undefined)
61
+ body.contentType = o.contentType;
62
+ const intent = unwrap(await client.post(o.intentPath, body));
63
+ // the bytes go to the signed URL as-is: NO Authorization header (the URL is the credential), exactly the declared length and type
64
+ let put;
65
+ try {
66
+ put = await fetch(intent.uploadUrl, {
67
+ method: intent.method || "PUT",
68
+ headers: { "Content-Type": intent.contentType, "Content-Length": String(st.size) },
69
+ body: Readable.toWeb(createReadStream(abs)),
70
+ duplex: "half",
71
+ signal: AbortSignal.timeout(Math.max(1, intent.expiresIn) * 1000),
72
+ });
73
+ }
74
+ catch (err) {
75
+ return formatToolError(`Storage upload failed before finalize (${err?.message ?? String(err)}). Nothing was saved; call this tool again (the upload id ${intent.uploadId} is abandoned).`);
76
+ }
77
+ if (!put.ok) {
78
+ return formatToolError(`Storage refused the upload (HTTP ${put.status}). Nothing was saved; call this tool again (the upload id ${intent.uploadId} is abandoned).`);
79
+ }
80
+ for (let attempt = 1;; attempt++) {
81
+ try {
82
+ return formatResult(await client.post(o.finalizePath, { uploadId: intent.uploadId }, { timeoutMs: FINALIZE_TIMEOUT_MS }));
83
+ }
84
+ catch (err) {
85
+ const inProgress = err?.status === 409 && /upload_in_progress/.test(err.message);
86
+ if (!inProgress || attempt >= finalizeRetry.attempts)
87
+ throw err;
88
+ await finalizeRetry.sleep(finalizeWaitMs(err));
89
+ }
90
+ }
91
+ }
92
+ export function registerDirectUploadTools(server, client) {
93
+ const fileNameField = z.string().min(1).describe("File name with its extension, e.g. contract.pdf (the extension decides the allowed type)");
94
+ const contentTypeField = z.string().optional().describe("MIME type; omit to let the API infer it from the file name");
95
+ const sizeField = z.number().int().positive().describe("Exact size of the file in bytes");
96
+ const uploadIdField = z.string().uuid().describe("uploadId from the intent call, after its bytes were PUT");
97
+ const channelField = z.string().uuid().describe("Team Chat channel UUID (you must be a member)");
98
+ strictInput(server.tool("conduyt_create_file_upload_intent", `Step 1 of a direct-to-storage CRM file upload, up to 50 MB (POST /api/v1/files/upload/intent; ${FILE_SCOPE}). Answers 201 { uploadId, uploadUrl, method: "PUT", contentType, size, expiresIn, maxBytes }: PUT exactly 'size' bytes to uploadUrl with Content-Type: contentType within expiresIn seconds (no Authorization header), then call conduyt_finalize_file_upload. This tool does not move bytes; to upload a local file in one step use conduyt_upload_local_file. ${INTENT_ERRORS}`, { fileName: fileNameField, contentType: contentTypeField, size: sizeField }, async ({ fileName, contentType, size }) => formatResult(await client.post("/api/v1/files/upload/intent", { fileName, contentType, size }))));
99
+ strictInput(server.tool("conduyt_finalize_file_upload", `Step 3 of a direct-to-storage CRM file upload (POST /api/v1/files/upload/finalize; ${FILE_SCOPE}). The stored object must be present and exactly the declared size; its bytes are judged by content, then settled. Answers 201 { uploadId, filename, size, contentType}, the same body as the multipart upload; the uploadId is then attached with POST /api/v1/files { entityType, entityId, uploadId }. Finalizing the same upload again answers the same body. ${FINALIZE_ERRORS}`, { uploadId: uploadIdField }, async ({ uploadId }) => formatResult(await client.post("/api/v1/files/upload/finalize", { uploadId }, { timeoutMs: FINALIZE_TIMEOUT_MS }))));
100
+ strictInput(server.tool("conduyt_create_chat_upload_intent", `Step 1 of a direct-to-storage Team Chat attachment, up to 10 MB (POST /api/v1/chat/channels/{id}/upload/intent; ${CHAT_SCOPE}). Answers 201 { uploadId, uploadUrl, method: "PUT", contentType, size, expiresIn, maxBytes }: PUT exactly 'size' bytes to uploadUrl with Content-Type: contentType within expiresIn seconds (no Authorization header), then call conduyt_finalize_chat_upload. This tool does not move bytes; to upload a local file in one step use conduyt_upload_chat_attachment. A deal channel is 404 for a key without the deals scope; a non-member gets 403. ${INTENT_ERRORS}`, { channelId: channelField, fileName: fileNameField, contentType: contentTypeField, size: sizeField }, async ({ channelId, fileName, contentType, size }) => formatResult(await client.post(`/api/v1/chat/channels/${channelId}/upload/intent`, { fileName, contentType, size }))));
101
+ strictInput(server.tool("conduyt_finalize_chat_upload", `Step 3 of a direct-to-storage Team Chat attachment (POST /api/v1/chat/channels/{id}/upload/finalize; ${CHAT_SCOPE}). Answers 201 { url, name, size, type }, the same body as the multipart upload: send it in a message's metadata.attachments. A message that claims an attachment that was never finalized is refused 409 attachment_unavailable. Finalizing again answers the same body. ${FINALIZE_ERRORS}`, { channelId: channelField, uploadId: uploadIdField }, async ({ channelId, uploadId }) => formatResult(await client.post(`/api/v1/chat/channels/${channelId}/upload/finalize`, { uploadId }, { timeoutMs: FINALIZE_TIMEOUT_MS }))));
102
+ strictInput(server.tool("conduyt_upload_local_file", `Upload a file from the machine this server runs on, end to end, as a CRM file (up to 50 MB): checks the size here first, then intent (POST /api/v1/files/upload/intent), PUT of the bytes to the signed URL, finalize (POST /api/v1/files/upload/finalize). ${FILE_SCOPE}. Answers { uploadId, filename, size, contentType }; attach it with POST /api/v1/files { entityType, entityId, uploadId }. A file over the cap is refused here with the API's wording ("File is too large (60 MB). Maximum allowed: 50 MB.") before any call is made; an empty file likewise ("The file is empty."). API refusals are surfaced verbatim and not retried; a storage failure leaves nothing saved, call the tool again. Only a 409 upload_in_progress on finalize is repeated (at most 4 total attempts, waiting the Retry-After, capped at 10 seconds, else 5 seconds). Finalize refusals: ${FINALIZE_ERRORS}`, {
103
+ filePath: z.string().min(1).describe("Path of the local file to upload"),
104
+ fileName: z.string().min(1).optional().describe("Name to store it under; default: the file's own name"),
105
+ contentType: contentTypeField,
106
+ }, async ({ filePath, fileName, contentType }) => runDirectUpload(client, { intentPath: "/api/v1/files/upload/intent", finalizePath: "/api/v1/files/upload/finalize", maxBytes: FILE_UPLOAD_MAX_BYTES, filePath, fileName, contentType })));
107
+ strictInput(server.tool("conduyt_upload_chat_attachment", `Upload a file from the machine this server runs on, end to end, as a Team Chat attachment (up to 10 MB): checks the size here first, then intent (POST /api/v1/chat/channels/{id}/upload/intent), PUT of the bytes, finalize (.../upload/finalize). ${CHAT_SCOPE}. Answers { url, name, size, type }: send it in a message's metadata.attachments. A file over the cap is refused here with the API's wording ("File is too large (12 MB). Maximum allowed: 10 MB.") before any call is made; an empty file likewise ("The file is empty."). API refusals are surfaced verbatim and not retried; a storage failure leaves nothing saved, call the tool again. Only a 409 upload_in_progress on finalize is repeated (at most 4 total attempts, waiting the Retry-After, capped at 10 seconds, else 5 seconds). Finalize refusals: ${FINALIZE_ERRORS}`, {
108
+ channelId: channelField,
109
+ filePath: z.string().min(1).describe("Path of the local file to upload"),
110
+ fileName: z.string().min(1).optional().describe("Name to store it under; default: the file's own name"),
111
+ contentType: contentTypeField,
112
+ }, async ({ channelId, filePath, fileName, contentType }) => runDirectUpload(client, { intentPath: `/api/v1/chat/channels/${channelId}/upload/intent`, finalizePath: `/api/v1/chat/channels/${channelId}/upload/finalize`, maxBytes: CHAT_UPLOAD_MAX_BYTES, filePath, fileName, contentType })));
113
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.101.0",
3
+ "version": "4.103.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",
@@ -39,7 +39,7 @@
39
39
  "claude",
40
40
  "llm-tools"
41
41
  ],
42
- "homepage": "https://conduyt.app",
42
+ "homepage": "https://conduyt.com",
43
43
  "repository": {
44
44
  "type": "git",
45
45
  "url": "git+https://github.com/ptaramona/conduyt-mcp-server.git"
@@ -123,7 +123,7 @@
123
123
  {
124
124
  "match": "/api/v1/files",
125
125
  "status": "planned",
126
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
126
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
127
127
  },
128
128
  {
129
129
  "match": "GET /api/v1/chat/messages/",
@@ -1,11 +1,11 @@
1
1
  {
2
- "generatedAt": "2026-10-27T01:28:17.262Z",
3
- "toolCount": 366,
4
- "totalEndpoints": 1108,
2
+ "generatedAt": "2026-10-29T23:02:33.248Z",
3
+ "toolCount": 373,
4
+ "totalEndpoints": 1118,
5
5
  "counts": {
6
- "covered": 322,
7
- "excluded": 332,
8
- "planned": 454,
6
+ "covered": 327,
7
+ "excluded": 336,
8
+ "planned": 455,
9
9
  "uncategorized": 0
10
10
  },
11
11
  "matrix": {
@@ -269,6 +269,10 @@
269
269
  "status": "excluded",
270
270
  "reason": "raw CSV bytes (up to 50k rows) do not belong in a tool result; conduyt_account_exports_list returns the authed downloadPath for API/CLI retrieval"
271
271
  },
272
+ "POST /api/v1/account/company-name": {
273
+ "status": "planned",
274
+ "reason": "account readiness/onboarding surfaces"
275
+ },
272
276
  "GET /api/v1/account/readiness": {
273
277
  "status": "planned",
274
278
  "reason": "account readiness/onboarding surfaces"
@@ -501,6 +505,10 @@
501
505
  "status": "excluded",
502
506
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
503
507
  },
508
+ "POST /api/v1/auth/google": {
509
+ "status": "excluded",
510
+ "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
511
+ },
504
512
  "GET /api/v1/auth/google/callback": {
505
513
  "status": "excluded",
506
514
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
@@ -545,6 +553,10 @@
545
553
  "status": "excluded",
546
554
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
547
555
  },
556
+ "POST /api/v1/auth/microsoft": {
557
+ "status": "excluded",
558
+ "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
559
+ },
548
560
  "GET /api/v1/auth/microsoft/callback": {
549
561
  "status": "excluded",
550
562
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
@@ -597,6 +609,14 @@
597
609
  "status": "excluded",
598
610
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
599
611
  },
612
+ "GET /api/v1/auth/sso/confirm": {
613
+ "status": "excluded",
614
+ "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
615
+ },
616
+ "POST /api/v1/auth/sso/confirm": {
617
+ "status": "excluded",
618
+ "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
619
+ },
600
620
  "POST /api/v1/auth/switch-account": {
601
621
  "status": "excluded",
602
622
  "reason": "interactive session/password/SSO flows; API keys are the MCP auth model"
@@ -1350,6 +1370,18 @@
1350
1370
  "status": "planned",
1351
1371
  "reason": "team chat read/post for agents"
1352
1372
  },
1373
+ "POST /api/v1/chat/channels/:id/upload/finalize": {
1374
+ "status": "covered",
1375
+ "tools": [
1376
+ "conduyt_finalize_chat_upload"
1377
+ ]
1378
+ },
1379
+ "POST /api/v1/chat/channels/:id/upload/intent": {
1380
+ "status": "covered",
1381
+ "tools": [
1382
+ "conduyt_create_chat_upload_intent"
1383
+ ]
1384
+ },
1353
1385
  "GET /api/v1/chat/floor": {
1354
1386
  "status": "planned",
1355
1387
  "reason": "team chat read/post for agents"
@@ -1579,6 +1611,12 @@
1579
1611
  "conduyt_ai_import_contacts"
1580
1612
  ]
1581
1613
  },
1614
+ "GET /api/v1/contacts/count": {
1615
+ "status": "covered",
1616
+ "tools": [
1617
+ "conduyt_count_contacts"
1618
+ ]
1619
+ },
1582
1620
  "GET /api/v1/contacts/dnc-status": {
1583
1621
  "status": "planned",
1584
1622
  "reason": "contact subroutes beyond the core CRUD/search tools"
@@ -2918,23 +2956,35 @@
2918
2956
  },
2919
2957
  "GET /api/v1/files": {
2920
2958
  "status": "planned",
2921
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
2959
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
2922
2960
  },
2923
2961
  "POST /api/v1/files": {
2924
2962
  "status": "planned",
2925
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
2963
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
2926
2964
  },
2927
2965
  "DELETE /api/v1/files": {
2928
2966
  "status": "planned",
2929
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
2967
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
2930
2968
  },
2931
2969
  "GET /api/v1/files/:id/download": {
2932
2970
  "status": "planned",
2933
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
2971
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
2934
2972
  },
2935
2973
  "POST /api/v1/files/upload": {
2936
2974
  "status": "planned",
2937
- "reason": "file listing/metadata is agent-useful; upload stays browser-side"
2975
+ "reason": "file listing/metadata is agent-useful; the direct-upload routes (POST /files/upload/intent and /finalize) are covered, the multipart upload stays browser-side"
2976
+ },
2977
+ "POST /api/v1/files/upload/finalize": {
2978
+ "status": "covered",
2979
+ "tools": [
2980
+ "conduyt_finalize_file_upload"
2981
+ ]
2982
+ },
2983
+ "POST /api/v1/files/upload/intent": {
2984
+ "status": "covered",
2985
+ "tools": [
2986
+ "conduyt_create_file_upload_intent"
2987
+ ]
2938
2988
  },
2939
2989
  "GET /api/v1/generated-documents": {
2940
2990
  "status": "planned",