conduyt-mcp 4.105.29 → 4.105.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/tool-annotations.js +4 -0
- package/dist/tools/bulk.js +4 -1
- package/dist/tools/deal-views.d.ts +60 -0
- package/dist/tools/deal-views.js +69 -0
- package/dist/tools/deals.js +30 -1
- package/package.json +1 -1
- package/scripts/coverage-matrix.json +19 -11
package/README.md
CHANGED
|
@@ -340,7 +340,7 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
|
|
|
340
340
|
|------|-------------|
|
|
341
341
|
| `conduyt_ai_import_contacts` | AI-powered bulk import (up to 1000, auto-tag, smart list, automation) |
|
|
342
342
|
| `conduyt_export_contacts` | Export contacts as JSON with filters |
|
|
343
|
-
| `conduyt_export_deals` | Export deals as JSON with filters |
|
|
343
|
+
| `conduyt_export_deals` | Export deals as JSON with the board's filters (owner, tags, time zone, dates, value, health) |
|
|
344
344
|
| `conduyt_bulk_tag_contacts` | Add one tag to many contacts |
|
|
345
345
|
| `conduyt_bulk_untag_contacts` | Remove one tag from many contacts |
|
|
346
346
|
| `conduyt_bulk_edit_contacts` | Apply the same field changes to many contacts |
|
package/dist/tool-annotations.js
CHANGED
|
@@ -44,6 +44,10 @@ export const TOOL_ANNOTATIONS = {
|
|
|
44
44
|
conduyt_import_deals: create("Import Deals"),
|
|
45
45
|
conduyt_add_deal_tags: update("Add Deal Tags"),
|
|
46
46
|
conduyt_list_deal_views: ro("List Deal Views"),
|
|
47
|
+
conduyt_get_deal_view: ro("Get Deal View"),
|
|
48
|
+
conduyt_create_deal_view: create("Create Deal View"),
|
|
49
|
+
conduyt_update_deal_view: update("Update Deal View"),
|
|
50
|
+
conduyt_delete_deal_view: destroy("Delete Deal View"),
|
|
47
51
|
conduyt_list_tasks: ro("List Tasks"),
|
|
48
52
|
conduyt_create_task: create("Create Task"),
|
|
49
53
|
conduyt_get_task: ro("Get Task"),
|
package/dist/tools/bulk.js
CHANGED
|
@@ -3,6 +3,7 @@ import { formatResult } from "../client.js";
|
|
|
3
3
|
import { INVALID_NUMBER_REFUSALS } from "./contacts.js";
|
|
4
4
|
import { strictInput } from "./strict.js";
|
|
5
5
|
import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
|
|
6
|
+
import { appendDealExportFilters, dealExportFilterShape } from "./deal-views.js";
|
|
6
7
|
/** (#136, Codex r1 m2) POST /bulk/contacts/update is NOT atomic and answers per row: an impossible phone is a per-row success:false inside HTTP 200 (no code) while other rows commit; the route takes no country */
|
|
7
8
|
export const BULK_UPDATE_REFUSALS = " Results are PER ROW inside an HTTP 200 (not atomic: some rows can be saved while others fail): read data.summary { total, succeeded, failed } and data.results, each { id, success, error? }. An impossible US/Canada number (area code or exchange starting 0 or 1) fails only that row, success: false with the error text (no phone_invalid code, no top-level 400), and nothing is saved for that row. This route does not take country: a country-only row fails as a row, and a country sent beside another field is ignored while that field is applied (use conduyt_bulk_edit_contacts for a country; it refuses a null or blank country 400 country_invalid).";
|
|
8
9
|
export function registerBulkTools(server, client) {
|
|
@@ -66,11 +67,12 @@ export function registerBulkTools(server, client) {
|
|
|
66
67
|
});
|
|
67
68
|
return formatResult(result);
|
|
68
69
|
});
|
|
69
|
-
server.tool("conduyt_export_deals", "Export deals as JSON with
|
|
70
|
+
server.tool("conduyt_export_deals", "Export deals as JSON (GET /api/v1/deals/export, owner or admin only: otherwise 403) with the board's filters: search, status, pipeline, assigned_to (user UUIDs or `unassigned`, at most 25 distinct owners), tag_ids (tag UUIDs, ANY match, at most 25), contact_timezone, created_after / created_before (YYYY-MM-DD in the account time zone, day-inclusive, or an ISO datetime with offset), value_min / value_max, needsAction, stale, health (one Pipeline health check). Answer: { deals, meta { total, exported_at, filters_applied } }; Secure custom field values are masked. The whole filtered book is read in one request (not streamed): at most 50,000 rows, past that 413 and nothing is exported (narrow the filters); rate limited to 5 exports a minute per workspace and address (429). Each repeated filter is sent as repeated query parameters, never comma-joined; the owner and tag caps are also checked here, before any request. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param). TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + " The export applies the same rule as conduyt_list_deals.", {
|
|
70
71
|
search: z.string().optional().describe("Search deal titles"),
|
|
71
72
|
status: z.string().optional().describe("Filter by status (open, won, lost)"),
|
|
72
73
|
pipeline: z.string().optional().describe("Filter by pipeline UUID"),
|
|
73
74
|
contact_timezone: contactTimezoneSchema,
|
|
75
|
+
...dealExportFilterShape,
|
|
74
76
|
}, async (params) => {
|
|
75
77
|
const qp = new URLSearchParams({ format: "json" });
|
|
76
78
|
if (params.search)
|
|
@@ -80,6 +82,7 @@ export function registerBulkTools(server, client) {
|
|
|
80
82
|
if (params.pipeline)
|
|
81
83
|
qp.set("pipeline", params.pipeline);
|
|
82
84
|
appendContactTimezone(qp, params.contact_timezone);
|
|
85
|
+
appendDealExportFilters(qp, params);
|
|
83
86
|
// Same widened-but-bounded budget as the contacts export.
|
|
84
87
|
const result = await client.get(`/api/v1/deals/export?${qp}`, {
|
|
85
88
|
timeoutMs: 120_000,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** (dealsviews) the deal export filters and the saved deal view tools' shared pieces: GET /deals/export, GET|POST /deals/views, GET|PATCH|DELETE /deals/views/{id}. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** the caps the API applies (conduyt-app lib/deal-filter-params.ts MAX_OWNER_FILTERS / MAX_TAG_FILTERS) */
|
|
4
|
+
export declare const MAX_OWNER_FILTERS = 25;
|
|
5
|
+
export declare const MAX_TAG_FILTERS = 25;
|
|
6
|
+
/** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
|
|
7
|
+
export declare const dealExportFilterShape: {
|
|
8
|
+
assigned_to: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
9
|
+
tag_ids: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
10
|
+
created_after: z.ZodOptional<z.ZodString>;
|
|
11
|
+
created_before: z.ZodOptional<z.ZodString>;
|
|
12
|
+
value_min: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
value_max: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
needsAction: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
stale: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
health: z.ZodOptional<z.ZodString>;
|
|
17
|
+
};
|
|
18
|
+
type ExportFilters = {
|
|
19
|
+
assigned_to?: string | string[];
|
|
20
|
+
tag_ids?: string | string[];
|
|
21
|
+
created_after?: string;
|
|
22
|
+
created_before?: string;
|
|
23
|
+
value_min?: number;
|
|
24
|
+
value_max?: number;
|
|
25
|
+
needsAction?: boolean;
|
|
26
|
+
stale?: boolean;
|
|
27
|
+
health?: string;
|
|
28
|
+
};
|
|
29
|
+
/** appends the extra export filters; throws the API's cap wording past a cap (owners count DISTINCT UUIDs, tags count every entry, as the API does) */
|
|
30
|
+
export declare function appendDealExportFilters(qp: URLSearchParams, p: ExportFilters): void;
|
|
31
|
+
export declare const DEAL_VIEW_RULES_DOC = "A view's `filters` is a flat ARRAY of rules { field, operator, value } that are ANDed; value is always a STRING (a comma-separated list for operator in; every rule carries a value: send \"\" for is_empty / is_not_empty). Fields and operators: title, status, priority, currency, lostReason (equals, not_equals, contains, not_contains, starts_with, in, is_empty, is_not_empty); value (equals, not_equals, gt, gte, lt, lte, is_empty, is_not_empty; a plain number); pipelineId, stageId, assignedTo, contactId, companyId (UUIDs; equals, not_equals, in, is_empty, is_not_empty); createdAt, updatedAt, expectedCloseDate, wonAt, lostAt (within / not_within with a duration like 7d, 24h or 30m; before / after with an ISO calendar date; is_empty, is_not_empty); contactTimezone (the linked contact's time zone; equals, in; each value a group word eastern, central, mountain, pacific, alaska, hawaii, unknown, or an IANA id, the same values as conduyt_list_deals contact_timezone, at most 25 distinct). The API validates every rule and answers 400 with the reason (a custom-field mirror key is 422 mirror_not_filterable).";
|
|
32
|
+
export declare const DEAL_VIEW_AUDIENCE_DOC = "AUDIENCE: an admin or owner creates a SHARED view and must pass members ([{ userId }] for the picked reps, or [] for everyone), else 400 audience_required; any other user creates a PERSONAL view, which has no audience (members on a personal view update is 400 personal_no_audience). Only an admin edits or deletes a shared view; a personal view is its owner's; a system view's name, filters, icon and sort cannot be changed and it cannot be deleted (403).";
|
|
33
|
+
export declare const dealViewFields: {
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
37
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
field: z.ZodString;
|
|
39
|
+
operator: z.ZodString;
|
|
40
|
+
value: z.ZodString;
|
|
41
|
+
}, "strict", z.ZodTypeAny, {
|
|
42
|
+
value: string;
|
|
43
|
+
field: string;
|
|
44
|
+
operator: string;
|
|
45
|
+
}, {
|
|
46
|
+
value: string;
|
|
47
|
+
field: string;
|
|
48
|
+
operator: string;
|
|
49
|
+
}>, "many">>;
|
|
50
|
+
sortField: z.ZodOptional<z.ZodString>;
|
|
51
|
+
sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
52
|
+
members: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
|
+
userId: z.ZodString;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
userId: string;
|
|
56
|
+
}, {
|
|
57
|
+
userId: string;
|
|
58
|
+
}>, "many">>;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** (dealsviews) the deal export filters and the saved deal view tools' shared pieces: GET /deals/export, GET|POST /deals/views, GET|PATCH|DELETE /deals/views/{id}. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** the caps the API applies (conduyt-app lib/deal-filter-params.ts MAX_OWNER_FILTERS / MAX_TAG_FILTERS) */
|
|
4
|
+
export const MAX_OWNER_FILTERS = 25;
|
|
5
|
+
export const MAX_TAG_FILTERS = 25;
|
|
6
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
7
|
+
/** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
|
|
8
|
+
export const dealExportFilterShape = {
|
|
9
|
+
assigned_to: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals owned by these users: a user UUID or `unassigned`, one string or an array (each value is sent as its own repeated assigned_to parameter; a comma list inside a value is read too). ANY of them. At most 25 distinct owners (refused before any request)"),
|
|
10
|
+
tag_ids: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals with one of these tags: tag UUIDs, one string or an array (each value sent as its own repeated tag_ids parameter), ANY match. At most 25 entries (refused before any request)"),
|
|
11
|
+
created_after: z.string().optional().describe("Created on or after this date: YYYY-MM-DD (the account time zone) or a full ISO datetime with offset"),
|
|
12
|
+
created_before: z.string().optional().describe("Created on or before this date (a date-only value is day-inclusive): same forms as created_after"),
|
|
13
|
+
value_min: z.number().optional().describe("Deal value at least this number"),
|
|
14
|
+
value_max: z.number().optional().describe("Deal value at most this number"),
|
|
15
|
+
needsAction: z.boolean().optional().describe("true = only open deals with no next action (the board's needs-next-action filter); false sends nothing"),
|
|
16
|
+
stale: z.boolean().optional().describe("true = only open deals not updated for the board's stale period; false sends nothing"),
|
|
17
|
+
health: z.string().optional().describe("One Pipeline health check: high_value_idle | stale | unassigned | needs_action | missing_close_date | missing_contact (the API validates it: 400 otherwise)"),
|
|
18
|
+
};
|
|
19
|
+
const entries = (v) => (Array.isArray(v) ? v : [v]).flatMap((x) => x.split(",")).map((x) => x.trim()).filter(Boolean);
|
|
20
|
+
/** appends the extra export filters; throws the API's cap wording past a cap (owners count DISTINCT UUIDs, tags count every entry, as the API does) */
|
|
21
|
+
export function appendDealExportFilters(qp, p) {
|
|
22
|
+
for (const [name, v] of [["assigned_to", p.assigned_to], ["tag_ids", p.tag_ids]]) {
|
|
23
|
+
if (v === undefined)
|
|
24
|
+
continue;
|
|
25
|
+
const list = Array.isArray(v) ? v : [v];
|
|
26
|
+
if (name === "assigned_to") {
|
|
27
|
+
const owners = new Set(entries(list).filter((e) => UUID_RE.test(e)));
|
|
28
|
+
if (owners.size > MAX_OWNER_FILTERS)
|
|
29
|
+
throw new Error(`assigned_to accepts at most ${MAX_OWNER_FILTERS} owners; got ${owners.size}.`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const n = entries(list).length;
|
|
33
|
+
if (n > MAX_TAG_FILTERS)
|
|
34
|
+
throw new Error(`tag_ids accepts at most ${MAX_TAG_FILTERS} tags; got ${n}.`);
|
|
35
|
+
}
|
|
36
|
+
for (const x of list)
|
|
37
|
+
qp.append(name, x);
|
|
38
|
+
}
|
|
39
|
+
if (p.created_after)
|
|
40
|
+
qp.set("created_after", p.created_after);
|
|
41
|
+
if (p.created_before)
|
|
42
|
+
qp.set("created_before", p.created_before);
|
|
43
|
+
if (p.value_min !== undefined)
|
|
44
|
+
qp.set("value_min", String(p.value_min));
|
|
45
|
+
if (p.value_max !== undefined)
|
|
46
|
+
qp.set("value_max", String(p.value_max));
|
|
47
|
+
if (p.needsAction === true)
|
|
48
|
+
qp.set("needsAction", "true");
|
|
49
|
+
if (p.stale === true)
|
|
50
|
+
qp.set("stale", "true");
|
|
51
|
+
if (p.health)
|
|
52
|
+
qp.set("health", p.health);
|
|
53
|
+
}
|
|
54
|
+
export const DEAL_VIEW_RULES_DOC = "A view's `filters` is a flat ARRAY of rules { field, operator, value } that are ANDed; value is always a STRING (a comma-separated list for operator in; every rule carries a value: send \"\" for is_empty / is_not_empty). Fields and operators: title, status, priority, currency, lostReason (equals, not_equals, contains, not_contains, starts_with, in, is_empty, is_not_empty); value (equals, not_equals, gt, gte, lt, lte, is_empty, is_not_empty; a plain number); pipelineId, stageId, assignedTo, contactId, companyId (UUIDs; equals, not_equals, in, is_empty, is_not_empty); createdAt, updatedAt, expectedCloseDate, wonAt, lostAt (within / not_within with a duration like 7d, 24h or 30m; before / after with an ISO calendar date; is_empty, is_not_empty); contactTimezone (the linked contact's time zone; equals, in; each value a group word eastern, central, mountain, pacific, alaska, hawaii, unknown, or an IANA id, the same values as conduyt_list_deals contact_timezone, at most 25 distinct). The API validates every rule and answers 400 with the reason (a custom-field mirror key is 422 mirror_not_filterable).";
|
|
55
|
+
export const DEAL_VIEW_AUDIENCE_DOC = "AUDIENCE: an admin or owner creates a SHARED view and must pass members ([{ userId }] for the picked reps, or [] for everyone), else 400 audience_required; any other user creates a PERSONAL view, which has no audience (members on a personal view update is 400 personal_no_audience). Only an admin edits or deletes a shared view; a personal view is its owner's; a system view's name, filters, icon and sort cannot be changed and it cannot be deleted (403).";
|
|
56
|
+
const rule = z.object({
|
|
57
|
+
field: z.string().describe("Rule field, e.g. status, stageId, value, createdAt, contactTimezone (see the tool description for the list)"),
|
|
58
|
+
operator: z.string().describe("Rule operator valid for the field, e.g. equals, in, gt, within"),
|
|
59
|
+
value: z.string().describe("The value, REQUIRED and always a string; a comma-separated list for in; send \"\" for is_empty / is_not_empty (the operators that take no value)"),
|
|
60
|
+
}).strict();
|
|
61
|
+
export const dealViewFields = {
|
|
62
|
+
name: z.string().describe("Display name"),
|
|
63
|
+
description: z.string().optional().describe("Description (an empty string clears it on update)"),
|
|
64
|
+
icon: z.string().optional().describe("Icon id (default briefcase)"),
|
|
65
|
+
filters: z.array(rule).optional().describe("The rules (see the tool description); an update REPLACES all the rules ([] clears them); omitted on create = no rules, every deal"),
|
|
66
|
+
sortField: z.string().optional().describe("Sort field (default createdAt)"),
|
|
67
|
+
sortOrder: z.enum(["asc", "desc"]).optional().describe("Sort direction (default desc)"),
|
|
68
|
+
members: z.array(z.object({ userId: z.string().uuid().describe("User UUID") }).strict()).optional().describe("The audience of a SHARED view: the picked reps, or [] for everyone (see AUDIENCE)"),
|
|
69
|
+
};
|
package/dist/tools/deals.js
CHANGED
|
@@ -7,6 +7,7 @@ import { FORMULA_WRITE_NOTE } from "./formula-fields.js";
|
|
|
7
7
|
import { strictInput } from "./strict.js";
|
|
8
8
|
import { KEEP_PREVIOUS_OWNER_NEEDS_ASSIGNEE } from "./contacts.js";
|
|
9
9
|
import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
|
|
10
|
+
import { DEAL_VIEW_AUDIENCE_DOC, DEAL_VIEW_RULES_DOC, dealViewFields } from "./deal-views.js";
|
|
10
11
|
// (mirror1292, batch31 #1292 Ship 3) deal MIRROR fields: a write-through view of a contact / company field, named on the deal tools
|
|
11
12
|
const MIRROR_READ_DOC = " Mirror fields (#1292): a deal custom field created as a MIRROR of a contact / company field answers that record's value in customFields, with mirrorFields[key] = { mirrored: true, source: { entityType, fieldKey }, unresolved? } beside it (unresolved: no_linked_contact | no_linked_company | source_field_missing, value null); a mirror of a Secure source answers the mask \u2022\u2022\u2022\u2022 like the source (passed through untouched).";
|
|
12
13
|
const MIRROR_WRITE_DOC = " A customFields key that is a deal MIRROR writes the linked contact / company through its own write path (nothing is stored on the deal): 409 mirror_unresolved (no linked record), 409 mirror_relink_conflict (the same request re-links it), 403 mirror_source_not_editable, 422 mirror_source_rejected, 409 mirror_source_changed, 409 mirror_source_conflict (the source's required state changed under the lock), 422 mirror_conflicting_values (two mirror keys of one source field with different values).";
|
|
@@ -72,6 +73,7 @@ export function registerDealTools(server, client) {
|
|
|
72
73
|
status: z.enum(["open", "won", "lost"]).optional().describe("Filter by deal status"),
|
|
73
74
|
search: z.string().optional().describe("Search deal titles"),
|
|
74
75
|
contact_timezone: contactTimezoneSchema,
|
|
76
|
+
view_id: z.string().optional().describe("Apply this SAVED DEAL VIEW (a UUID from conduyt_list_deal_views; sent as view_id, the canonical name in the OpenAPI, which also documents the alias viewId): the list is the set the view defines, ANDed with every other filter given here (the API combines them; nothing is resolved by this tool). 404 when the view does not exist, is disabled or is not visible to you; 422 when its stored rules are invalid or unsupported; 400 for a blank or non-UUID id (forwarded as given). Works with health_summary and board_snapshot too."),
|
|
75
77
|
page: z.number().optional().describe("Page number (default 1)"),
|
|
76
78
|
per_page: z.number().int().min(1).max(BOARD_SNAPSHOT_MAX_COLUMN_ROWS).optional().describe("Results per page, an integer 1-1000 (server default 50, max 1000; with board_snapshot it is the default rows per column)"),
|
|
77
79
|
health_summary: z.boolean().optional().describe("true: answer the Pipeline health shape (totalOpenDeals, atRiskValue, checks[], deals) for the filtered set instead of the deal list."),
|
|
@@ -128,6 +130,8 @@ export function registerDealTools(server, client) {
|
|
|
128
130
|
if (search)
|
|
129
131
|
params.set("search", search);
|
|
130
132
|
appendContactTimezone(params, a.contact_timezone);
|
|
133
|
+
if (a.view_id !== undefined)
|
|
134
|
+
params.set("view_id", a.view_id);
|
|
131
135
|
if (page)
|
|
132
136
|
params.set("page", String(page));
|
|
133
137
|
if (per_page)
|
|
@@ -321,8 +325,33 @@ export function registerDealTools(server, client) {
|
|
|
321
325
|
const result = await client.post(`/api/v1/deals/${dealId}/tags`, { tagIds });
|
|
322
326
|
return formatResult(result);
|
|
323
327
|
});
|
|
324
|
-
server.tool("conduyt_list_deal_views", "List the account's SAVED DEAL VIEWS (saved deal segments, e.g. 'Open deals over $10k'), each with its id, name, stored filter rules, and current deal count. Read-only — shows how the account segments its deals. A rule's filter field `contactTimezone` (#1312 tzfilter, the linked contact's time zone) takes operators equals / in (the value is a string: one value for equals, a comma-separated list for in) and each value is a group word (eastern, central, mountain, pacific, alaska, hawaii), unknown, or an IANA id (the same values as conduyt_list_deals contact_timezone; the API validates it and refuses a malformed value or more than 25 distinct values with a 400); a view with that rule is created or edited
|
|
328
|
+
server.tool("conduyt_list_deal_views", "List the account's SAVED DEAL VIEWS (saved deal segments, e.g. 'Open deals over $10k'), each with its id, name, stored filter rules, and current deal count. Read-only — shows how the account segments its deals. A rule's filter field `contactTimezone` (#1312 tzfilter, the linked contact's time zone) takes operators equals / in (the value is a string: one value for equals, a comma-separated list for in) and each value is a group word (eastern, central, mountain, pacific, alaska, hawaii), unknown, or an IANA id (the same values as conduyt_list_deals contact_timezone; the API validates it and refuses a malformed value or more than 25 distinct values with a 400); a view with that rule is created or edited with conduyt_create_deal_view / conduyt_update_deal_view (POST / PATCH /api/v1/deals/views), read one with conduyt_get_deal_view and removed with conduyt_delete_deal_view.", {}, async () => {
|
|
325
329
|
const result = await client.get("/api/v1/deals/views");
|
|
326
330
|
return formatResult(result);
|
|
327
331
|
});
|
|
332
|
+
strictInput(server.tool("conduyt_get_deal_view", "Get one SAVED DEAL VIEW by id (GET /api/v1/deals/views/{id}): name, description, icon, stored filter rules, sort, isSystem, isEnabled, isPersonal, createdBy and its audience members. Read-only. 404 when it does not exist or you cannot see it. " + DEAL_VIEW_RULES_DOC, { id: z.string().uuid().describe("Deal view UUID") }, async ({ id }) => {
|
|
333
|
+
const result = await client.get(`/api/v1/deals/views/${encodeURIComponent(id)}`);
|
|
334
|
+
return formatResult(result);
|
|
335
|
+
}));
|
|
336
|
+
strictInput(server.tool("conduyt_create_deal_view", "Create a SAVED DEAL VIEW (POST /api/v1/deals/views, the board's saved view tabs; needs deals.edit and active billing). Answers the created view (201). " + DEAL_VIEW_RULES_DOC + " " + DEAL_VIEW_AUDIENCE_DOC, dealViewFields, async (params) => {
|
|
337
|
+
if (params.name.trim() === "")
|
|
338
|
+
throw new Error("name is required.");
|
|
339
|
+
const result = await client.post("/api/v1/deals/views", params);
|
|
340
|
+
return formatResult(result);
|
|
341
|
+
}));
|
|
342
|
+
strictInput(server.tool("conduyt_update_deal_view", "Update a SAVED DEAL VIEW (PATCH /api/v1/deals/views/{id}; needs deals.edit): only the fields you pass change; filters REPLACES all the rules; isEnabled shows or hides the view (switching a shared view on needs an audience: 409 when it has none, so pass members). Answers the updated view. 404 when the view does not exist. " + DEAL_VIEW_RULES_DOC + " " + DEAL_VIEW_AUDIENCE_DOC, {
|
|
343
|
+
id: z.string().uuid().describe("Deal view UUID"),
|
|
344
|
+
...dealViewFields,
|
|
345
|
+
name: z.string().optional().describe("New display name (not blank)"),
|
|
346
|
+
isEnabled: z.boolean().optional().describe("true = show the view, false = hide it"),
|
|
347
|
+
}, async ({ id, ...updates }) => {
|
|
348
|
+
if (Object.keys(updates).length === 0)
|
|
349
|
+
throw new Error("Nothing to update: pass at least one field.");
|
|
350
|
+
const result = await client.patch(`/api/v1/deals/views/${encodeURIComponent(id)}`, updates);
|
|
351
|
+
return formatResult(result);
|
|
352
|
+
}));
|
|
353
|
+
strictInput(server.tool("conduyt_delete_deal_view", "Delete a SAVED DEAL VIEW (DELETE /api/v1/deals/views/{id}; needs deals.edit). Answers { success: true }. The deals themselves are untouched. A personal view only by its owner, a shared one by admins only; a system view cannot be deleted (403). 404 when the view does not exist. Not undoable.", { id: z.string().uuid().describe("Deal view UUID to delete") }, async ({ id }) => {
|
|
354
|
+
const result = await client.del(`/api/v1/deals/views/${encodeURIComponent(id)}`);
|
|
355
|
+
return formatResult(result);
|
|
356
|
+
}));
|
|
328
357
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedAt": "2026-11-14T23:17:44.183Z",
|
|
3
|
-
"toolCount":
|
|
3
|
+
"toolCount": 441,
|
|
4
4
|
"totalEndpoints": 1214,
|
|
5
5
|
"counts": {
|
|
6
|
-
"covered":
|
|
6
|
+
"covered": 390,
|
|
7
7
|
"excluded": 374,
|
|
8
|
-
"planned":
|
|
8
|
+
"planned": 450,
|
|
9
9
|
"uncategorized": 0
|
|
10
10
|
},
|
|
11
11
|
"matrix": {
|
|
@@ -2791,20 +2791,28 @@
|
|
|
2791
2791
|
]
|
|
2792
2792
|
},
|
|
2793
2793
|
"POST /api/v1/deals/views": {
|
|
2794
|
-
"status": "
|
|
2795
|
-
"
|
|
2794
|
+
"status": "covered",
|
|
2795
|
+
"tools": [
|
|
2796
|
+
"conduyt_create_deal_view"
|
|
2797
|
+
]
|
|
2796
2798
|
},
|
|
2797
2799
|
"GET /api/v1/deals/views/:id": {
|
|
2798
|
-
"status": "
|
|
2799
|
-
"
|
|
2800
|
+
"status": "covered",
|
|
2801
|
+
"tools": [
|
|
2802
|
+
"conduyt_get_deal_view"
|
|
2803
|
+
]
|
|
2800
2804
|
},
|
|
2801
2805
|
"PATCH /api/v1/deals/views/:id": {
|
|
2802
|
-
"status": "
|
|
2803
|
-
"
|
|
2806
|
+
"status": "covered",
|
|
2807
|
+
"tools": [
|
|
2808
|
+
"conduyt_update_deal_view"
|
|
2809
|
+
]
|
|
2804
2810
|
},
|
|
2805
2811
|
"DELETE /api/v1/deals/views/:id": {
|
|
2806
|
-
"status": "
|
|
2807
|
-
"
|
|
2812
|
+
"status": "covered",
|
|
2813
|
+
"tools": [
|
|
2814
|
+
"conduyt_delete_deal_view"
|
|
2815
|
+
]
|
|
2808
2816
|
},
|
|
2809
2817
|
"GET /api/v1/dialer/agent-statuses": {
|
|
2810
2818
|
"status": "covered",
|