conduyt-mcp 4.105.14 → 4.105.17

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
- ## 399 Tools
5
+ ## 412 Tools
6
6
 
7
7
  ### Discovery
8
8
  | Tool | Description |
@@ -200,7 +200,17 @@ No tool carries call audio. Fetch it with `GET {API base}/api/v1/dialer/call/{id
200
200
  | `conduyt_get_invoice` | Get invoice with line items and payments |
201
201
  | `conduyt_create_invoice` | Create invoice with line items (auto-calculates totals) |
202
202
  | `conduyt_update_invoice` | Update draft invoice items or details |
203
- | `conduyt_send_invoice` | Send invoice via email with PDF and Stripe payment link |
203
+ | `conduyt_send_invoice` | Send invoice via email with PDF and Stripe payment link (`resend` starts a new send; typed busy answers `invoice_send_pending`, `invoice_send_complained`, `invoice_send_in_flight`, `gate_busy`) |
204
+ | `conduyt_get_invoice_send_options` | What Send can do now (Email, Text it, Copy link), with reasons and the Text it text |
205
+ | `conduyt_get_invoice_activity` | The invoice history (sent, viewed, payments, voided with its reason) |
206
+ | `conduyt_mark_invoice_sent` | Record that it went out another way (`via` manual or link) |
207
+ | `conduyt_record_invoice_payment` | Record a payment received outside Stripe (destructive: cannot be removed through the API) |
208
+ | `conduyt_void_invoice` | Void an invoice with a required reason (destructive) |
209
+ | `conduyt_delete_invoice` | Delete a draft with no payments (destructive; refused while a send is in flight) |
210
+ | `conduyt_duplicate_invoice` | Copy an invoice into a new draft |
211
+ | `conduyt_list_tax_rates` / `conduyt_create_tax_rate` / `conduyt_update_tax_rate` / `conduyt_archive_tax_rate` | Saved tax rates (archive is reversible) |
212
+
213
+ Text it is `conduyt_send_sms` with `invoiceId` (and `resend`).
204
214
 
205
215
  ### Webhooks
206
216
  | Tool | Description |
@@ -364,6 +374,7 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
364
374
  | Tool | Description |
365
375
  |------|-------------|
366
376
  | `conduyt_list_products` | List product catalog |
377
+ | `conduyt_delete_product` | Archive a product (reversible with `conduyt_update_product` `isActive` true) |
367
378
  | `conduyt_get_product` | Get product details |
368
379
  | `conduyt_create_product` | Create a product |
369
380
  | `conduyt_update_product` | Update product pricing or details |
@@ -392,6 +403,7 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
392
403
  | `conduyt_ai_deal_insights` | AI risk/momentum analysis and next actions for a single deal |
393
404
  | `conduyt_ai_conversation_intelligence` | AI summary/sentiment/objections for a transcribed call |
394
405
  | `conduyt_ai_call_disposition` | AI-suggested disposition for a call from its transcript |
406
+ | `conduyt_save_call_disposition` | Save a call's outcome; a Callback as a follow-up task (default) or a real calendar appointment that blocks the slot (`callbackMode`, `callbackDurationMinutes`) |
395
407
  | `conduyt_ai_daily_brief` | AI daily brief — today's priorities for a user |
396
408
  | `conduyt_ai_next_actions` | AI-ranked next actions for a user |
397
409
  | `conduyt_ai_feed` | Chronological stream of AI-surfaced events and insights |
@@ -41,6 +41,7 @@ import { registerSavedFilterTools } from "./tools/saved-filters.js";
41
41
  import { registerDripCampaignTools } from "./tools/drip-campaigns.js";
42
42
  import { registerScoringTools } from "./tools/scoring.js";
43
43
  import { registerProductTools } from "./tools/products.js";
44
+ import { registerTaxRateTools } from "./tools/tax-rates.js";
44
45
  import { registerTemplateTools } from "./tools/templates.js";
45
46
  import { registerDashboardTools } from "./tools/dashboard.js";
46
47
  import { registerAiExtendedTools } from "./tools/ai-extended.js";
@@ -106,6 +107,7 @@ export function registerAllTools(server, client) {
106
107
  registerDripCampaignTools(server, client);
107
108
  registerScoringTools(server, client);
108
109
  registerProductTools(server, client);
110
+ registerTaxRateTools(server, client);
109
111
  registerTemplateTools(server, client);
110
112
  registerDashboardTools(server, client);
111
113
  registerAiExtendedTools(server, client);
@@ -111,6 +111,7 @@ export const TOOL_ANNOTATIONS = {
111
111
  conduyt_link_call: update("Link Call"),
112
112
  conduyt_get_call: ro("Get Call"),
113
113
  conduyt_get_post_call_insight: ro("Get Post Call Insight"),
114
+ conduyt_save_call_disposition: row("Save Call Disposition", false, false, false), // (#1262) PATCH; non-destructive but NOT idempotent: a same-mode repeat books nothing new yet still appends a call.updated audit record (Codex parity26-r1 P2)
114
115
  conduyt_sync_local_presence: row("Sync Local Presence", false, false, false), // every call writes lastSyncedAt (local-presence-sync.ts:225)
115
116
  conduyt_get_dialer_settings: ro("Get Dialer Settings"),
116
117
  conduyt_update_dialer_settings: update("Update Dialer Settings"),
@@ -144,6 +145,20 @@ export const TOOL_ANNOTATIONS = {
144
145
  conduyt_create_invoice: create("Create Invoice"),
145
146
  conduyt_update_invoice: row("Update Invoice", false, true, false), // line-item replacement deletes and recreates items with new ids every call (invoices/[id]/route.ts:413)
146
147
  conduyt_send_invoice: create("Send Invoice"),
148
+ conduyt_get_invoice_send_options: ro("Get Invoice Send Options"),
149
+ conduyt_get_invoice_activity: ro("Get Invoice Activity"),
150
+ conduyt_mark_invoice_sent: create("Mark Invoice Sent"),
151
+ conduyt_record_invoice_payment: row("Record Invoice Payment", false, true, false), // a recorded payment cannot be removed through the API and a repeat records another (invoices/[id]/payments/route.ts)
152
+ conduyt_void_invoice: destroy("Void Invoice"), // terminal: a voided invoice cannot be edited, sent or paid; a repeat is refused
153
+ conduyt_delete_invoice: destroy("Delete Invoice"),
154
+ conduyt_duplicate_invoice: create("Duplicate Invoice"),
155
+ conduyt_get_invoice_reminders: ro("Get Invoice Reminders"),
156
+ conduyt_set_invoice_reminders_paused: create("Set Invoice Reminders Paused"), // not idempotent by the parity26 ruling: the same value again changes nothing but still appends an audit record (invoices/[id]/reminders/route.ts)
157
+ conduyt_get_invoice_billing_summary: ro("Get Invoice Billing Summary"),
158
+ conduyt_list_tax_rates: ro("List Tax Rates"),
159
+ conduyt_create_tax_rate: create("Create Tax Rate"),
160
+ conduyt_update_tax_rate: update("Update Tax Rate"),
161
+ conduyt_archive_tax_rate: update("Archive Tax Rate"), // reversible archive (PATCH isActive true restores it)
147
162
  conduyt_list_webhooks: ro("List Webhooks"),
148
163
  conduyt_create_webhook: create("Create Webhook"),
149
164
  conduyt_update_webhook: update("Update Webhook"),
@@ -284,6 +299,7 @@ export const TOOL_ANNOTATIONS = {
284
299
  conduyt_get_product: ro("Get Product"),
285
300
  conduyt_create_product: create("Create Product"),
286
301
  conduyt_update_product: update("Update Product"),
302
+ conduyt_delete_product: update("Archive Product"), // answers { id, archived: true }; reversible with conduyt_update_product isActive true (products/[id]/route.ts DELETE)
287
303
  conduyt_list_templates: ro("List Templates"),
288
304
  conduyt_get_template: ro("Get Template"),
289
305
  conduyt_create_template: create("Create Template"),
@@ -1,7 +1,27 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
2
3
  import { ConduytClient } from "../client.js";
3
4
  /** Where a call's audio is fetched (no tool carries the bytes: a binary stream does not belong in a tool result). */
4
5
  export declare const RECORDING_DOWNLOAD_NOTE = "AUDIO is not returned by any tool: GET {API base}/api/v1/dialer/call/{id}/media?type=recording (or type=voicemail) streams it, with the header `Authorization: Bearer <the same API key>`; add `&download=1` (or `download=true`) for a `Content-Disposition: attachment` file named `<Contact or number>_<date>_<time>_<callId8>.mp3` (the same authorisation and the same stream; a call with no media is a 404). The conduyt CLI does this: `conduyt dialer recording download <callId> [--voicemail] [-o file]`.";
6
+ export declare const CALL_DISPOSITION_DESCRIPTION: string;
7
+ export declare const CALL_DISPOSITION_SCHEMA: {
8
+ id: z.ZodString;
9
+ disposition: z.ZodOptional<z.ZodString>;
10
+ notes: z.ZodOptional<z.ZodString>;
11
+ callbackAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
12
+ callbackMode: z.ZodOptional<z.ZodEnum<["task", "appointment"]>>;
13
+ callbackDurationMinutes: z.ZodOptional<z.ZodNumber>;
14
+ };
15
+ type CallDispositionArgs = {
16
+ id: string;
17
+ disposition?: string;
18
+ notes?: string;
19
+ callbackAt?: string;
20
+ callbackMode?: string;
21
+ callbackDurationMinutes?: number;
22
+ };
23
+ /** Mirrors the API's invalid_callback_fields 400s so a bad combination never leaves the machine. */
24
+ export declare function checkCallDisposition(a: CallDispositionArgs): void;
5
25
  /**
6
26
  * Dialer/call-history tools. Live call control (initiate, mute, hold,
7
27
  * transfer, hangup, vm-drop, record) is deliberately NOT exposed here —
@@ -11,3 +31,4 @@ export declare const RECORDING_DOWNLOAD_NOTE = "AUDIO is not returned by any too
11
31
  * exactly like a rep's "Search a contact" + Attach.
12
32
  */
13
33
  export declare function registerCallTools(server: McpServer, client: ConduytClient): void;
34
+ export {};
@@ -2,6 +2,34 @@ import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
3
  /** Where a call's audio is fetched (no tool carries the bytes: a binary stream does not belong in a tool result). */
4
4
  export const RECORDING_DOWNLOAD_NOTE = "AUDIO is not returned by any tool: GET {API base}/api/v1/dialer/call/{id}/media?type=recording (or type=voicemail) streams it, with the header `Authorization: Bearer <the same API key>`; add `&download=1` (or `download=true`) for a `Content-Disposition: attachment` file named `<Contact or number>_<date>_<time>_<callId8>.mp3` (the same authorisation and the same stream; a call with no media is a 404). The conduyt CLI does this: `conduyt dialer recording download <callId> [--voicemail] [-o file]`.";
5
+ /** (#1262) PATCH /dialer/call/{id}: the saved outcome of a call, and how a Callback is set up. */
6
+ const CALLBACK_MIN = 15;
7
+ const CALLBACK_MAX = 240;
8
+ export const CALL_DISPOSITION_DESCRIPTION = "Save a call's outcome (PATCH /api/v1/dialer/call/{id}; dialer scope; a rep saves only their own calls, an admin any). `disposition` is a built-in value (interested, not-interested, callback-requested, appointment-set, ...) or one of the account's custom outcomes. " +
9
+ "CALLBACK (disposition callback-requested, `callbackAt` = the callback time): `callbackMode` \"task\" (the default) creates a follow-up task due then and blocks nothing; \"appointment\" books a real calendar appointment for the call's agent at `callbackAt`, written back to their connected calendar and blocking that slot for booking. `callbackDurationMinutes` (a whole number from 15 to 240, default 30) only with the appointment mode. " +
10
+ "Saving the same callback again with the same mode returns the stored task or appointment and books nothing new; the other mode is refused 409 callback_mode_mismatch (the stored mode comes back as storedMode). " +
11
+ "Refusals, forwarded with their code and never retried: 400 invalid_callback_fields (a mode or duration on another disposition, a duration without the appointment mode or outside 15 to 240, an appointment without callbackAt); 400 callback_requires_contact (an appointment needs a contact on the call: match one, or use the task mode); 409 callback_conflict (the agent already has something on the calendar at that time: pick another time).";
12
+ export const CALL_DISPOSITION_SCHEMA = {
13
+ id: z.string().uuid().describe("Call UUID"),
14
+ disposition: z.string().trim().min(1).optional().describe("The outcome: a built-in value or a custom outcome of the account"),
15
+ notes: z.string().optional().describe("The rep's notes on the call"),
16
+ callbackAt: z.string().refine((v) => !Number.isNaN(new Date(v).getTime()), "callbackAt must be a date and time").optional().describe("The callback time (ISO 8601), with disposition callback-requested; required for callbackMode appointment"),
17
+ callbackMode: z.enum(["task", "appointment"]).optional().describe("task (default) = a follow-up task due at callbackAt, blocks nothing; appointment = a real calendar appointment for the call's agent that blocks the slot. Only with disposition callback-requested"),
18
+ callbackDurationMinutes: z.number().int().min(CALLBACK_MIN).max(CALLBACK_MAX).optional().describe("Appointment length in minutes, a whole number from 15 to 240 (default 30). Only with callbackMode appointment"),
19
+ };
20
+ /** Mirrors the API's invalid_callback_fields 400s so a bad combination never leaves the machine. */
21
+ export function checkCallDisposition(a) {
22
+ const callback = a.callbackMode !== undefined || a.callbackDurationMinutes !== undefined;
23
+ if (callback && !(a.disposition !== undefined && a.disposition.trim().toLowerCase().replace(/[\s_]+/g, "-") === "callback-requested")) {
24
+ throw new Error("callbackMode and callbackDurationMinutes apply only with disposition callback-requested.");
25
+ }
26
+ if (a.callbackDurationMinutes !== undefined && a.callbackMode !== "appointment")
27
+ throw new Error('callbackDurationMinutes applies only with callbackMode "appointment".');
28
+ if (a.callbackMode === "appointment" && a.callbackAt === undefined)
29
+ throw new Error('callbackMode "appointment" needs callbackAt (the callback time).');
30
+ if (a.disposition === undefined && a.notes === undefined && a.callbackAt === undefined)
31
+ throw new Error("Pass at least disposition or notes.");
32
+ }
5
33
  const SEARCH_FILTERS = {
6
34
  q: z.string().refine((v) => Array.from(v).length <= 200, "q is at most 200 characters").optional().describe("Search words (200 characters at most; a repeated q is a 400): matches the contact's name, a phone number, the agent's name and the call's transcript (NOT the call's notes); each row then carries `match`"),
7
35
  recordedOnly: z.boolean().optional().describe("true = only calls that have a recording (sent as recorded_only=1)"),
@@ -133,6 +161,17 @@ export function registerCallTools(server, client) {
133
161
  const result = await client.get(`/api/v1/dialer/call/${encodeURIComponent(id)}/post-call?include=${includeTranscript ? "transcript" : ""}`);
134
162
  return formatResult(result);
135
163
  });
164
+ server.tool("conduyt_save_call_disposition", CALL_DISPOSITION_DESCRIPTION, CALL_DISPOSITION_SCHEMA, async (args) => {
165
+ checkCallDisposition(args);
166
+ const result = await client.patch(`/api/v1/dialer/call/${encodeURIComponent(args.id)}`, {
167
+ disposition: args.disposition,
168
+ notes: args.notes,
169
+ callbackAt: args.callbackAt,
170
+ callbackMode: args.callbackMode,
171
+ callbackDurationMinutes: args.callbackDurationMinutes,
172
+ });
173
+ return formatResult(result);
174
+ });
136
175
  server.tool("conduyt_sync_local_presence", "Sync the dialer's Local Presence number pool from the account's Twilio subaccount. IMPORTANT — sync only adopts numbers that meet ALL of: (1) the Twilio FriendlyName contains a standalone 'LP' (or 'LocalPres'), e.g. 'LP Miami 305'; (2) the number is voice-capable; (3) it is a US +1 E.164 number. The first 50 matches in sorted order become the pool; anything already in the pool that no longer matches is REMOVED. So buying a number is not enough — name it with the LP convention in Twilio first, then run this. Returns pool/added/removed/matched. Requires settings:edit.", {}, async () => {
137
176
  const result = await client.post("/api/v1/dialer/local-presence/sync", {});
138
177
  return formatResult(result);
@@ -1,19 +1,36 @@
1
1
  import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
+ import { isPositiveAmount } from "./invoicing-checks.js";
4
+ // (parity25, conduyt-app batch25 #193 invoicing slice 1a-1) the typed answers the send routes give; a refusal is forwarded with its code, never retried
5
+ const SEND_CODES = "409 invoice_send_pending (an earlier send awaits the provider's confirmation; nothing was sent again, check the invoice later, do not send again), invoice_send_complained (the recipient marked an earlier send as spam), invoice_send_in_flight, invoice_not_sendable, no_contact; 503 gate_busy (nothing of this attempt exists; safe to try again shortly)";
6
+ const lineItem = z.object({
7
+ description: z.string().describe("Line item description"),
8
+ unitPrice: z.number().describe("Price per unit"),
9
+ quantity: z.number().optional().describe("Quantity (default 1)"),
10
+ productId: z.string().optional().describe("Product UUID to link"),
11
+ details: z.string().optional().describe("Extra text under the line"),
12
+ discountPercent: z.number().optional().describe("Discount on this line, percent"),
13
+ taxRateId: z.string().optional().describe("A saved tax rate (conduyt_list_tax_rates); the invoice keeps its own copy of the name and percent"),
14
+ taxName: z.string().optional().describe("A one-off tax name (with taxPercent)"),
15
+ taxPercent: z.number().optional().describe("A one-off tax percent (with taxName)"),
16
+ });
3
17
  export function registerInvoiceTools(server, client) {
4
- server.tool("conduyt_list_invoices", "List invoices with filtering by status, contact, or date range.", {
18
+ server.tool("conduyt_list_invoices", "List invoices with filtering by status, contact, deal, or date range. deal_id (one UUID) is the deal card's View all: 400 invalid_request if it is repeated or not a UUID, 403 for a key without the deals scope, 404 when the deal does not exist or the caller cannot see it.", {
5
19
  status: z.string().optional().describe("Filter by status (e.g. 'draft', 'sent', 'paid', 'overdue', 'voided')"),
6
20
  contact_id: z.string().optional().describe("Filter by contact UUID"),
21
+ deal_id: z.string().uuid().optional().describe("Filter by deal UUID (one value; an invalid or empty value is refused before any request)"),
7
22
  date_from: z.string().optional().describe("Start of date range (ISO 8601)"),
8
23
  date_to: z.string().optional().describe("End of date range (ISO 8601)"),
9
24
  page: z.number().optional().describe("Page number (default 1)"),
10
25
  per_page: z.number().optional().describe("Results per page"),
11
- }, async ({ status, contact_id, date_from, date_to, page, per_page }) => {
26
+ }, async ({ status, contact_id, deal_id, date_from, date_to, page, per_page }) => {
12
27
  const params = new URLSearchParams();
13
28
  if (status)
14
29
  params.set("status", status);
15
30
  if (contact_id)
16
31
  params.set("contact_id", contact_id);
32
+ if (deal_id !== undefined)
33
+ params.set("deal_id", deal_id);
17
34
  if (date_from)
18
35
  params.set("date_from", date_from);
19
36
  if (date_to)
@@ -32,12 +49,7 @@ export function registerInvoiceTools(server, client) {
32
49
  return formatResult(result);
33
50
  });
34
51
  server.tool("conduyt_create_invoice", "Create a new invoice with line items. Automatically calculates subtotal, tax, and total.", {
35
- items: z.array(z.object({
36
- description: z.string().describe("Line item description"),
37
- unitPrice: z.number().describe("Price per unit"),
38
- quantity: z.number().optional().describe("Quantity (default 1)"),
39
- productId: z.string().optional().describe("Product UUID to link"),
40
- })).describe("Line items (at least 1 required)"),
52
+ items: z.array(lineItem).describe("Line items (at least 1 required)"),
41
53
  contactId: z.string().optional().describe("Bill-to contact UUID"),
42
54
  companyId: z.string().optional().describe("Bill-to company UUID"),
43
55
  dealId: z.string().optional().describe("Associated deal UUID"),
@@ -46,13 +58,18 @@ export function registerInvoiceTools(server, client) {
46
58
  currency: z.string().optional().describe("3-letter currency code (default: USD)"),
47
59
  notes: z.string().optional().describe("Notes visible to client"),
48
60
  terms: z.string().optional().describe("Payment terms"),
61
+ issueDate: z.string().optional().describe("Issue date (YYYY-MM-DD)"),
62
+ paymentTerms: z.string().optional().describe("Payment-terms preset; a preset sets the due date (400 due_date_set_by_terms if dueDate is also sent)"),
63
+ discountPercent: z.number().optional().describe("Invoice-level discount, percent"),
64
+ attachmentIds: z.array(z.string()).optional().describe("Uploaded file ids to attach"),
65
+ invoiceNumber: z.string().optional().describe("Invoice number (default: the next number)"),
49
66
  }, async (params) => {
50
67
  // The create route requires a valid currency (no server-side default),
51
68
  // so always send one — honoring the documented USD default.
52
69
  const result = await client.post("/api/v1/invoices", { ...params, currency: params.currency ?? "USD" });
53
70
  return formatResult(result);
54
71
  });
55
- server.tool("conduyt_update_invoice", "Update a draft invoice — change items, contact, due date, or terms. Cannot update paid or voided invoices.", {
72
+ server.tool("conduyt_update_invoice", "Update an invoice — change items, contact, due date, terms, issue date, discount or attachments. Cannot update paid or voided invoices (400). 409 refusals carry a code: total_below_paid (the new total is below the money already recorded), currency_locked (a payment exists), no_contact (a sent invoice keeps a contact), invoice_send_in_flight (a send still owes its outcome; try again in a moment).", {
56
73
  id: z.string().describe("Invoice UUID"),
57
74
  contactId: z.string().optional().describe("Updated bill-to contact"),
58
75
  companyId: z.string().optional().describe("Updated bill-to company"),
@@ -60,19 +77,80 @@ export function registerInvoiceTools(server, client) {
60
77
  notes: z.string().optional().describe("Updated notes"),
61
78
  terms: z.string().optional().describe("Updated terms"),
62
79
  taxRate: z.number().optional().describe("Updated tax rate"),
63
- items: z.array(z.object({
64
- description: z.string().describe("Line item description"),
65
- unitPrice: z.number().describe("Price per unit"),
66
- quantity: z.number().optional().describe("Quantity"),
67
- })).optional().describe("Replacement line items (replaces all existing items)"),
80
+ items: z.array(lineItem).optional().describe("Replacement line items (replaces all existing items)"),
81
+ issueDate: z.string().optional().describe("Updated issue date (YYYY-MM-DD)"),
82
+ paymentTerms: z.string().nullable().optional().describe("Payment-terms preset, or null to clear"),
83
+ discountPercent: z.number().optional().describe("Updated invoice-level discount, percent"),
84
+ attachmentIds: z.array(z.string()).optional().describe("Uploaded file ids to attach (replaces the attachments)"),
68
85
  }, async ({ id, ...updates }) => {
69
86
  const result = await client.patch(`/api/v1/invoices/${id}`, updates);
70
87
  return formatResult(result);
71
88
  });
72
- server.tool("conduyt_send_invoice", "Send an invoice to the contact via email. Generates PDF, creates Stripe payment link, and sends via email.", {
89
+ server.tool("conduyt_send_invoice", `Send an invoice to the contact via email. Generates PDF, creates Stripe payment link, and sends via email. A repeat is the current send or its retry, never a second email; resend true starts a NEW send. Refusals are forwarded with their code and never retried: ${SEND_CODES}. Text it is conduyt_send_sms with invoiceId; conduyt_get_invoice_send_options says what can be sent now.`, {
73
90
  id: z.string().describe("Invoice UUID — must be draft, pending, sent, or overdue"),
74
- }, async ({ id }) => {
75
- const result = await client.post(`/api/v1/invoices/${id}/send`, {});
91
+ resend: z.boolean().optional().describe("true sends the invoice again as a NEW send (a new intent key, a new email); omitted or false is the current send or its retry"),
92
+ }, async ({ id, resend }) => {
93
+ const result = await client.post(`/api/v1/invoices/${id}/send`, { resend: resend === true ? true : undefined });
94
+ return formatResult(result);
95
+ });
96
+ server.tool("conduyt_get_invoice_send_options", "What Send can do for an invoice right now (Email, Text it, Copy link; Mark as sent always works), each unavailable option with its reason, the hosted link and the exact text Text it would send.", { id: z.string().describe("Invoice UUID") }, async ({ id }) => {
97
+ const result = await client.get(`/api/v1/invoices/${id}/send-options`);
98
+ return formatResult(result);
99
+ });
100
+ server.tool("conduyt_get_invoice_activity", "The invoice's history, newest first: sent, viewed, payments, paid, overdue, voided with its reason.", { id: z.string().describe("Invoice UUID") }, async ({ id }) => {
101
+ const result = await client.get(`/api/v1/invoices/${id}/activity`);
102
+ return formatResult(result);
103
+ });
104
+ server.tool("conduyt_mark_invoice_sent", "Record that an invoice went out without the email: delivered another way (via manual) or its link copied to send (via link). A draft moves to Sent; a sent, viewed, partly paid or overdue invoice keeps its status and records the send. 409 invoice_not_sendable (paid or voided) and no_contact are forwarded with their code. Text it is conduyt_send_sms with invoiceId.", {
105
+ id: z.string().describe("Invoice UUID"),
106
+ via: z.enum(["manual", "link"]).describe("manual = delivered another way; link = the link was copied to send"),
107
+ }, async ({ id, via }) => {
108
+ const result = await client.post(`/api/v1/invoices/${id}/mark-sent`, { via });
109
+ return formatResult(result);
110
+ });
111
+ server.tool("conduyt_record_invoice_payment", "Record a payment received outside Stripe (cash, check, bank). The amount must be above 0 and at most the balance due (400 naming the balance); 409 invoice_zero_balance when nothing is owed. A recorded payment cannot be removed through the API. Needs the record_payment permission.", {
112
+ id: z.string().describe("Invoice UUID"),
113
+ amount: z.union([z.number(), z.string()]).refine(isPositiveAmount, "amount must be a finite number above 0 (a decimal such as 12.50)").describe("Amount received: a number (or numeric string) above 0, for example 12.50"),
114
+ method: z.enum(["card", "bank", "bank_transfer", "cash", "check", "other"]).optional().describe("How it was paid (default card)"),
115
+ reference: z.string().optional().describe("A check number, transfer id or other reference"),
116
+ notes: z.string().max(2000).optional().describe("A note kept with the payment (max 2000 characters)"),
117
+ paidAt: z.string().min(1).max(40).optional().describe("When it was received: a YYYY-MM-DD day or an ISO 8601 date-time"),
118
+ }, async ({ id, amount, method, reference, notes, paidAt }) => {
119
+ const result = await client.post(`/api/v1/invoices/${id}/payments`, { amount, method, reference, notes, paidAt });
120
+ return formatResult(result);
121
+ });
122
+ server.tool("conduyt_void_invoice", "Void an invoice with a reason (kept on the invoice and in its history). Destructive: a voided invoice cannot be edited, sent or paid. A paid or already voided invoice is refused (400); a missing or blank reason is 400 void_reason_required, over 500 characters 400 void_reason_too_long. Needs the record_payment permission.", {
123
+ id: z.string().describe("Invoice UUID"),
124
+ reason: z.string().trim().min(1).max(500).describe("Why the invoice is voided (required, 1-500 characters after trimming)"),
125
+ }, async ({ id, reason }) => {
126
+ const result = await client.post(`/api/v1/invoices/${id}/void`, { reason });
127
+ return formatResult(result);
128
+ });
129
+ server.tool("conduyt_delete_invoice", "Delete a DRAFT invoice with no payment history (anything else is a 400; void an invoice that went out instead). Refused while a send of it is in flight: 409 invoice_send_in_flight (check it again in a moment). Destructive.", { id: z.string().describe("Invoice UUID") }, async ({ id }) => {
130
+ const result = await client.del(`/api/v1/invoices/${id}`);
131
+ return formatResult(result);
132
+ });
133
+ server.tool("conduyt_duplicate_invoice", "Copy an invoice into a new DRAFT: the same customer, company, deal, currency, payment terms, notes, terms, discount and lines, a new number, issued today. The bill-to contact and deal are copied only when the caller may still attach them.", { id: z.string().describe("Invoice UUID to copy") }, async ({ id }) => {
134
+ const result = await client.post(`/api/v1/invoices/${id}/duplicate`, {});
135
+ return formatResult(result);
136
+ });
137
+ server.tool("conduyt_get_invoice_reminders", "What the account's Invoice reminders automation does for THIS invoice (the invoice page's Reminders card): { state, automation, applies, steps }. state is on, paused (this invoice's switch is off), inactive (a reminders automation exists but none is active) or none (no reminders automation). automation is { id, name, isActive } or null; applies is true only while the invoice is out for payment (sent, viewed, partly paid, overdue); each step is { nodeId, label, at, sent } with the date it is due and what went out when. 404 when the invoice does not exist or the caller cannot see it.", { id: z.string().uuid().describe("Invoice UUID") }, async ({ id }) => {
138
+ const result = await client.get(`/api/v1/invoices/${encodeURIComponent(id)}/reminders`);
139
+ return formatResult(result);
140
+ });
141
+ server.tool("conduyt_set_invoice_reminders_paused", "The invoice's Reminders switch: paused true makes the Invoice reminders automation skip this invoice's reminders (its waits still run), paused false resumes the next one. Nothing is scheduled by this call: the reminders are the automation. Returns the same view as conduyt_get_invoice_reminders. Setting the value it already has changes nothing (an audit record is still appended). 400 invalid_request (paused must be true or false; an unknown key is refused), 404 when the invoice does not exist or the caller may not edit it.", { id: z.string().uuid().describe("Invoice UUID"), paused: z.boolean().describe("true = skip this invoice's reminders; false = resume") }, async ({ id, paused }) => {
142
+ const result = await client.patch(`/api/v1/invoices/${encodeURIComponent(id)}/reminders`, { paused });
143
+ return formatResult(result);
144
+ });
145
+ server.tool("conduyt_get_invoice_billing_summary", "The billing state the Invoices card shows on a deal or a contact page: { totals, latest, count }. totals is per currency { currency, invoiced, paid, outstanding, overdue, count }; latest is the newest invoices (id, invoiceNumber, status, total, amountPaid, balance, currency, dates, contactId, dealId). Pass exactly one of dealId or contactId (refused before any request otherwise; the API answers 400 invalid_request). 403 for a key without the deals scope on a dealId; 404 when the deal or contact does not exist or the caller cannot see it.", { dealId: z.string().uuid().optional().describe("Deal UUID"), contactId: z.string().uuid().optional().describe("Contact UUID") }, async ({ dealId, contactId }) => {
146
+ if ((dealId === undefined) === (contactId === undefined))
147
+ throw new Error("Pass exactly one of dealId or contactId.");
148
+ const params = new URLSearchParams();
149
+ if (dealId !== undefined)
150
+ params.set("deal_id", dealId);
151
+ else if (contactId !== undefined)
152
+ params.set("contact_id", contactId);
153
+ const result = await client.get(`/api/v1/invoices/summary?${params}`);
76
154
  return formatResult(result);
77
155
  });
78
156
  }
@@ -0,0 +1,2 @@
1
+ export declare function isPositiveAmount(v: unknown): boolean;
2
+ export declare function isTaxPercent(v: unknown): boolean;
@@ -0,0 +1,29 @@
1
+ // (parity25 r2, Codex parity25-r1 P2-1 and P2-2) the server's number rules, mirrored before any request: a decimal literal only
2
+ // (a string like "abc", "-1", "1e3" is refused), finite, and either above 0 (payment amount) or within 0..100 with at most three
3
+ // decimals (tax percent, trailing zeros do not count: "8.8750" is three).
4
+ const DECIMAL_LITERAL = /^\d+(\.\d+)?$/;
5
+ function asNumber(v) {
6
+ if (typeof v === "number")
7
+ return Number.isFinite(v) ? { n: v, text: String(v) } : null;
8
+ if (typeof v !== "string")
9
+ return null;
10
+ const t = v.trim();
11
+ if (!DECIMAL_LITERAL.test(t))
12
+ return null;
13
+ const n = Number(t);
14
+ return Number.isFinite(n) ? { n, text: t } : null;
15
+ }
16
+ export function isPositiveAmount(v) {
17
+ const x = asNumber(v);
18
+ return x !== null && x.n > 0;
19
+ }
20
+ function decimalPlaces(text) {
21
+ if (/e/i.test(text))
22
+ return Number.POSITIVE_INFINITY; // an exponent form of a JS number (1e-7): not a plain decimal
23
+ const frac = text.split(".")[1] ?? "";
24
+ return frac.replace(/0+$/, "").length;
25
+ }
26
+ export function isTaxPercent(v) {
27
+ const x = asNumber(v);
28
+ return x !== null && x.n >= 0 && x.n <= 100 && decimalPlaces(x.text) <= 3;
29
+ }
@@ -75,7 +75,12 @@ export function registerMessagingTools(server, client) {
75
75
  whatsappContentSid: z.string().regex(/^HX[0-9a-fA-F]{32}$/).optional().describe("transport whatsapp: an APPROVED WhatsApp template (Twilio Content SID from conduyt_whatsapp_templates); Conduyt reads the template from Twilio at send time, records its text with the variables in place, and refuses an unlisted (whatsapp_template_invalid) or unapproved (whatsapp_template_not_approved) one. body is still required but the template's text is what is sent and recorded."),
76
76
  whatsappContentVariables: z.record(z.string().regex(/^\d+$/), z.string().max(1024)).optional().describe("transport whatsapp with a template: placeholder number → value, e.g. { \"1\": \"Alex\" }"),
77
77
  idempotencyKey: z.string().min(8).max(200).optional().describe("Operation key for at-most-once sends: reuse the SAME key when retrying a send whose outcome you did not see; a settled key answers with the original message and never sends twice."),
78
+ invoiceId: z.string().uuid().optional().describe("Text it: this text sends an invoice. The contact must be the invoice's own and body must carry its hosted link (conduyt_get_invoice_send_options returns the exact text). Refusals are forwarded with their code and never retried: 409 invoice_send_pending (an earlier text awaits the provider's confirmation; nothing was sent again), invoice_not_sendable, no_contact, invoice_contact_mismatch; 400 invoice_link_missing; 404 invoice_not_found."),
79
+ resend: z.boolean().optional().describe("With invoiceId: true texts the invoice again as a NEW send; omitted or false is the current send or its retry, never a second text."),
78
80
  }, async (params) => {
81
+ // (parity25 r2) resend goes on the wire only when true
82
+ if (params.resend !== true)
83
+ delete params.resend;
79
84
  const result = await client.post("/api/v1/messages/sms/send", params);
80
85
  return formatResult(result);
81
86
  });
@@ -35,6 +35,7 @@ export function registerProductTools(server, client) {
35
35
  taxable: z.boolean().optional().describe("Whether product is taxable (default true)"),
36
36
  isActive: z.boolean().optional().describe("Whether product is active (default true)"),
37
37
  metadata: z.any().optional().describe("Additional metadata object"),
38
+ defaultTaxRateId: z.string().uuid().nullable().optional().describe("The saved tax rate (conduyt_list_tax_rates) new invoice lines from this product start with"),
38
39
  }, async (params) => {
39
40
  const result = await client.post("/api/v1/products", params);
40
41
  return formatResult(result);
@@ -48,8 +49,15 @@ export function registerProductTools(server, client) {
48
49
  currency: z.string().optional().describe("Updated currency"),
49
50
  taxable: z.boolean().optional().describe("Updated taxable status"),
50
51
  isActive: z.boolean().optional().describe("Updated active status"),
52
+ unit: z.string().optional().describe("Updated unit of measure"),
53
+ metadata: z.any().optional().describe("Updated metadata object"),
54
+ defaultTaxRateId: z.string().uuid().nullable().optional().describe("The saved tax rate new invoice lines from this product start with; null clears it"),
51
55
  }, async ({ id, ...updates }) => {
52
56
  const result = await client.patch(`/api/v1/products/${id}`, updates);
53
57
  return formatResult(result);
54
58
  });
59
+ server.tool("conduyt_delete_product", "Archive (delete) a product: it leaves the catalog pickers and answers { id, archived: true }. Needs the invoices delete permission.", { id: z.string().describe("Product UUID") }, async ({ id }) => {
60
+ const result = await client.del(`/api/v1/products/${id}`);
61
+ return formatResult(result);
62
+ });
55
63
  }
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ export declare function registerTaxRateTools(server: McpServer, client: ConduytClient): void;
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { formatResult } from "../client.js";
3
+ import { isTaxPercent } from "./invoicing-checks.js";
4
+ // (parity25, conduyt-app batch25 #193 invoicing slice 1a-1) saved tax rates for invoice lines and products
5
+ const name = z.string().trim().min(1).max(80).describe("Rate name, 1-80 characters after trimming");
6
+ const percent = z.union([z.number(), z.string()]).refine(isTaxPercent, "percent must be a number from 0 to 100 with at most three decimals").describe("0 to 100 with at most three decimals (a number or numeric string, \"8.875\" is accepted); anything else is a 400");
7
+ export function registerTaxRateTools(server, client) {
8
+ server.tool("conduyt_list_tax_rates", "List the account's saved tax rates (the ones invoice lines and products can use). Archived rates are hidden unless includeArchived is true.", {
9
+ includeArchived: z.boolean().optional().describe("Also list archived rates"),
10
+ }, async ({ includeArchived }) => {
11
+ const params = new URLSearchParams();
12
+ if (includeArchived === true)
13
+ params.set("include_archived", "true");
14
+ const result = await client.get(`/api/v1/tax-rates?${params}`);
15
+ return formatResult(result);
16
+ });
17
+ server.tool("conduyt_create_tax_rate", "Create a saved tax rate. An account keeps up to a fixed number of active rates: 409 tax_rate_cap (archive one first).", { name, percent }, async (params) => {
18
+ const result = await client.post("/api/v1/tax-rates", params);
19
+ return formatResult(result);
20
+ });
21
+ server.tool("conduyt_update_tax_rate", "Rename a tax rate, change its percent, or archive / restore it (isActive). Invoices that already used the rate keep their own copy of the name and percent; only new lines pick up a change. Archiving or restoring needs the invoices delete permission (403 otherwise); restoring past the cap is 409 tax_rate_cap.", {
22
+ id: z.string().describe("Tax rate UUID"),
23
+ name: name.optional(),
24
+ percent: percent.optional(),
25
+ isActive: z.boolean().optional().describe("false archives the rate, true restores it"),
26
+ }, async ({ id, ...updates }) => {
27
+ const result = await client.patch(`/api/v1/tax-rates/${id}`, updates);
28
+ return formatResult(result);
29
+ });
30
+ server.tool("conduyt_archive_tax_rate", "Archive a tax rate (hidden from the pickers; products that defaulted to it keep it until changed; restore with conduyt_update_tax_rate isActive true). Answers { id, archived }. Needs the invoices delete permission.", { id: z.string().describe("Tax rate UUID") }, async ({ id }) => {
31
+ const result = await client.del(`/api/v1/tax-rates/${id}`);
32
+ return formatResult(result);
33
+ });
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.14",
3
+ "version": "4.105.17",
4
4
  "mcpName": "com.conduyt/mcp",
5
5
  "description": "MCP server for Conduyt CRM — expose CRM operations as AI-accessible tools",
6
6
  "type": "module",
@@ -1,11 +1,11 @@
1
1
  {
2
- "generatedAt": "2026-11-10T06:52:52.055Z",
3
- "toolCount": 399,
4
- "totalEndpoints": 1177,
2
+ "generatedAt": "2026-11-11T01:18:38.260Z",
3
+ "toolCount": 415,
4
+ "totalEndpoints": 1193,
5
5
  "counts": {
6
- "covered": 351,
7
- "excluded": 364,
8
- "planned": 462,
6
+ "covered": 367,
7
+ "excluded": 368,
8
+ "planned": 458,
9
9
  "uncategorized": 0
10
10
  },
11
11
  "matrix": {
@@ -186,8 +186,28 @@
186
186
  ]
187
187
  },
188
188
  "DELETE /api/v1/invoices/:id": {
189
- "status": "planned",
190
- "reason": "invoicing"
189
+ "status": "covered",
190
+ "tools": [
191
+ "conduyt_delete_invoice"
192
+ ]
193
+ },
194
+ "GET /api/v1/invoices/:id/activity": {
195
+ "status": "covered",
196
+ "tools": [
197
+ "conduyt_get_invoice_activity"
198
+ ]
199
+ },
200
+ "POST /api/v1/invoices/:id/duplicate": {
201
+ "status": "covered",
202
+ "tools": [
203
+ "conduyt_duplicate_invoice"
204
+ ]
205
+ },
206
+ "POST /api/v1/invoices/:id/mark-sent": {
207
+ "status": "covered",
208
+ "tools": [
209
+ "conduyt_mark_invoice_sent"
210
+ ]
191
211
  },
192
212
  "POST /api/v1/invoices/:id/overpayments/:overpaymentId/manual-refund": {
193
213
  "status": "planned",
@@ -206,27 +226,55 @@
206
226
  "reason": "invoicing"
207
227
  },
208
228
  "POST /api/v1/invoices/:id/payments": {
209
- "status": "planned",
210
- "reason": "invoicing"
229
+ "status": "covered",
230
+ "tools": [
231
+ "conduyt_record_invoice_payment"
232
+ ]
211
233
  },
212
234
  "GET /api/v1/invoices/:id/pdf": {
213
235
  "status": "planned",
214
236
  "reason": "invoicing"
215
237
  },
238
+ "GET /api/v1/invoices/:id/reminders": {
239
+ "status": "covered",
240
+ "tools": [
241
+ "conduyt_get_invoice_reminders"
242
+ ]
243
+ },
244
+ "PATCH /api/v1/invoices/:id/reminders": {
245
+ "status": "covered",
246
+ "tools": [
247
+ "conduyt_set_invoice_reminders_paused"
248
+ ]
249
+ },
216
250
  "POST /api/v1/invoices/:id/send": {
217
251
  "status": "covered",
218
252
  "tools": [
219
253
  "conduyt_send_invoice"
220
254
  ]
221
255
  },
256
+ "GET /api/v1/invoices/:id/send-options": {
257
+ "status": "covered",
258
+ "tools": [
259
+ "conduyt_get_invoice_send_options"
260
+ ]
261
+ },
222
262
  "POST /api/v1/invoices/:id/void": {
223
- "status": "planned",
224
- "reason": "invoicing"
263
+ "status": "covered",
264
+ "tools": [
265
+ "conduyt_void_invoice"
266
+ ]
225
267
  },
226
268
  "GET /api/v1/invoices/next-number": {
227
269
  "status": "planned",
228
270
  "reason": "invoicing"
229
271
  },
272
+ "GET /api/v1/invoices/summary": {
273
+ "status": "covered",
274
+ "tools": [
275
+ "conduyt_get_invoice_billing_summary"
276
+ ]
277
+ },
230
278
  "POST /api/public/subscribe": {
231
279
  "status": "excluded",
232
280
  "reason": "public unauthenticated surfaces (forms, booking, unsubscribe) — no key semantics"
@@ -389,6 +437,18 @@
389
437
  "status": "excluded",
390
438
  "reason": "super-admin platform operations (Conduyt staff only)"
391
439
  },
440
+ "GET /api/v1/admin/external-deletions/calendar-ops": {
441
+ "status": "excluded",
442
+ "reason": "super-admin platform operations (Conduyt staff only)"
443
+ },
444
+ "POST /api/v1/admin/external-deletions/calendar-ops/:id/resolve": {
445
+ "status": "excluded",
446
+ "reason": "super-admin platform operations (Conduyt staff only)"
447
+ },
448
+ "POST /api/v1/admin/external-deletions/calendar-ops/:id/retry": {
449
+ "status": "excluded",
450
+ "reason": "super-admin platform operations (Conduyt staff only)"
451
+ },
392
452
  "POST /api/v1/admin/external-deletions/records/keep": {
393
453
  "status": "excluded",
394
454
  "reason": "super-admin platform operations (Conduyt staff only)"
@@ -2022,6 +2082,10 @@
2022
2082
  "status": "excluded",
2023
2083
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2024
2084
  },
2085
+ "GET /api/v1/cron/invoice-overdue": {
2086
+ "status": "excluded",
2087
+ "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2088
+ },
2025
2089
  "GET /api/v1/cron/job-run-monitor": {
2026
2090
  "status": "excluded",
2027
2091
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
@@ -2078,6 +2142,10 @@
2078
2142
  "status": "excluded",
2079
2143
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2080
2144
  },
2145
+ "GET /api/v1/cron/process-calendar-provider-ops": {
2146
+ "status": "excluded",
2147
+ "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2148
+ },
2081
2149
  "GET /api/v1/cron/process-calendly-sync": {
2082
2150
  "status": "excluded",
2083
2151
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
@@ -2650,8 +2718,10 @@
2650
2718
  "reason": "realtime browser dialer (WebRTC tokens, live call control) — needs a live audio session"
2651
2719
  },
2652
2720
  "PATCH /api/v1/dialer/call/:id": {
2653
- "status": "excluded",
2654
- "reason": "realtime browser dialer (WebRTC tokens, live call control) — needs a live audio session"
2721
+ "status": "covered",
2722
+ "tools": [
2723
+ "conduyt_save_call_disposition"
2724
+ ]
2655
2725
  },
2656
2726
  "POST /api/v1/dialer/call/:id/ai-disposition": {
2657
2727
  "status": "covered",
@@ -3946,8 +4016,10 @@
3946
4016
  ]
3947
4017
  },
3948
4018
  "DELETE /api/v1/products/:id": {
3949
- "status": "planned",
3950
- "reason": "product catalog subroutes"
4019
+ "status": "covered",
4020
+ "tools": [
4021
+ "conduyt_delete_product"
4022
+ ]
3951
4023
  },
3952
4024
  "GET /api/v1/public/booking/:slug": {
3953
4025
  "status": "excluded",
@@ -5101,6 +5173,30 @@
5101
5173
  "status": "planned",
5102
5174
  "reason": "task subroutes beyond core CRUD"
5103
5175
  },
5176
+ "GET /api/v1/tax-rates": {
5177
+ "status": "covered",
5178
+ "tools": [
5179
+ "conduyt_list_tax_rates"
5180
+ ]
5181
+ },
5182
+ "POST /api/v1/tax-rates": {
5183
+ "status": "covered",
5184
+ "tools": [
5185
+ "conduyt_create_tax_rate"
5186
+ ]
5187
+ },
5188
+ "PATCH /api/v1/tax-rates/:id": {
5189
+ "status": "covered",
5190
+ "tools": [
5191
+ "conduyt_update_tax_rate"
5192
+ ]
5193
+ },
5194
+ "DELETE /api/v1/tax-rates/:id": {
5195
+ "status": "covered",
5196
+ "tools": [
5197
+ "conduyt_archive_tax_rate"
5198
+ ]
5199
+ },
5104
5200
  "GET /api/v1/team/members": {
5105
5201
  "status": "planned",
5106
5202
  "reason": "team member listing alias"