@elitedcs/ghl-mcp 3.1.0 → 3.2.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/CHANGELOG.md +81 -0
- package/README.md +28 -11
- package/dist/index.js +990 -958
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -31,8 +31,8 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "@elitedcs/ghl-mcp",
|
|
34
|
-
version: "3.
|
|
35
|
-
description: "GoHighLevel MCP Server for Claude.
|
|
34
|
+
version: "3.2.0",
|
|
35
|
+
description: "GoHighLevel MCP Server for Claude. 173 tools \u2014 full CRM, automation, marketing control, and the only programmatic GHL workflow builder.",
|
|
36
36
|
main: "dist/index.js",
|
|
37
37
|
bin: {
|
|
38
38
|
"ghl-mcp": "dist/index.js"
|
|
@@ -96,7 +96,6 @@ var require_package = __commonJS({
|
|
|
96
96
|
var dotenv2 = __toESM(require("dotenv"));
|
|
97
97
|
var path5 = __toESM(require("path"));
|
|
98
98
|
var fs5 = __toESM(require("fs"));
|
|
99
|
-
var import_child_process = require("child_process");
|
|
100
99
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
101
100
|
var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
102
101
|
|
|
@@ -383,16 +382,10 @@ var TokenRegistry = class {
|
|
|
383
382
|
var fs2 = __toESM(require("fs"));
|
|
384
383
|
var path2 = __toESM(require("path"));
|
|
385
384
|
var dotenv = __toESM(require("dotenv"));
|
|
385
|
+
var import_zod3 = require("zod");
|
|
386
|
+
|
|
387
|
+
// src/trigger-schemas.ts
|
|
386
388
|
var import_zod2 = require("zod");
|
|
387
|
-
var BACKEND_BASE = "https://backend.leadconnectorhq.com/workflow";
|
|
388
|
-
var FIREBASE_TOKEN_URL = "https://securetoken.googleapis.com/v1/token";
|
|
389
|
-
var MAX_RETRIES2 = 3;
|
|
390
|
-
var BASE_DELAY_MS2 = 500;
|
|
391
|
-
var FirebaseTokenSchema = import_zod2.z.object({
|
|
392
|
-
id_token: import_zod2.z.string(),
|
|
393
|
-
refresh_token: import_zod2.z.string(),
|
|
394
|
-
expires_in: import_zod2.z.string()
|
|
395
|
-
});
|
|
396
389
|
var TriggerActionSchema = import_zod2.z.object({
|
|
397
390
|
workflow_id: import_zod2.z.string(),
|
|
398
391
|
type: import_zod2.z.literal("add_to_workflow")
|
|
@@ -412,90 +405,158 @@ var TriggerCommonSchema = import_zod2.z.object({
|
|
|
412
405
|
schedule_config: import_zod2.z.record(import_zod2.z.unknown()).optional(),
|
|
413
406
|
date_updated: import_zod2.z.string().optional()
|
|
414
407
|
}).passthrough();
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
id: import_zod2.z.string().optional()
|
|
430
|
-
}).passthrough();
|
|
431
|
-
var AppointmentTriggerConditionSchema = import_zod2.z.object({
|
|
432
|
-
operator: import_zod2.z.string(),
|
|
433
|
-
field: import_zod2.z.string(),
|
|
434
|
-
value: import_zod2.z.unknown().optional(),
|
|
435
|
-
title: import_zod2.z.string().optional(),
|
|
436
|
-
type: import_zod2.z.string().optional(),
|
|
437
|
-
id: import_zod2.z.string().optional()
|
|
438
|
-
}).passthrough();
|
|
439
|
-
var PipelineStageUpdatedTriggerConditionSchema = import_zod2.z.object({
|
|
440
|
-
operator: import_zod2.z.string(),
|
|
441
|
-
field: import_zod2.z.string(),
|
|
442
|
-
value: import_zod2.z.unknown().optional(),
|
|
443
|
-
title: import_zod2.z.string().optional(),
|
|
444
|
-
type: import_zod2.z.string().optional(),
|
|
445
|
-
id: import_zod2.z.string().optional()
|
|
446
|
-
}).passthrough();
|
|
408
|
+
function typedTrigger(typeLiteral, knownFields) {
|
|
409
|
+
const fieldDesc = knownFields.length === 0 ? "No filter fields \u2014 trigger matches any event of this type." : `Known field paths: ${knownFields.join(", ")}.`;
|
|
410
|
+
return TriggerCommonSchema.extend({
|
|
411
|
+
type: import_zod2.z.literal(typeLiteral),
|
|
412
|
+
conditions: import_zod2.z.array(import_zod2.z.object({
|
|
413
|
+
operator: import_zod2.z.string().describe("Comparison operator (equals, greater_than, less_than, contains, index-of-true, etc.)."),
|
|
414
|
+
field: import_zod2.z.string().describe(fieldDesc),
|
|
415
|
+
value: import_zod2.z.unknown().optional(),
|
|
416
|
+
title: import_zod2.z.string().optional(),
|
|
417
|
+
type: import_zod2.z.string().optional(),
|
|
418
|
+
id: import_zod2.z.string().optional()
|
|
419
|
+
}).passthrough()).optional()
|
|
420
|
+
});
|
|
421
|
+
}
|
|
447
422
|
var ContactTagTriggerSchema = TriggerCommonSchema.extend({
|
|
448
423
|
type: import_zod2.z.literal("contact_tag"),
|
|
449
|
-
conditions: import_zod2.z.array(
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
conditions: import_zod2.z.array(AppointmentTriggerConditionSchema).optional()
|
|
458
|
-
});
|
|
459
|
-
var PipelineStageUpdatedTriggerSchema = TriggerCommonSchema.extend({
|
|
460
|
-
type: import_zod2.z.literal("pipeline_stage_updated"),
|
|
461
|
-
conditions: import_zod2.z.array(PipelineStageUpdatedTriggerConditionSchema).optional()
|
|
424
|
+
conditions: import_zod2.z.array(import_zod2.z.object({
|
|
425
|
+
operator: import_zod2.z.string(),
|
|
426
|
+
field: import_zod2.z.enum(["tagsAdded", "tagsRemoved"]),
|
|
427
|
+
value: import_zod2.z.string(),
|
|
428
|
+
title: import_zod2.z.string().optional(),
|
|
429
|
+
type: import_zod2.z.string().optional(),
|
|
430
|
+
id: import_zod2.z.string().optional()
|
|
431
|
+
}).passthrough())
|
|
462
432
|
});
|
|
433
|
+
var CustomerReplyTriggerSchema = typedTrigger("customer_reply", [
|
|
434
|
+
// No fields in the catalogue — Customer Reply matches any inbound message.
|
|
435
|
+
]);
|
|
436
|
+
var AppointmentTriggerSchema = typedTrigger("appointment", [
|
|
437
|
+
"calendar.id",
|
|
438
|
+
"appointment.status",
|
|
439
|
+
// new | confirmed | cancelled | showed | noshow | invalid
|
|
440
|
+
"contact.tags",
|
|
441
|
+
"appointment.eventType",
|
|
442
|
+
"appointment.modifiedBy"
|
|
443
|
+
]);
|
|
444
|
+
var PipelineStageUpdatedTriggerSchema = typedTrigger("pipeline_stage_updated", [
|
|
445
|
+
"opportunity.pipelineId",
|
|
446
|
+
"opportunity.pipelineStageId",
|
|
447
|
+
"contact.tags"
|
|
448
|
+
]);
|
|
449
|
+
var FormSubmissionTriggerSchema = typedTrigger("form_submission", [
|
|
450
|
+
"form.id",
|
|
451
|
+
"formData.termsAndConditions"
|
|
452
|
+
]);
|
|
453
|
+
var OpportunityCreatedTriggerSchema = typedTrigger("opportunity_created", [
|
|
454
|
+
"opportunity.pipelineId",
|
|
455
|
+
"contact.tags",
|
|
456
|
+
"opportunity.assignedTo",
|
|
457
|
+
"opportunity.monetaryValue",
|
|
458
|
+
"opportunity.forecastExpectedCloseDate",
|
|
459
|
+
"opportunity.forecastProbability",
|
|
460
|
+
"opportunity.status",
|
|
461
|
+
"opportunity.lostReasonId"
|
|
462
|
+
]);
|
|
463
|
+
var OpportunityChangedTriggerSchema = typedTrigger("opportunity_changed", [
|
|
464
|
+
"opportunity.pipelineId",
|
|
465
|
+
"contact.tags",
|
|
466
|
+
"opportunity.assignedTo",
|
|
467
|
+
"opportunity.monetaryValue",
|
|
468
|
+
"opportunity.forecastExpectedCloseDate",
|
|
469
|
+
"opportunity.forecastProbability",
|
|
470
|
+
"opportunity.status",
|
|
471
|
+
"opportunity.lostReasonId"
|
|
472
|
+
]);
|
|
473
|
+
var OpportunityStatusChangedTriggerSchema = typedTrigger("opportunity_status_changed", [
|
|
474
|
+
"opportunity.oldStatus",
|
|
475
|
+
"opportunity.status",
|
|
476
|
+
"opportunity.pipelineId",
|
|
477
|
+
"contact.tags",
|
|
478
|
+
"opportunity.assignedTo",
|
|
479
|
+
"opportunity.monetaryValue",
|
|
480
|
+
"opportunity.forecastExpectedCloseDate",
|
|
481
|
+
"opportunity.forecastProbability",
|
|
482
|
+
"opportunity.lostReasonId"
|
|
483
|
+
]);
|
|
484
|
+
var PaymentReceivedTriggerSchema = typedTrigger("payment_received", [
|
|
485
|
+
// No filter fields — fires on any payment received.
|
|
486
|
+
]);
|
|
487
|
+
var InboundWebhookTriggerSchema = typedTrigger("inbound_webhook", [
|
|
488
|
+
// No filter fields — fires on any inbound webhook hit.
|
|
489
|
+
]);
|
|
490
|
+
var MailgunEmailEventTriggerSchema = typedTrigger("mailgun_email_event", [
|
|
491
|
+
"workflow.id",
|
|
492
|
+
"mailgun.event"
|
|
493
|
+
// opened | clicked | bounced | delivered | etc.
|
|
494
|
+
]);
|
|
495
|
+
var NoteAddTriggerSchema = typedTrigger("note_add", [
|
|
496
|
+
"contact.tags"
|
|
497
|
+
]);
|
|
498
|
+
var TaskAddedTriggerSchema = typedTrigger("task_added", [
|
|
499
|
+
"task.assignedTo"
|
|
500
|
+
]);
|
|
463
501
|
var UnknownTriggerSchema = TriggerCommonSchema.extend({
|
|
464
502
|
type: import_zod2.z.string(),
|
|
465
503
|
conditions: import_zod2.z.array(import_zod2.z.record(import_zod2.z.unknown())).optional()
|
|
466
504
|
});
|
|
467
505
|
var WorkflowTriggerSchema = import_zod2.z.union([
|
|
506
|
+
// Originally typed (v3.0.x)
|
|
507
|
+
ContactTagTriggerSchema,
|
|
468
508
|
CustomerReplyTriggerSchema,
|
|
469
509
|
AppointmentTriggerSchema,
|
|
470
|
-
ContactTagTriggerSchema,
|
|
471
510
|
PipelineStageUpdatedTriggerSchema,
|
|
511
|
+
// Added in v3.2.0
|
|
512
|
+
FormSubmissionTriggerSchema,
|
|
513
|
+
OpportunityCreatedTriggerSchema,
|
|
514
|
+
OpportunityChangedTriggerSchema,
|
|
515
|
+
OpportunityStatusChangedTriggerSchema,
|
|
516
|
+
PaymentReceivedTriggerSchema,
|
|
517
|
+
InboundWebhookTriggerSchema,
|
|
518
|
+
MailgunEmailEventTriggerSchema,
|
|
519
|
+
NoteAddTriggerSchema,
|
|
520
|
+
TaskAddedTriggerSchema,
|
|
521
|
+
// Fallback for the remaining 44 native trigger types + any future ones
|
|
472
522
|
UnknownTriggerSchema
|
|
473
523
|
]);
|
|
474
|
-
|
|
524
|
+
|
|
525
|
+
// src/workflow-builder-client.ts
|
|
526
|
+
var BACKEND_BASE = "https://backend.leadconnectorhq.com/workflow";
|
|
527
|
+
var FIREBASE_TOKEN_URL = "https://securetoken.googleapis.com/v1/token";
|
|
528
|
+
var MAX_RETRIES2 = 3;
|
|
529
|
+
var BASE_DELAY_MS2 = 500;
|
|
530
|
+
var FirebaseTokenSchema = import_zod3.z.object({
|
|
531
|
+
id_token: import_zod3.z.string(),
|
|
532
|
+
refresh_token: import_zod3.z.string(),
|
|
533
|
+
expires_in: import_zod3.z.string()
|
|
534
|
+
});
|
|
535
|
+
var WorkflowActionSchema = import_zod3.z.custom(
|
|
475
536
|
(value) => typeof value === "object" && value !== null && "type" in value
|
|
476
537
|
);
|
|
477
|
-
var WorkflowFullSchema =
|
|
478
|
-
_id:
|
|
479
|
-
name:
|
|
480
|
-
status:
|
|
481
|
-
version:
|
|
482
|
-
dataVersion:
|
|
483
|
-
timezone:
|
|
484
|
-
workflowData:
|
|
485
|
-
triggers:
|
|
486
|
-
createdAt:
|
|
487
|
-
updatedAt:
|
|
488
|
-
locationId:
|
|
489
|
-
stopOnResponse:
|
|
490
|
-
allowMultiple:
|
|
491
|
-
allowMultipleOpportunity:
|
|
492
|
-
autoMarkAsRead:
|
|
493
|
-
removeContactFromLastStep:
|
|
538
|
+
var WorkflowFullSchema = import_zod3.z.object({
|
|
539
|
+
_id: import_zod3.z.string(),
|
|
540
|
+
name: import_zod3.z.string(),
|
|
541
|
+
status: import_zod3.z.string(),
|
|
542
|
+
version: import_zod3.z.number(),
|
|
543
|
+
dataVersion: import_zod3.z.number().optional(),
|
|
544
|
+
timezone: import_zod3.z.string().optional(),
|
|
545
|
+
workflowData: import_zod3.z.object({ templates: import_zod3.z.array(WorkflowActionSchema).optional() }).optional(),
|
|
546
|
+
triggers: import_zod3.z.array(WorkflowTriggerSchema).optional(),
|
|
547
|
+
createdAt: import_zod3.z.string().optional(),
|
|
548
|
+
updatedAt: import_zod3.z.string().optional(),
|
|
549
|
+
locationId: import_zod3.z.string().optional(),
|
|
550
|
+
stopOnResponse: import_zod3.z.boolean().optional(),
|
|
551
|
+
allowMultiple: import_zod3.z.boolean().optional(),
|
|
552
|
+
allowMultipleOpportunity: import_zod3.z.boolean().optional(),
|
|
553
|
+
autoMarkAsRead: import_zod3.z.boolean().optional(),
|
|
554
|
+
removeContactFromLastStep: import_zod3.z.boolean().optional()
|
|
494
555
|
}).passthrough();
|
|
495
|
-
var CreateWorkflowResponseSchema =
|
|
556
|
+
var CreateWorkflowResponseSchema = import_zod3.z.union([
|
|
496
557
|
WorkflowFullSchema,
|
|
497
|
-
|
|
498
|
-
|
|
558
|
+
import_zod3.z.object({ _id: import_zod3.z.string() }).passthrough(),
|
|
559
|
+
import_zod3.z.object({ id: import_zod3.z.string() }).passthrough()
|
|
499
560
|
]).transform((data) => {
|
|
500
561
|
const id = "_id" in data && typeof data._id === "string" ? data._id : data.id;
|
|
501
562
|
return WorkflowFullSchema.parse({
|
|
@@ -976,7 +1037,7 @@ ${errorBody}`
|
|
|
976
1037
|
};
|
|
977
1038
|
|
|
978
1039
|
// src/tools/contacts.ts
|
|
979
|
-
var
|
|
1040
|
+
var import_zod5 = require("zod");
|
|
980
1041
|
|
|
981
1042
|
// src/tool-helpers.ts
|
|
982
1043
|
function errorResponse(error) {
|
|
@@ -1013,55 +1074,55 @@ function safeTool(server2, name, description, schema, handler) {
|
|
|
1013
1074
|
}
|
|
1014
1075
|
|
|
1015
1076
|
// src/api-schemas.ts
|
|
1016
|
-
var
|
|
1017
|
-
var ContactSchema =
|
|
1018
|
-
id:
|
|
1019
|
-
locationId:
|
|
1020
|
-
firstName:
|
|
1021
|
-
lastName:
|
|
1022
|
-
name:
|
|
1023
|
-
email:
|
|
1024
|
-
phone:
|
|
1025
|
-
tags:
|
|
1026
|
-
source:
|
|
1027
|
-
dateAdded:
|
|
1077
|
+
var import_zod4 = require("zod");
|
|
1078
|
+
var ContactSchema = import_zod4.z.object({
|
|
1079
|
+
id: import_zod4.z.string(),
|
|
1080
|
+
locationId: import_zod4.z.string().nullable().optional(),
|
|
1081
|
+
firstName: import_zod4.z.string().nullable().optional(),
|
|
1082
|
+
lastName: import_zod4.z.string().nullable().optional(),
|
|
1083
|
+
name: import_zod4.z.string().nullable().optional(),
|
|
1084
|
+
email: import_zod4.z.string().nullable().optional(),
|
|
1085
|
+
phone: import_zod4.z.string().nullable().optional(),
|
|
1086
|
+
tags: import_zod4.z.array(import_zod4.z.string()).nullable().optional(),
|
|
1087
|
+
source: import_zod4.z.string().nullable().optional(),
|
|
1088
|
+
dateAdded: import_zod4.z.string().nullable().optional()
|
|
1028
1089
|
}).passthrough();
|
|
1029
|
-
var ContactSearchResponseSchema =
|
|
1030
|
-
contacts:
|
|
1031
|
-
meta:
|
|
1032
|
-
total:
|
|
1033
|
-
count:
|
|
1034
|
-
currentPage:
|
|
1035
|
-
nextPage:
|
|
1036
|
-
prevPage:
|
|
1037
|
-
startAfterId:
|
|
1038
|
-
startAfter:
|
|
1090
|
+
var ContactSearchResponseSchema = import_zod4.z.object({
|
|
1091
|
+
contacts: import_zod4.z.array(ContactSchema),
|
|
1092
|
+
meta: import_zod4.z.object({
|
|
1093
|
+
total: import_zod4.z.number().nullable().optional(),
|
|
1094
|
+
count: import_zod4.z.number().nullable().optional(),
|
|
1095
|
+
currentPage: import_zod4.z.number().nullable().optional(),
|
|
1096
|
+
nextPage: import_zod4.z.union([import_zod4.z.number(), import_zod4.z.string()]).nullable().optional(),
|
|
1097
|
+
prevPage: import_zod4.z.union([import_zod4.z.number(), import_zod4.z.string()]).nullable().optional(),
|
|
1098
|
+
startAfterId: import_zod4.z.string().nullable().optional(),
|
|
1099
|
+
startAfter: import_zod4.z.number().nullable().optional()
|
|
1039
1100
|
}).passthrough().optional()
|
|
1040
1101
|
}).passthrough();
|
|
1041
|
-
var ContactResponseSchema =
|
|
1102
|
+
var ContactResponseSchema = import_zod4.z.object({
|
|
1042
1103
|
contact: ContactSchema
|
|
1043
1104
|
}).passthrough();
|
|
1044
|
-
var PipelineStageSchema =
|
|
1045
|
-
id:
|
|
1046
|
-
name:
|
|
1047
|
-
position:
|
|
1105
|
+
var PipelineStageSchema = import_zod4.z.object({
|
|
1106
|
+
id: import_zod4.z.string(),
|
|
1107
|
+
name: import_zod4.z.string(),
|
|
1108
|
+
position: import_zod4.z.number().optional()
|
|
1048
1109
|
}).passthrough();
|
|
1049
|
-
var PipelineSchema =
|
|
1050
|
-
id:
|
|
1051
|
-
name:
|
|
1052
|
-
stages:
|
|
1053
|
-
locationId:
|
|
1110
|
+
var PipelineSchema = import_zod4.z.object({
|
|
1111
|
+
id: import_zod4.z.string(),
|
|
1112
|
+
name: import_zod4.z.string(),
|
|
1113
|
+
stages: import_zod4.z.array(PipelineStageSchema),
|
|
1114
|
+
locationId: import_zod4.z.string().optional()
|
|
1054
1115
|
}).passthrough();
|
|
1055
|
-
var PipelinesResponseSchema =
|
|
1056
|
-
pipelines:
|
|
1116
|
+
var PipelinesResponseSchema = import_zod4.z.object({
|
|
1117
|
+
pipelines: import_zod4.z.array(PipelineSchema)
|
|
1057
1118
|
}).passthrough();
|
|
1058
|
-
var CalendarSchema =
|
|
1059
|
-
id:
|
|
1060
|
-
name:
|
|
1061
|
-
locationId:
|
|
1119
|
+
var CalendarSchema = import_zod4.z.object({
|
|
1120
|
+
id: import_zod4.z.string(),
|
|
1121
|
+
name: import_zod4.z.string(),
|
|
1122
|
+
locationId: import_zod4.z.string().optional()
|
|
1062
1123
|
}).passthrough();
|
|
1063
|
-
var CalendarsResponseSchema =
|
|
1064
|
-
calendars:
|
|
1124
|
+
var CalendarsResponseSchema = import_zod4.z.object({
|
|
1125
|
+
calendars: import_zod4.z.array(CalendarSchema)
|
|
1065
1126
|
}).passthrough();
|
|
1066
1127
|
|
|
1067
1128
|
// src/tools/contacts.ts
|
|
@@ -1071,12 +1132,12 @@ function registerContactTools(server2, client) {
|
|
|
1071
1132
|
"search_contacts",
|
|
1072
1133
|
"Search and list contacts in a GHL location. Supports filtering by query string, pagination, and sorting.",
|
|
1073
1134
|
{
|
|
1074
|
-
locationId:
|
|
1075
|
-
query:
|
|
1076
|
-
limit:
|
|
1077
|
-
startAfterId:
|
|
1078
|
-
sortBy:
|
|
1079
|
-
sortOrder:
|
|
1135
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1136
|
+
query: import_zod5.z.string().optional().describe("Search query to filter contacts (searches name, email, phone, etc.)."),
|
|
1137
|
+
limit: import_zod5.z.number().optional().describe("Maximum number of contacts to return. Defaults to 20."),
|
|
1138
|
+
startAfterId: import_zod5.z.string().optional().describe("Contact ID to start after, for cursor-based pagination."),
|
|
1139
|
+
sortBy: import_zod5.z.string().optional().describe("Field to sort results by (e.g. 'dateAdded', 'name')."),
|
|
1140
|
+
sortOrder: import_zod5.z.string().optional().describe("Sort direction: 'asc' or 'desc'.")
|
|
1080
1141
|
},
|
|
1081
1142
|
async ({ locationId: locationId2, query, limit, startAfterId, sortBy, sortOrder }) => {
|
|
1082
1143
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1098,7 +1159,7 @@ function registerContactTools(server2, client) {
|
|
|
1098
1159
|
"get_contact",
|
|
1099
1160
|
"Retrieve a single contact by their ID, including all profile fields, tags, and custom fields.",
|
|
1100
1161
|
{
|
|
1101
|
-
contactId:
|
|
1162
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to retrieve.")
|
|
1102
1163
|
},
|
|
1103
1164
|
async ({ contactId }) => {
|
|
1104
1165
|
const raw = await client.get(`/contacts/${contactId}`);
|
|
@@ -1110,25 +1171,25 @@ function registerContactTools(server2, client) {
|
|
|
1110
1171
|
"create_contact",
|
|
1111
1172
|
"Create a new contact in a GHL location. At minimum, provide a locationId and at least one identifying field (name, email, or phone).",
|
|
1112
1173
|
{
|
|
1113
|
-
locationId:
|
|
1114
|
-
firstName:
|
|
1115
|
-
lastName:
|
|
1116
|
-
name:
|
|
1117
|
-
email:
|
|
1118
|
-
phone:
|
|
1119
|
-
tags:
|
|
1120
|
-
source:
|
|
1121
|
-
companyName:
|
|
1122
|
-
address1:
|
|
1123
|
-
city:
|
|
1124
|
-
state:
|
|
1125
|
-
postalCode:
|
|
1126
|
-
website:
|
|
1127
|
-
timezone:
|
|
1128
|
-
customFields:
|
|
1129
|
-
|
|
1130
|
-
id:
|
|
1131
|
-
value:
|
|
1174
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1175
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1176
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1177
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1178
|
+
email: import_zod5.z.string().optional().describe("Contact's email address."),
|
|
1179
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number."),
|
|
1180
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to assign to the contact."),
|
|
1181
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1182
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1183
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1184
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1185
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1186
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1187
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1188
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1189
|
+
customFields: import_zod5.z.array(
|
|
1190
|
+
import_zod5.z.object({
|
|
1191
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1192
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1132
1193
|
})
|
|
1133
1194
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1134
1195
|
},
|
|
@@ -1149,25 +1210,25 @@ function registerContactTools(server2, client) {
|
|
|
1149
1210
|
"update_contact",
|
|
1150
1211
|
"Update an existing contact's fields. Only provided fields will be changed; omitted fields remain unchanged.",
|
|
1151
1212
|
{
|
|
1152
|
-
contactId:
|
|
1153
|
-
firstName:
|
|
1154
|
-
lastName:
|
|
1155
|
-
name:
|
|
1156
|
-
email:
|
|
1157
|
-
phone:
|
|
1158
|
-
tags:
|
|
1159
|
-
source:
|
|
1160
|
-
companyName:
|
|
1161
|
-
address1:
|
|
1162
|
-
city:
|
|
1163
|
-
state:
|
|
1164
|
-
postalCode:
|
|
1165
|
-
website:
|
|
1166
|
-
timezone:
|
|
1167
|
-
customFields:
|
|
1168
|
-
|
|
1169
|
-
id:
|
|
1170
|
-
value:
|
|
1213
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to update."),
|
|
1214
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1215
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1216
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1217
|
+
email: import_zod5.z.string().optional().describe("Contact's email address."),
|
|
1218
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number."),
|
|
1219
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to set on the contact (replaces existing tags)."),
|
|
1220
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1221
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1222
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1223
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1224
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1225
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1226
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1227
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1228
|
+
customFields: import_zod5.z.array(
|
|
1229
|
+
import_zod5.z.object({
|
|
1230
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1231
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1171
1232
|
})
|
|
1172
1233
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1173
1234
|
},
|
|
@@ -1186,8 +1247,8 @@ function registerContactTools(server2, client) {
|
|
|
1186
1247
|
"delete_contact",
|
|
1187
1248
|
"Permanently delete a contact. IRREVERSIBLE.",
|
|
1188
1249
|
{
|
|
1189
|
-
contactId:
|
|
1190
|
-
confirm:
|
|
1250
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to delete."),
|
|
1251
|
+
confirm: import_zod5.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1191
1252
|
},
|
|
1192
1253
|
async ({ contactId }) => {
|
|
1193
1254
|
return client.delete(`/contacts/${contactId}`);
|
|
@@ -1198,25 +1259,25 @@ function registerContactTools(server2, client) {
|
|
|
1198
1259
|
"upsert_contact",
|
|
1199
1260
|
"Create or update a contact. Matches on email or phone; creates a new contact if no match is found, otherwise updates the existing one.",
|
|
1200
1261
|
{
|
|
1201
|
-
locationId:
|
|
1202
|
-
firstName:
|
|
1203
|
-
lastName:
|
|
1204
|
-
name:
|
|
1205
|
-
email:
|
|
1206
|
-
phone:
|
|
1207
|
-
tags:
|
|
1208
|
-
source:
|
|
1209
|
-
companyName:
|
|
1210
|
-
address1:
|
|
1211
|
-
city:
|
|
1212
|
-
state:
|
|
1213
|
-
postalCode:
|
|
1214
|
-
website:
|
|
1215
|
-
timezone:
|
|
1216
|
-
customFields:
|
|
1217
|
-
|
|
1218
|
-
id:
|
|
1219
|
-
value:
|
|
1262
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1263
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1264
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1265
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1266
|
+
email: import_zod5.z.string().optional().describe("Contact's email address (used for matching)."),
|
|
1267
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number (used for matching)."),
|
|
1268
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to assign to the contact."),
|
|
1269
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1270
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1271
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1272
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1273
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1274
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1275
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1276
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1277
|
+
customFields: import_zod5.z.array(
|
|
1278
|
+
import_zod5.z.object({
|
|
1279
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1280
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1220
1281
|
})
|
|
1221
1282
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1222
1283
|
},
|
|
@@ -1237,8 +1298,8 @@ function registerContactTools(server2, client) {
|
|
|
1237
1298
|
"add_contact_tags",
|
|
1238
1299
|
"Add one or more tags to an existing contact. Does not remove existing tags.",
|
|
1239
1300
|
{
|
|
1240
|
-
contactId:
|
|
1241
|
-
tags:
|
|
1301
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add tags to."),
|
|
1302
|
+
tags: import_zod5.z.array(import_zod5.z.string()).describe("Array of tag names to add to the contact.")
|
|
1242
1303
|
},
|
|
1243
1304
|
async ({ contactId, tags }) => {
|
|
1244
1305
|
return client.post(`/contacts/${contactId}/tags`, {
|
|
@@ -1251,8 +1312,8 @@ function registerContactTools(server2, client) {
|
|
|
1251
1312
|
"remove_contact_tags",
|
|
1252
1313
|
"Remove one or more tags from an existing contact.",
|
|
1253
1314
|
{
|
|
1254
|
-
contactId:
|
|
1255
|
-
tags:
|
|
1315
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to remove tags from."),
|
|
1316
|
+
tags: import_zod5.z.array(import_zod5.z.string()).describe("Array of tag names to remove from the contact.")
|
|
1256
1317
|
},
|
|
1257
1318
|
async ({ contactId, tags }) => {
|
|
1258
1319
|
return client.delete(`/contacts/${contactId}/tags`, {
|
|
@@ -1265,7 +1326,7 @@ function registerContactTools(server2, client) {
|
|
|
1265
1326
|
"get_contact_tasks",
|
|
1266
1327
|
"Retrieve all tasks associated with a specific contact.",
|
|
1267
1328
|
{
|
|
1268
|
-
contactId:
|
|
1329
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose tasks to retrieve.")
|
|
1269
1330
|
},
|
|
1270
1331
|
async ({ contactId }) => {
|
|
1271
1332
|
return client.get(`/contacts/${contactId}/tasks`);
|
|
@@ -1276,12 +1337,12 @@ function registerContactTools(server2, client) {
|
|
|
1276
1337
|
"create_contact_task",
|
|
1277
1338
|
"Create a new task associated with a contact (e.g. follow-up call, send proposal).",
|
|
1278
1339
|
{
|
|
1279
|
-
contactId:
|
|
1280
|
-
title:
|
|
1281
|
-
body:
|
|
1282
|
-
dueDate:
|
|
1283
|
-
completed:
|
|
1284
|
-
assignedTo:
|
|
1340
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to create the task for."),
|
|
1341
|
+
title: import_zod5.z.string().describe("Title / summary of the task."),
|
|
1342
|
+
body: import_zod5.z.string().optional().describe("Detailed description of the task."),
|
|
1343
|
+
dueDate: import_zod5.z.string().optional().describe("Due date for the task in ISO 8601 format."),
|
|
1344
|
+
completed: import_zod5.z.boolean().optional().describe("Whether the task is already completed."),
|
|
1345
|
+
assignedTo: import_zod5.z.string().optional().describe("User ID to assign the task to.")
|
|
1285
1346
|
},
|
|
1286
1347
|
async ({ contactId, title, body: taskBody, dueDate, completed, assignedTo }) => {
|
|
1287
1348
|
const reqBody = { title };
|
|
@@ -1299,7 +1360,7 @@ function registerContactTools(server2, client) {
|
|
|
1299
1360
|
"get_contact_notes",
|
|
1300
1361
|
"Retrieve all notes associated with a specific contact.",
|
|
1301
1362
|
{
|
|
1302
|
-
contactId:
|
|
1363
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose notes to retrieve.")
|
|
1303
1364
|
},
|
|
1304
1365
|
async ({ contactId }) => {
|
|
1305
1366
|
return client.get(`/contacts/${contactId}/notes`);
|
|
@@ -1310,9 +1371,9 @@ function registerContactTools(server2, client) {
|
|
|
1310
1371
|
"create_contact_note",
|
|
1311
1372
|
"Add a note to a contact's record. Useful for logging interactions, observations, or internal memos.",
|
|
1312
1373
|
{
|
|
1313
|
-
contactId:
|
|
1314
|
-
body:
|
|
1315
|
-
userId:
|
|
1374
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add the note to."),
|
|
1375
|
+
body: import_zod5.z.string().describe("The text content of the note."),
|
|
1376
|
+
userId: import_zod5.z.string().optional().describe("ID of the user creating the note.")
|
|
1316
1377
|
},
|
|
1317
1378
|
async ({ contactId, body: noteBody, userId }) => {
|
|
1318
1379
|
const reqBody = { body: noteBody };
|
|
@@ -1327,7 +1388,7 @@ function registerContactTools(server2, client) {
|
|
|
1327
1388
|
"get_contact_appointments",
|
|
1328
1389
|
"Retrieve all appointments / calendar events associated with a specific contact.",
|
|
1329
1390
|
{
|
|
1330
|
-
contactId:
|
|
1391
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose appointments to retrieve.")
|
|
1331
1392
|
},
|
|
1332
1393
|
async ({ contactId }) => {
|
|
1333
1394
|
return client.get(`/contacts/${contactId}/appointments`);
|
|
@@ -1338,8 +1399,8 @@ function registerContactTools(server2, client) {
|
|
|
1338
1399
|
"add_contact_to_workflow",
|
|
1339
1400
|
"Enroll a contact into an automation workflow. The contact will begin receiving the workflow's actions.",
|
|
1340
1401
|
{
|
|
1341
|
-
contactId:
|
|
1342
|
-
workflowId:
|
|
1402
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add to the workflow."),
|
|
1403
|
+
workflowId: import_zod5.z.string().describe("The ID of the workflow to enroll the contact in.")
|
|
1343
1404
|
},
|
|
1344
1405
|
async ({ contactId, workflowId }) => {
|
|
1345
1406
|
return client.post(
|
|
@@ -1352,8 +1413,8 @@ function registerContactTools(server2, client) {
|
|
|
1352
1413
|
"remove_contact_from_workflow",
|
|
1353
1414
|
"Remove a contact from an automation workflow, stopping any pending workflow actions.",
|
|
1354
1415
|
{
|
|
1355
|
-
contactId:
|
|
1356
|
-
workflowId:
|
|
1416
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to remove from the workflow."),
|
|
1417
|
+
workflowId: import_zod5.z.string().describe("The ID of the workflow to remove the contact from.")
|
|
1357
1418
|
},
|
|
1358
1419
|
async ({ contactId, workflowId }) => {
|
|
1359
1420
|
return client.delete(
|
|
@@ -1364,20 +1425,20 @@ function registerContactTools(server2, client) {
|
|
|
1364
1425
|
}
|
|
1365
1426
|
|
|
1366
1427
|
// src/tools/conversations.ts
|
|
1367
|
-
var
|
|
1428
|
+
var import_zod6 = require("zod");
|
|
1368
1429
|
function registerConversationTools(server2, client) {
|
|
1369
1430
|
safeTool(
|
|
1370
1431
|
server2,
|
|
1371
1432
|
"search_conversations",
|
|
1372
1433
|
"Search conversations in GoHighLevel by various filters such as contact, assignee, status, or query string.",
|
|
1373
1434
|
{
|
|
1374
|
-
locationId:
|
|
1375
|
-
contactId:
|
|
1376
|
-
assignedTo:
|
|
1377
|
-
query:
|
|
1378
|
-
status:
|
|
1379
|
-
limit:
|
|
1380
|
-
startAfterDate:
|
|
1435
|
+
locationId: import_zod6.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
1436
|
+
contactId: import_zod6.z.string().optional().describe("Filter conversations by contact ID."),
|
|
1437
|
+
assignedTo: import_zod6.z.string().optional().describe("Filter conversations by the assigned user ID."),
|
|
1438
|
+
query: import_zod6.z.string().optional().describe("Free-text search query to filter conversations."),
|
|
1439
|
+
status: import_zod6.z.enum(["all", "read", "unread", "starred", "recents"]).optional().describe("Filter by conversation status."),
|
|
1440
|
+
limit: import_zod6.z.number().optional().describe("Maximum number of conversations to return."),
|
|
1441
|
+
startAfterDate: import_zod6.z.string().optional().describe("Return conversations that started after this date (ISO 8601 / epoch ms).")
|
|
1381
1442
|
},
|
|
1382
1443
|
async ({ locationId: locationId2, contactId, assignedTo, query, status, limit, startAfterDate }) => {
|
|
1383
1444
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1399,7 +1460,7 @@ function registerConversationTools(server2, client) {
|
|
|
1399
1460
|
"get_conversation",
|
|
1400
1461
|
"Retrieve a single conversation by its ID from GoHighLevel.",
|
|
1401
1462
|
{
|
|
1402
|
-
conversationId:
|
|
1463
|
+
conversationId: import_zod6.z.string().describe("The ID of the conversation to retrieve.")
|
|
1403
1464
|
},
|
|
1404
1465
|
async ({ conversationId }) => {
|
|
1405
1466
|
return await client.get(`/conversations/${conversationId}`);
|
|
@@ -1410,8 +1471,8 @@ function registerConversationTools(server2, client) {
|
|
|
1410
1471
|
"create_conversation",
|
|
1411
1472
|
"Create a new conversation in GoHighLevel for a given contact.",
|
|
1412
1473
|
{
|
|
1413
|
-
locationId:
|
|
1414
|
-
contactId:
|
|
1474
|
+
locationId: import_zod6.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
1475
|
+
contactId: import_zod6.z.string().describe("The contact ID to create the conversation for.")
|
|
1415
1476
|
},
|
|
1416
1477
|
async ({ locationId: locationId2, contactId }) => {
|
|
1417
1478
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1425,9 +1486,9 @@ function registerConversationTools(server2, client) {
|
|
|
1425
1486
|
"get_messages",
|
|
1426
1487
|
"Retrieve messages for a specific conversation from GoHighLevel.",
|
|
1427
1488
|
{
|
|
1428
|
-
conversationId:
|
|
1429
|
-
limit:
|
|
1430
|
-
type:
|
|
1489
|
+
conversationId: import_zod6.z.string().describe("The ID of the conversation to retrieve messages for."),
|
|
1490
|
+
limit: import_zod6.z.number().optional().describe("Maximum number of messages to return."),
|
|
1491
|
+
type: import_zod6.z.string().optional().describe("Filter messages by type.")
|
|
1431
1492
|
},
|
|
1432
1493
|
async ({ conversationId, limit, type }) => {
|
|
1433
1494
|
return await client.get(`/conversations/${conversationId}/messages`, {
|
|
@@ -1440,16 +1501,16 @@ function registerConversationTools(server2, client) {
|
|
|
1440
1501
|
"send_message",
|
|
1441
1502
|
"Send an outbound message (SMS, Email, WhatsApp, etc.) to a contact via GoHighLevel.",
|
|
1442
1503
|
{
|
|
1443
|
-
type:
|
|
1444
|
-
contactId:
|
|
1445
|
-
message:
|
|
1446
|
-
subject:
|
|
1447
|
-
html:
|
|
1448
|
-
emailFrom:
|
|
1449
|
-
emailTo:
|
|
1450
|
-
emailCc:
|
|
1451
|
-
emailBcc:
|
|
1452
|
-
attachments:
|
|
1504
|
+
type: import_zod6.z.enum(["SMS", "Email", "WhatsApp", "GMB", "IG", "FB", "Custom", "Live_Chat"]).describe("The channel type for the outbound message."),
|
|
1505
|
+
contactId: import_zod6.z.string().describe("The contact ID to send the message to."),
|
|
1506
|
+
message: import_zod6.z.string().optional().describe("The message body text. Used for SMS, WhatsApp, and other chat-based channels."),
|
|
1507
|
+
subject: import_zod6.z.string().optional().describe("Email subject line. Used when type is Email."),
|
|
1508
|
+
html: import_zod6.z.string().optional().describe("HTML body for the email. Used when type is Email."),
|
|
1509
|
+
emailFrom: import_zod6.z.string().optional().describe("Sender email address (for Email type)."),
|
|
1510
|
+
emailTo: import_zod6.z.string().optional().describe("Recipient email address (for Email type)."),
|
|
1511
|
+
emailCc: import_zod6.z.array(import_zod6.z.string()).optional().describe("CC email addresses (for Email type)."),
|
|
1512
|
+
emailBcc: import_zod6.z.array(import_zod6.z.string()).optional().describe("BCC email addresses (for Email type)."),
|
|
1513
|
+
attachments: import_zod6.z.array(import_zod6.z.string()).optional().describe("Array of attachment URLs to include with the message.")
|
|
1453
1514
|
},
|
|
1454
1515
|
async ({ type, contactId, message, subject, html, emailFrom, emailTo, emailCc, emailBcc, attachments }) => {
|
|
1455
1516
|
const body = { type, contactId };
|
|
@@ -1469,10 +1530,10 @@ function registerConversationTools(server2, client) {
|
|
|
1469
1530
|
"add_inbound_message",
|
|
1470
1531
|
"Record an inbound message in a GoHighLevel conversation (e.g., from an external channel).",
|
|
1471
1532
|
{
|
|
1472
|
-
type:
|
|
1473
|
-
conversationId:
|
|
1474
|
-
conversationProviderId:
|
|
1475
|
-
message:
|
|
1533
|
+
type: import_zod6.z.string().describe("The channel type of the inbound message (e.g., SMS, Email, WhatsApp)."),
|
|
1534
|
+
conversationId: import_zod6.z.string().describe("The conversation ID to add the message to."),
|
|
1535
|
+
conversationProviderId: import_zod6.z.string().describe("The provider ID for the conversation channel."),
|
|
1536
|
+
message: import_zod6.z.string().describe("The inbound message body text.")
|
|
1476
1537
|
},
|
|
1477
1538
|
async ({ type, conversationId, conversationProviderId, message }) => {
|
|
1478
1539
|
return await client.post("/conversations/messages/inbound", {
|
|
@@ -1485,9 +1546,9 @@ function registerConversationTools(server2, client) {
|
|
|
1485
1546
|
"update_message_status",
|
|
1486
1547
|
"Update the delivery/read status of a specific message in GoHighLevel.",
|
|
1487
1548
|
{
|
|
1488
|
-
messageId:
|
|
1489
|
-
status:
|
|
1490
|
-
error:
|
|
1549
|
+
messageId: import_zod6.z.string().describe("The ID of the message to update."),
|
|
1550
|
+
status: import_zod6.z.enum(["read", "pending", "delivered", "failed"]).describe("The new status to set for the message."),
|
|
1551
|
+
error: import_zod6.z.string().optional().describe("Error details if the status is 'failed'.")
|
|
1491
1552
|
},
|
|
1492
1553
|
async ({ messageId, status, error }) => {
|
|
1493
1554
|
const body = { status };
|
|
@@ -1500,7 +1561,7 @@ function registerConversationTools(server2, client) {
|
|
|
1500
1561
|
"get_message",
|
|
1501
1562
|
"Retrieve a single message by its ID from GoHighLevel.",
|
|
1502
1563
|
{
|
|
1503
|
-
messageId:
|
|
1564
|
+
messageId: import_zod6.z.string().describe("The ID of the message to retrieve.")
|
|
1504
1565
|
},
|
|
1505
1566
|
async ({ messageId }) => {
|
|
1506
1567
|
return await client.get(`/conversations/messages/${messageId}`);
|
|
@@ -1509,30 +1570,30 @@ function registerConversationTools(server2, client) {
|
|
|
1509
1570
|
}
|
|
1510
1571
|
|
|
1511
1572
|
// src/tools/opportunities.ts
|
|
1512
|
-
var
|
|
1513
|
-
var statusEnum =
|
|
1514
|
-
var statusEnumWithAll =
|
|
1573
|
+
var import_zod7 = require("zod");
|
|
1574
|
+
var statusEnum = import_zod7.z.enum(["open", "won", "lost", "abandoned"]).describe("Opportunity status");
|
|
1575
|
+
var statusEnumWithAll = import_zod7.z.enum(["open", "won", "lost", "abandoned", "all"]).describe("Opportunity status filter (use 'all' to include every status)");
|
|
1515
1576
|
function registerOpportunityTools(server2, client) {
|
|
1516
1577
|
safeTool(
|
|
1517
1578
|
server2,
|
|
1518
1579
|
"search_opportunities",
|
|
1519
1580
|
"Search opportunities in GoHighLevel with optional filters",
|
|
1520
1581
|
{
|
|
1521
|
-
locationId:
|
|
1582
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1522
1583
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1523
1584
|
),
|
|
1524
|
-
pipelineId:
|
|
1525
|
-
pipelineStageId:
|
|
1526
|
-
contactId:
|
|
1585
|
+
pipelineId: import_zod7.z.string().optional().describe("Filter by pipeline ID"),
|
|
1586
|
+
pipelineStageId: import_zod7.z.string().optional().describe("Filter by pipeline stage ID"),
|
|
1587
|
+
contactId: import_zod7.z.string().optional().describe("Filter by contact ID"),
|
|
1527
1588
|
status: statusEnumWithAll.optional().describe("Filter by status"),
|
|
1528
|
-
assignedTo:
|
|
1529
|
-
query:
|
|
1530
|
-
limit:
|
|
1531
|
-
startAfter:
|
|
1532
|
-
startAfterId:
|
|
1533
|
-
order:
|
|
1534
|
-
endDate:
|
|
1535
|
-
startDate:
|
|
1589
|
+
assignedTo: import_zod7.z.string().optional().describe("Filter by assigned user ID"),
|
|
1590
|
+
query: import_zod7.z.string().optional().describe("Search query string"),
|
|
1591
|
+
limit: import_zod7.z.number().optional().describe("Maximum number of results to return"),
|
|
1592
|
+
startAfter: import_zod7.z.string().optional().describe("Cursor timestamp for pagination"),
|
|
1593
|
+
startAfterId: import_zod7.z.string().optional().describe("Cursor ID for pagination"),
|
|
1594
|
+
order: import_zod7.z.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
1595
|
+
endDate: import_zod7.z.string().optional().describe("End date filter (ISO string)"),
|
|
1596
|
+
startDate: import_zod7.z.string().optional().describe("Start date filter (ISO string)")
|
|
1536
1597
|
},
|
|
1537
1598
|
async (args) => {
|
|
1538
1599
|
const locationId2 = client.resolveLocationId(args.locationId);
|
|
@@ -1560,7 +1621,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1560
1621
|
"get_opportunity",
|
|
1561
1622
|
"Get a single opportunity by ID from GoHighLevel",
|
|
1562
1623
|
{
|
|
1563
|
-
opportunityId:
|
|
1624
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to retrieve")
|
|
1564
1625
|
},
|
|
1565
1626
|
async (args) => {
|
|
1566
1627
|
return await client.get(`/opportunities/${args.opportunityId}`);
|
|
@@ -1571,17 +1632,17 @@ function registerOpportunityTools(server2, client) {
|
|
|
1571
1632
|
"create_opportunity",
|
|
1572
1633
|
"Create a new opportunity in GoHighLevel",
|
|
1573
1634
|
{
|
|
1574
|
-
locationId:
|
|
1635
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1575
1636
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1576
1637
|
),
|
|
1577
|
-
pipelineId:
|
|
1578
|
-
pipelineStageId:
|
|
1579
|
-
contactId:
|
|
1580
|
-
name:
|
|
1638
|
+
pipelineId: import_zod7.z.string().describe("Pipeline ID (required)"),
|
|
1639
|
+
pipelineStageId: import_zod7.z.string().describe("Pipeline stage ID (required)"),
|
|
1640
|
+
contactId: import_zod7.z.string().describe("Contact ID (required)"),
|
|
1641
|
+
name: import_zod7.z.string().describe("Opportunity name (required)"),
|
|
1581
1642
|
status: statusEnum.optional().describe("Opportunity status"),
|
|
1582
|
-
monetaryValue:
|
|
1583
|
-
assignedTo:
|
|
1584
|
-
source:
|
|
1643
|
+
monetaryValue: import_zod7.z.number().optional().describe("Monetary value of the opportunity"),
|
|
1644
|
+
assignedTo: import_zod7.z.string().optional().describe("User ID to assign the opportunity to"),
|
|
1645
|
+
source: import_zod7.z.string().optional().describe("Lead source")
|
|
1585
1646
|
},
|
|
1586
1647
|
async (args) => {
|
|
1587
1648
|
const locationId2 = client.resolveLocationId(args.locationId);
|
|
@@ -1605,14 +1666,14 @@ function registerOpportunityTools(server2, client) {
|
|
|
1605
1666
|
"update_opportunity",
|
|
1606
1667
|
"Update an existing opportunity in GoHighLevel",
|
|
1607
1668
|
{
|
|
1608
|
-
opportunityId:
|
|
1609
|
-
pipelineId:
|
|
1610
|
-
pipelineStageId:
|
|
1611
|
-
name:
|
|
1669
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to update"),
|
|
1670
|
+
pipelineId: import_zod7.z.string().optional().describe("Pipeline ID"),
|
|
1671
|
+
pipelineStageId: import_zod7.z.string().optional().describe("Pipeline stage ID"),
|
|
1672
|
+
name: import_zod7.z.string().optional().describe("Opportunity name"),
|
|
1612
1673
|
status: statusEnum.optional().describe("Opportunity status"),
|
|
1613
|
-
monetaryValue:
|
|
1614
|
-
assignedTo:
|
|
1615
|
-
source:
|
|
1674
|
+
monetaryValue: import_zod7.z.number().optional().describe("Monetary value of the opportunity"),
|
|
1675
|
+
assignedTo: import_zod7.z.string().optional().describe("User ID to assign the opportunity to"),
|
|
1676
|
+
source: import_zod7.z.string().optional().describe("Lead source")
|
|
1616
1677
|
},
|
|
1617
1678
|
async (args) => {
|
|
1618
1679
|
const body = {};
|
|
@@ -1635,8 +1696,8 @@ function registerOpportunityTools(server2, client) {
|
|
|
1635
1696
|
"delete_opportunity",
|
|
1636
1697
|
"Permanently delete an opportunity. IRREVERSIBLE.",
|
|
1637
1698
|
{
|
|
1638
|
-
opportunityId:
|
|
1639
|
-
confirm:
|
|
1699
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to delete"),
|
|
1700
|
+
confirm: import_zod7.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1640
1701
|
},
|
|
1641
1702
|
async (args) => {
|
|
1642
1703
|
return await client.delete(`/opportunities/${args.opportunityId}`);
|
|
@@ -1647,7 +1708,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1647
1708
|
"update_opportunity_status",
|
|
1648
1709
|
"Update only the status of an opportunity in GoHighLevel",
|
|
1649
1710
|
{
|
|
1650
|
-
opportunityId:
|
|
1711
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to update"),
|
|
1651
1712
|
status: statusEnum.describe("New status for the opportunity")
|
|
1652
1713
|
},
|
|
1653
1714
|
async (args) => {
|
|
@@ -1662,7 +1723,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1662
1723
|
"get_pipelines",
|
|
1663
1724
|
"List all pipelines for a location in GoHighLevel",
|
|
1664
1725
|
{
|
|
1665
|
-
locationId:
|
|
1726
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1666
1727
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1667
1728
|
)
|
|
1668
1729
|
},
|
|
@@ -1677,14 +1738,14 @@ function registerOpportunityTools(server2, client) {
|
|
|
1677
1738
|
}
|
|
1678
1739
|
|
|
1679
1740
|
// src/tools/calendars.ts
|
|
1680
|
-
var
|
|
1741
|
+
var import_zod8 = require("zod");
|
|
1681
1742
|
function registerCalendarTools(server2, client) {
|
|
1682
1743
|
safeTool(
|
|
1683
1744
|
server2,
|
|
1684
1745
|
"get_calendars",
|
|
1685
1746
|
"List all calendars for a location",
|
|
1686
1747
|
{
|
|
1687
|
-
locationId:
|
|
1748
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)")
|
|
1688
1749
|
},
|
|
1689
1750
|
async ({ locationId: locationId2 }) => {
|
|
1690
1751
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1699,7 +1760,7 @@ function registerCalendarTools(server2, client) {
|
|
|
1699
1760
|
"get_calendar",
|
|
1700
1761
|
"Get a single calendar by ID",
|
|
1701
1762
|
{
|
|
1702
|
-
calendarId:
|
|
1763
|
+
calendarId: import_zod8.z.string().describe("The calendar ID")
|
|
1703
1764
|
},
|
|
1704
1765
|
async ({ calendarId }) => {
|
|
1705
1766
|
return await client.get(`/calendars/${calendarId}`);
|
|
@@ -1710,19 +1771,19 @@ function registerCalendarTools(server2, client) {
|
|
|
1710
1771
|
"create_calendar",
|
|
1711
1772
|
"Create a new calendar",
|
|
1712
1773
|
{
|
|
1713
|
-
locationId:
|
|
1714
|
-
name:
|
|
1715
|
-
description:
|
|
1716
|
-
slug:
|
|
1717
|
-
widgetSlug:
|
|
1718
|
-
calendarType:
|
|
1719
|
-
teamMembers:
|
|
1720
|
-
eventTitle:
|
|
1721
|
-
eventColor:
|
|
1722
|
-
slotDuration:
|
|
1723
|
-
slotBuffer:
|
|
1724
|
-
slotInterval:
|
|
1725
|
-
appointmentPerSlot:
|
|
1774
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
1775
|
+
name: import_zod8.z.string().describe("Calendar name"),
|
|
1776
|
+
description: import_zod8.z.string().optional().describe("Calendar description"),
|
|
1777
|
+
slug: import_zod8.z.string().optional().describe("Calendar slug"),
|
|
1778
|
+
widgetSlug: import_zod8.z.string().optional().describe("Widget slug for embedding"),
|
|
1779
|
+
calendarType: import_zod8.z.string().optional().describe("Calendar type"),
|
|
1780
|
+
teamMembers: import_zod8.z.array(import_zod8.z.record(import_zod8.z.unknown())).optional().describe("Array of team member objects"),
|
|
1781
|
+
eventTitle: import_zod8.z.string().optional().describe("Default event title"),
|
|
1782
|
+
eventColor: import_zod8.z.string().optional().describe("Event color hex code"),
|
|
1783
|
+
slotDuration: import_zod8.z.number().optional().describe("Slot duration in minutes"),
|
|
1784
|
+
slotBuffer: import_zod8.z.number().optional().describe("Buffer time between slots in minutes"),
|
|
1785
|
+
slotInterval: import_zod8.z.number().optional().describe("Slot interval in minutes"),
|
|
1786
|
+
appointmentPerSlot: import_zod8.z.number().optional().describe("Max appointments per slot")
|
|
1726
1787
|
},
|
|
1727
1788
|
async ({ locationId: locationId2, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
|
|
1728
1789
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1749,19 +1810,19 @@ function registerCalendarTools(server2, client) {
|
|
|
1749
1810
|
"update_calendar",
|
|
1750
1811
|
"Update an existing calendar",
|
|
1751
1812
|
{
|
|
1752
|
-
calendarId:
|
|
1753
|
-
name:
|
|
1754
|
-
description:
|
|
1755
|
-
slug:
|
|
1756
|
-
widgetSlug:
|
|
1757
|
-
calendarType:
|
|
1758
|
-
teamMembers:
|
|
1759
|
-
eventTitle:
|
|
1760
|
-
eventColor:
|
|
1761
|
-
slotDuration:
|
|
1762
|
-
slotBuffer:
|
|
1763
|
-
slotInterval:
|
|
1764
|
-
appointmentPerSlot:
|
|
1813
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to update"),
|
|
1814
|
+
name: import_zod8.z.string().optional().describe("Calendar name"),
|
|
1815
|
+
description: import_zod8.z.string().optional().describe("Calendar description"),
|
|
1816
|
+
slug: import_zod8.z.string().optional().describe("Calendar slug"),
|
|
1817
|
+
widgetSlug: import_zod8.z.string().optional().describe("Widget slug for embedding"),
|
|
1818
|
+
calendarType: import_zod8.z.string().optional().describe("Calendar type"),
|
|
1819
|
+
teamMembers: import_zod8.z.array(import_zod8.z.record(import_zod8.z.unknown())).optional().describe("Array of team member objects"),
|
|
1820
|
+
eventTitle: import_zod8.z.string().optional().describe("Default event title"),
|
|
1821
|
+
eventColor: import_zod8.z.string().optional().describe("Event color hex code"),
|
|
1822
|
+
slotDuration: import_zod8.z.number().optional().describe("Slot duration in minutes"),
|
|
1823
|
+
slotBuffer: import_zod8.z.number().optional().describe("Buffer time between slots in minutes"),
|
|
1824
|
+
slotInterval: import_zod8.z.number().optional().describe("Slot interval in minutes"),
|
|
1825
|
+
appointmentPerSlot: import_zod8.z.number().optional().describe("Max appointments per slot")
|
|
1765
1826
|
},
|
|
1766
1827
|
async ({ calendarId, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
|
|
1767
1828
|
const body = {};
|
|
@@ -1785,8 +1846,8 @@ function registerCalendarTools(server2, client) {
|
|
|
1785
1846
|
"delete_calendar",
|
|
1786
1847
|
"Permanently delete a calendar. IRREVERSIBLE.",
|
|
1787
1848
|
{
|
|
1788
|
-
calendarId:
|
|
1789
|
-
confirm:
|
|
1849
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to delete"),
|
|
1850
|
+
confirm: import_zod8.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1790
1851
|
},
|
|
1791
1852
|
async ({ calendarId }) => {
|
|
1792
1853
|
return await client.delete(`/calendars/${calendarId}`);
|
|
@@ -1797,11 +1858,11 @@ function registerCalendarTools(server2, client) {
|
|
|
1797
1858
|
"get_free_slots",
|
|
1798
1859
|
"Get available free slots for a calendar",
|
|
1799
1860
|
{
|
|
1800
|
-
calendarId:
|
|
1801
|
-
startDate:
|
|
1802
|
-
endDate:
|
|
1803
|
-
timezone:
|
|
1804
|
-
userId:
|
|
1861
|
+
calendarId: import_zod8.z.string().describe("The calendar ID"),
|
|
1862
|
+
startDate: import_zod8.z.string().describe("Start date in ISO format (YYYY-MM-DD)"),
|
|
1863
|
+
endDate: import_zod8.z.string().describe("End date in ISO format (YYYY-MM-DD)"),
|
|
1864
|
+
timezone: import_zod8.z.string().optional().describe("Timezone (e.g. America/New_York)"),
|
|
1865
|
+
userId: import_zod8.z.string().optional().describe("Filter by user ID")
|
|
1805
1866
|
},
|
|
1806
1867
|
async ({ calendarId, startDate, endDate, timezone, userId }) => {
|
|
1807
1868
|
const params = { startDate, endDate };
|
|
@@ -1817,11 +1878,11 @@ function registerCalendarTools(server2, client) {
|
|
|
1817
1878
|
"get_calendar_events",
|
|
1818
1879
|
"List calendar events for a location within a time range",
|
|
1819
1880
|
{
|
|
1820
|
-
locationId:
|
|
1821
|
-
startTime:
|
|
1822
|
-
endTime:
|
|
1823
|
-
calendarId:
|
|
1824
|
-
userId:
|
|
1881
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
1882
|
+
startTime: import_zod8.z.string().describe("Start time in ISO format"),
|
|
1883
|
+
endTime: import_zod8.z.string().describe("End time in ISO format"),
|
|
1884
|
+
calendarId: import_zod8.z.string().optional().describe("Filter by calendar ID"),
|
|
1885
|
+
userId: import_zod8.z.string().optional().describe("Filter by user ID")
|
|
1825
1886
|
},
|
|
1826
1887
|
async ({ locationId: locationId2, startTime, endTime, calendarId, userId }) => {
|
|
1827
1888
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1840,7 +1901,7 @@ function registerCalendarTools(server2, client) {
|
|
|
1840
1901
|
"get_appointment",
|
|
1841
1902
|
"Get a single appointment by event ID",
|
|
1842
1903
|
{
|
|
1843
|
-
eventId:
|
|
1904
|
+
eventId: import_zod8.z.string().describe("The appointment event ID")
|
|
1844
1905
|
},
|
|
1845
1906
|
async ({ eventId }) => {
|
|
1846
1907
|
return await client.get(
|
|
@@ -1853,17 +1914,17 @@ function registerCalendarTools(server2, client) {
|
|
|
1853
1914
|
"create_appointment",
|
|
1854
1915
|
"Create a new appointment",
|
|
1855
1916
|
{
|
|
1856
|
-
calendarId:
|
|
1857
|
-
locationId:
|
|
1858
|
-
contactId:
|
|
1859
|
-
startTime:
|
|
1860
|
-
endTime:
|
|
1861
|
-
title:
|
|
1862
|
-
appointmentStatus:
|
|
1863
|
-
assignedUserId:
|
|
1864
|
-
address:
|
|
1865
|
-
notes:
|
|
1866
|
-
toNotify:
|
|
1917
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to book into"),
|
|
1918
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
1919
|
+
contactId: import_zod8.z.string().describe("The contact ID for the appointment"),
|
|
1920
|
+
startTime: import_zod8.z.string().describe("Start time in ISO format"),
|
|
1921
|
+
endTime: import_zod8.z.string().describe("End time in ISO format"),
|
|
1922
|
+
title: import_zod8.z.string().optional().describe("Appointment title"),
|
|
1923
|
+
appointmentStatus: import_zod8.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
|
|
1924
|
+
assignedUserId: import_zod8.z.string().optional().describe("Assigned user ID"),
|
|
1925
|
+
address: import_zod8.z.string().optional().describe("Appointment address"),
|
|
1926
|
+
notes: import_zod8.z.string().optional().describe("Appointment notes"),
|
|
1927
|
+
toNotify: import_zod8.z.boolean().optional().describe("Whether to send notifications")
|
|
1867
1928
|
},
|
|
1868
1929
|
async ({ calendarId, locationId: locationId2, contactId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
|
|
1869
1930
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1890,16 +1951,16 @@ function registerCalendarTools(server2, client) {
|
|
|
1890
1951
|
"update_appointment",
|
|
1891
1952
|
"Update an existing appointment",
|
|
1892
1953
|
{
|
|
1893
|
-
eventId:
|
|
1894
|
-
calendarId:
|
|
1895
|
-
startTime:
|
|
1896
|
-
endTime:
|
|
1897
|
-
title:
|
|
1898
|
-
appointmentStatus:
|
|
1899
|
-
assignedUserId:
|
|
1900
|
-
address:
|
|
1901
|
-
notes:
|
|
1902
|
-
toNotify:
|
|
1954
|
+
eventId: import_zod8.z.string().describe("The appointment event ID to update"),
|
|
1955
|
+
calendarId: import_zod8.z.string().optional().describe("Calendar ID"),
|
|
1956
|
+
startTime: import_zod8.z.string().optional().describe("Start time in ISO format"),
|
|
1957
|
+
endTime: import_zod8.z.string().optional().describe("End time in ISO format"),
|
|
1958
|
+
title: import_zod8.z.string().optional().describe("Appointment title"),
|
|
1959
|
+
appointmentStatus: import_zod8.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
|
|
1960
|
+
assignedUserId: import_zod8.z.string().optional().describe("Assigned user ID"),
|
|
1961
|
+
address: import_zod8.z.string().optional().describe("Appointment address"),
|
|
1962
|
+
notes: import_zod8.z.string().optional().describe("Appointment notes"),
|
|
1963
|
+
toNotify: import_zod8.z.boolean().optional().describe("Whether to send notifications")
|
|
1903
1964
|
},
|
|
1904
1965
|
async ({ eventId, calendarId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
|
|
1905
1966
|
const body = {};
|
|
@@ -1923,8 +1984,8 @@ function registerCalendarTools(server2, client) {
|
|
|
1923
1984
|
"delete_appointment",
|
|
1924
1985
|
"Permanently delete an appointment. IRREVERSIBLE.",
|
|
1925
1986
|
{
|
|
1926
|
-
eventId:
|
|
1927
|
-
confirm:
|
|
1987
|
+
eventId: import_zod8.z.string().describe("The appointment event ID to delete"),
|
|
1988
|
+
confirm: import_zod8.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1928
1989
|
},
|
|
1929
1990
|
async ({ eventId }) => {
|
|
1930
1991
|
return await client.delete(
|
|
@@ -1935,14 +1996,14 @@ function registerCalendarTools(server2, client) {
|
|
|
1935
1996
|
}
|
|
1936
1997
|
|
|
1937
1998
|
// src/tools/locations.ts
|
|
1938
|
-
var
|
|
1999
|
+
var import_zod9 = require("zod");
|
|
1939
2000
|
function registerLocationTools(server2, client) {
|
|
1940
2001
|
safeTool(
|
|
1941
2002
|
server2,
|
|
1942
2003
|
"get_location",
|
|
1943
2004
|
"Retrieve a single location (sub-account) by its ID from GoHighLevel.",
|
|
1944
2005
|
{
|
|
1945
|
-
locationId:
|
|
2006
|
+
locationId: import_zod9.z.string().describe("The ID of the location to retrieve.")
|
|
1946
2007
|
},
|
|
1947
2008
|
async ({ locationId: locationId2 }) => {
|
|
1948
2009
|
return await client.get(`/locations/${locationId2}`);
|
|
@@ -1953,18 +2014,18 @@ function registerLocationTools(server2, client) {
|
|
|
1953
2014
|
"update_location",
|
|
1954
2015
|
"Update a location (sub-account) in GoHighLevel. Only provided fields will be updated.",
|
|
1955
2016
|
{
|
|
1956
|
-
locationId:
|
|
1957
|
-
name:
|
|
1958
|
-
address:
|
|
1959
|
-
city:
|
|
1960
|
-
state:
|
|
1961
|
-
postalCode:
|
|
1962
|
-
country:
|
|
1963
|
-
website:
|
|
1964
|
-
timezone:
|
|
1965
|
-
phone:
|
|
1966
|
-
email:
|
|
1967
|
-
settings:
|
|
2017
|
+
locationId: import_zod9.z.string().describe("The ID of the location to update."),
|
|
2018
|
+
name: import_zod9.z.string().optional().describe("Business name."),
|
|
2019
|
+
address: import_zod9.z.string().optional().describe("Street address."),
|
|
2020
|
+
city: import_zod9.z.string().optional().describe("City."),
|
|
2021
|
+
state: import_zod9.z.string().optional().describe("State or province."),
|
|
2022
|
+
postalCode: import_zod9.z.string().optional().describe("Postal / ZIP code."),
|
|
2023
|
+
country: import_zod9.z.string().optional().describe("Country (e.g., 'US')."),
|
|
2024
|
+
website: import_zod9.z.string().optional().describe("Website URL."),
|
|
2025
|
+
timezone: import_zod9.z.string().optional().describe("IANA timezone (e.g., 'America/New_York')."),
|
|
2026
|
+
phone: import_zod9.z.string().optional().describe("Phone number."),
|
|
2027
|
+
email: import_zod9.z.string().optional().describe("Email address."),
|
|
2028
|
+
settings: import_zod9.z.record(import_zod9.z.unknown()).optional().describe("Location settings object with key-value pairs.")
|
|
1968
2029
|
},
|
|
1969
2030
|
async ({ locationId: locationId2, name, address, city, state, postalCode, country, website, timezone, phone, email, settings }) => {
|
|
1970
2031
|
const body = {};
|
|
@@ -1987,11 +2048,11 @@ function registerLocationTools(server2, client) {
|
|
|
1987
2048
|
"search_locations",
|
|
1988
2049
|
"Search locations (sub-accounts) under an agency in GoHighLevel. Requires companyId (agency-level).",
|
|
1989
2050
|
{
|
|
1990
|
-
companyId:
|
|
1991
|
-
limit:
|
|
1992
|
-
skip:
|
|
1993
|
-
order:
|
|
1994
|
-
isActive:
|
|
2051
|
+
companyId: import_zod9.z.string().describe("The agency / company ID (required for agency-level search)."),
|
|
2052
|
+
limit: import_zod9.z.number().optional().describe("Maximum number of locations to return."),
|
|
2053
|
+
skip: import_zod9.z.number().optional().describe("Number of locations to skip for pagination."),
|
|
2054
|
+
order: import_zod9.z.string().optional().describe("Sort order (e.g., 'asc' or 'desc')."),
|
|
2055
|
+
isActive: import_zod9.z.boolean().optional().describe("Filter by active status.")
|
|
1995
2056
|
},
|
|
1996
2057
|
async ({ companyId, limit, skip, order, isActive }) => {
|
|
1997
2058
|
return await client.get("/locations/search", {
|
|
@@ -2004,9 +2065,9 @@ function registerLocationTools(server2, client) {
|
|
|
2004
2065
|
"get_location_tags",
|
|
2005
2066
|
"Retrieve tags for a location in GoHighLevel.",
|
|
2006
2067
|
{
|
|
2007
|
-
locationId:
|
|
2008
|
-
limit:
|
|
2009
|
-
skip:
|
|
2068
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2069
|
+
limit: import_zod9.z.number().optional().describe("Maximum number of tags to return."),
|
|
2070
|
+
skip: import_zod9.z.number().optional().describe("Number of tags to skip for pagination.")
|
|
2010
2071
|
},
|
|
2011
2072
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2012
2073
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2020,8 +2081,8 @@ function registerLocationTools(server2, client) {
|
|
|
2020
2081
|
"create_location_tag",
|
|
2021
2082
|
"Create a new tag for a location in GoHighLevel.",
|
|
2022
2083
|
{
|
|
2023
|
-
locationId:
|
|
2024
|
-
name:
|
|
2084
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2085
|
+
name: import_zod9.z.string().describe("The name of the tag to create.")
|
|
2025
2086
|
},
|
|
2026
2087
|
async ({ locationId: locationId2, name }) => {
|
|
2027
2088
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2035,9 +2096,9 @@ function registerLocationTools(server2, client) {
|
|
|
2035
2096
|
"update_location_tag",
|
|
2036
2097
|
"Update an existing tag for a location in GoHighLevel.",
|
|
2037
2098
|
{
|
|
2038
|
-
locationId:
|
|
2039
|
-
tagId:
|
|
2040
|
-
name:
|
|
2099
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2100
|
+
tagId: import_zod9.z.string().describe("The ID of the tag to update."),
|
|
2101
|
+
name: import_zod9.z.string().describe("The new name for the tag.")
|
|
2041
2102
|
},
|
|
2042
2103
|
async ({ locationId: locationId2, tagId, name }) => {
|
|
2043
2104
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2051,8 +2112,8 @@ function registerLocationTools(server2, client) {
|
|
|
2051
2112
|
"delete_location_tag",
|
|
2052
2113
|
"Delete a tag from a location in GoHighLevel.",
|
|
2053
2114
|
{
|
|
2054
|
-
locationId:
|
|
2055
|
-
tagId:
|
|
2115
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2116
|
+
tagId: import_zod9.z.string().describe("The ID of the tag to delete.")
|
|
2056
2117
|
},
|
|
2057
2118
|
async ({ locationId: locationId2, tagId }) => {
|
|
2058
2119
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2064,7 +2125,7 @@ function registerLocationTools(server2, client) {
|
|
|
2064
2125
|
"get_custom_fields",
|
|
2065
2126
|
"Retrieve custom fields for a location in GoHighLevel.",
|
|
2066
2127
|
{
|
|
2067
|
-
locationId:
|
|
2128
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2068
2129
|
},
|
|
2069
2130
|
async ({ locationId: locationId2 }) => {
|
|
2070
2131
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2076,9 +2137,9 @@ function registerLocationTools(server2, client) {
|
|
|
2076
2137
|
"create_custom_field",
|
|
2077
2138
|
"Create a new custom field for a location in GoHighLevel.",
|
|
2078
2139
|
{
|
|
2079
|
-
locationId:
|
|
2080
|
-
name:
|
|
2081
|
-
dataType:
|
|
2140
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2141
|
+
name: import_zod9.z.string().describe("The name of the custom field."),
|
|
2142
|
+
dataType: import_zod9.z.enum([
|
|
2082
2143
|
"TEXT",
|
|
2083
2144
|
"LARGE_TEXT",
|
|
2084
2145
|
"NUMERICAL",
|
|
@@ -2093,10 +2154,10 @@ function registerLocationTools(server2, client) {
|
|
|
2093
2154
|
"FILE_UPLOAD",
|
|
2094
2155
|
"SIGNATURE"
|
|
2095
2156
|
]).describe("The data type of the custom field."),
|
|
2096
|
-
placeholder:
|
|
2097
|
-
position:
|
|
2098
|
-
options:
|
|
2099
|
-
model:
|
|
2157
|
+
placeholder: import_zod9.z.string().optional().describe("Placeholder text for the field."),
|
|
2158
|
+
position: import_zod9.z.number().optional().describe("Display position / sort order of the field."),
|
|
2159
|
+
options: import_zod9.z.array(import_zod9.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
|
|
2160
|
+
model: import_zod9.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to. Defaults to contact.")
|
|
2100
2161
|
},
|
|
2101
2162
|
async ({ locationId: locationId2, name, dataType, placeholder, position, options, model }) => {
|
|
2102
2163
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2113,10 +2174,10 @@ function registerLocationTools(server2, client) {
|
|
|
2113
2174
|
"update_custom_field",
|
|
2114
2175
|
"Update an existing custom field for a location in GoHighLevel.",
|
|
2115
2176
|
{
|
|
2116
|
-
locationId:
|
|
2117
|
-
fieldId:
|
|
2118
|
-
name:
|
|
2119
|
-
dataType:
|
|
2177
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2178
|
+
fieldId: import_zod9.z.string().describe("The ID of the custom field to update."),
|
|
2179
|
+
name: import_zod9.z.string().optional().describe("The name of the custom field."),
|
|
2180
|
+
dataType: import_zod9.z.enum([
|
|
2120
2181
|
"TEXT",
|
|
2121
2182
|
"LARGE_TEXT",
|
|
2122
2183
|
"NUMERICAL",
|
|
@@ -2131,10 +2192,10 @@ function registerLocationTools(server2, client) {
|
|
|
2131
2192
|
"FILE_UPLOAD",
|
|
2132
2193
|
"SIGNATURE"
|
|
2133
2194
|
]).optional().describe("The data type of the custom field."),
|
|
2134
|
-
placeholder:
|
|
2135
|
-
position:
|
|
2136
|
-
options:
|
|
2137
|
-
model:
|
|
2195
|
+
placeholder: import_zod9.z.string().optional().describe("Placeholder text for the field."),
|
|
2196
|
+
position: import_zod9.z.number().optional().describe("Display position / sort order of the field."),
|
|
2197
|
+
options: import_zod9.z.array(import_zod9.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
|
|
2198
|
+
model: import_zod9.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to.")
|
|
2138
2199
|
},
|
|
2139
2200
|
async ({ locationId: locationId2, fieldId, name, dataType, placeholder, position, options, model }) => {
|
|
2140
2201
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2153,8 +2214,8 @@ function registerLocationTools(server2, client) {
|
|
|
2153
2214
|
"delete_custom_field",
|
|
2154
2215
|
"Delete a custom field from a location in GoHighLevel.",
|
|
2155
2216
|
{
|
|
2156
|
-
locationId:
|
|
2157
|
-
fieldId:
|
|
2217
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2218
|
+
fieldId: import_zod9.z.string().describe("The ID of the custom field to delete.")
|
|
2158
2219
|
},
|
|
2159
2220
|
async ({ locationId: locationId2, fieldId }) => {
|
|
2160
2221
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2166,7 +2227,7 @@ function registerLocationTools(server2, client) {
|
|
|
2166
2227
|
"get_custom_values",
|
|
2167
2228
|
"Retrieve custom values for a location in GoHighLevel.",
|
|
2168
2229
|
{
|
|
2169
|
-
locationId:
|
|
2230
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2170
2231
|
},
|
|
2171
2232
|
async ({ locationId: locationId2 }) => {
|
|
2172
2233
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2178,9 +2239,9 @@ function registerLocationTools(server2, client) {
|
|
|
2178
2239
|
"create_custom_value",
|
|
2179
2240
|
"Create a new custom value for a location in GoHighLevel.",
|
|
2180
2241
|
{
|
|
2181
|
-
locationId:
|
|
2182
|
-
name:
|
|
2183
|
-
value:
|
|
2242
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2243
|
+
name: import_zod9.z.string().describe("The name / key of the custom value."),
|
|
2244
|
+
value: import_zod9.z.string().describe("The value to set.")
|
|
2184
2245
|
},
|
|
2185
2246
|
async ({ locationId: locationId2, name, value }) => {
|
|
2186
2247
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2194,10 +2255,10 @@ function registerLocationTools(server2, client) {
|
|
|
2194
2255
|
"update_custom_value",
|
|
2195
2256
|
"Update an existing custom value for a location in GoHighLevel.",
|
|
2196
2257
|
{
|
|
2197
|
-
locationId:
|
|
2198
|
-
valueId:
|
|
2199
|
-
name:
|
|
2200
|
-
value:
|
|
2258
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2259
|
+
valueId: import_zod9.z.string().describe("The ID of the custom value to update."),
|
|
2260
|
+
name: import_zod9.z.string().optional().describe("The new name / key of the custom value."),
|
|
2261
|
+
value: import_zod9.z.string().optional().describe("The new value to set.")
|
|
2201
2262
|
},
|
|
2202
2263
|
async ({ locationId: locationId2, valueId, name, value }) => {
|
|
2203
2264
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2212,8 +2273,8 @@ function registerLocationTools(server2, client) {
|
|
|
2212
2273
|
"delete_custom_value",
|
|
2213
2274
|
"Delete a custom value from a location in GoHighLevel.",
|
|
2214
2275
|
{
|
|
2215
|
-
locationId:
|
|
2216
|
-
valueId:
|
|
2276
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2277
|
+
valueId: import_zod9.z.string().describe("The ID of the custom value to delete.")
|
|
2217
2278
|
},
|
|
2218
2279
|
async ({ locationId: locationId2, valueId }) => {
|
|
2219
2280
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2223,14 +2284,14 @@ function registerLocationTools(server2, client) {
|
|
|
2223
2284
|
}
|
|
2224
2285
|
|
|
2225
2286
|
// src/tools/workflows.ts
|
|
2226
|
-
var
|
|
2287
|
+
var import_zod10 = require("zod");
|
|
2227
2288
|
function registerWorkflowTools(server2, client) {
|
|
2228
2289
|
safeTool(
|
|
2229
2290
|
server2,
|
|
2230
2291
|
"get_workflows",
|
|
2231
2292
|
"Retrieve all workflows for a location in GoHighLevel. To trigger a workflow for a contact, use add_contact_to_workflow in the contacts tools.",
|
|
2232
2293
|
{
|
|
2233
|
-
locationId:
|
|
2294
|
+
locationId: import_zod10.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2234
2295
|
},
|
|
2235
2296
|
async ({ locationId: locationId2 }) => {
|
|
2236
2297
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2242,16 +2303,16 @@ function registerWorkflowTools(server2, client) {
|
|
|
2242
2303
|
}
|
|
2243
2304
|
|
|
2244
2305
|
// src/tools/funnels.ts
|
|
2245
|
-
var
|
|
2306
|
+
var import_zod11 = require("zod");
|
|
2246
2307
|
function registerFunnelTools(server2, client) {
|
|
2247
2308
|
safeTool(
|
|
2248
2309
|
server2,
|
|
2249
2310
|
"get_funnels",
|
|
2250
2311
|
"List funnels for a location. Offset-based pagination via limit/offset.",
|
|
2251
2312
|
{
|
|
2252
|
-
locationId:
|
|
2253
|
-
limit:
|
|
2254
|
-
offset:
|
|
2313
|
+
locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2314
|
+
limit: import_zod11.z.number().optional().describe("Max number of funnels to return"),
|
|
2315
|
+
offset: import_zod11.z.number().optional().describe("Offset for pagination")
|
|
2255
2316
|
},
|
|
2256
2317
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
2257
2318
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2266,10 +2327,10 @@ function registerFunnelTools(server2, client) {
|
|
|
2266
2327
|
"get_funnel_pages",
|
|
2267
2328
|
"List pages for a specific funnel. Offset-based pagination via limit/offset.",
|
|
2268
2329
|
{
|
|
2269
|
-
locationId:
|
|
2270
|
-
funnelId:
|
|
2271
|
-
limit:
|
|
2272
|
-
offset:
|
|
2330
|
+
locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2331
|
+
funnelId: import_zod11.z.string().describe("The funnel ID"),
|
|
2332
|
+
limit: import_zod11.z.number().optional().describe("Max number of pages to return"),
|
|
2333
|
+
offset: import_zod11.z.number().optional().describe("Offset for pagination")
|
|
2273
2334
|
},
|
|
2274
2335
|
async ({ locationId: locationId2, funnelId, limit, offset }) => {
|
|
2275
2336
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2285,17 +2346,17 @@ function registerFunnelTools(server2, client) {
|
|
|
2285
2346
|
}
|
|
2286
2347
|
|
|
2287
2348
|
// src/tools/forms.ts
|
|
2288
|
-
var
|
|
2349
|
+
var import_zod12 = require("zod");
|
|
2289
2350
|
function registerFormTools(server2, client) {
|
|
2290
2351
|
safeTool(
|
|
2291
2352
|
server2,
|
|
2292
2353
|
"get_forms",
|
|
2293
2354
|
"List forms for a location",
|
|
2294
2355
|
{
|
|
2295
|
-
locationId:
|
|
2296
|
-
limit:
|
|
2297
|
-
skip:
|
|
2298
|
-
type:
|
|
2356
|
+
locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2357
|
+
limit: import_zod12.z.number().optional().describe("Max number of forms to return"),
|
|
2358
|
+
skip: import_zod12.z.number().optional().describe("Number of forms to skip"),
|
|
2359
|
+
type: import_zod12.z.string().optional().describe("Filter by form type")
|
|
2299
2360
|
},
|
|
2300
2361
|
async ({ locationId: locationId2, limit, skip, type }) => {
|
|
2301
2362
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2311,13 +2372,13 @@ function registerFormTools(server2, client) {
|
|
|
2311
2372
|
"get_form_submissions",
|
|
2312
2373
|
"List form submissions for a location. Page-based pagination via page/limit (page starts at 1).",
|
|
2313
2374
|
{
|
|
2314
|
-
locationId:
|
|
2315
|
-
page:
|
|
2316
|
-
limit:
|
|
2317
|
-
formId:
|
|
2318
|
-
q:
|
|
2319
|
-
startAt:
|
|
2320
|
-
endAt:
|
|
2375
|
+
locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2376
|
+
page: import_zod12.z.number().optional().describe("Page number for pagination"),
|
|
2377
|
+
limit: import_zod12.z.number().optional().describe("Max number of submissions to return"),
|
|
2378
|
+
formId: import_zod12.z.string().optional().describe("Filter by specific form ID"),
|
|
2379
|
+
q: import_zod12.z.string().optional().describe("Search query"),
|
|
2380
|
+
startAt: import_zod12.z.string().optional().describe("Start date filter (ISO string)"),
|
|
2381
|
+
endAt: import_zod12.z.string().optional().describe("End date filter (ISO string)")
|
|
2321
2382
|
},
|
|
2322
2383
|
async ({ locationId: locationId2, page, limit, formId, q, startAt, endAt }) => {
|
|
2323
2384
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2334,16 +2395,16 @@ function registerFormTools(server2, client) {
|
|
|
2334
2395
|
}
|
|
2335
2396
|
|
|
2336
2397
|
// src/tools/surveys.ts
|
|
2337
|
-
var
|
|
2398
|
+
var import_zod13 = require("zod");
|
|
2338
2399
|
function registerSurveyTools(server2, client) {
|
|
2339
2400
|
safeTool(
|
|
2340
2401
|
server2,
|
|
2341
2402
|
"get_surveys",
|
|
2342
2403
|
"List surveys for a location",
|
|
2343
2404
|
{
|
|
2344
|
-
locationId:
|
|
2345
|
-
limit:
|
|
2346
|
-
skip:
|
|
2405
|
+
locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2406
|
+
limit: import_zod13.z.number().optional().describe("Max number of surveys to return"),
|
|
2407
|
+
skip: import_zod13.z.number().optional().describe("Number of surveys to skip")
|
|
2347
2408
|
},
|
|
2348
2409
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2349
2410
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2358,13 +2419,13 @@ function registerSurveyTools(server2, client) {
|
|
|
2358
2419
|
"get_survey_submissions",
|
|
2359
2420
|
"List survey submissions for a location. Page-based pagination via page/limit (page starts at 1).",
|
|
2360
2421
|
{
|
|
2361
|
-
locationId:
|
|
2362
|
-
page:
|
|
2363
|
-
limit:
|
|
2364
|
-
surveyId:
|
|
2365
|
-
q:
|
|
2366
|
-
startAt:
|
|
2367
|
-
endAt:
|
|
2422
|
+
locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2423
|
+
page: import_zod13.z.number().optional().describe("Page number for pagination"),
|
|
2424
|
+
limit: import_zod13.z.number().optional().describe("Max number of submissions to return"),
|
|
2425
|
+
surveyId: import_zod13.z.string().optional().describe("Filter by specific survey ID"),
|
|
2426
|
+
q: import_zod13.z.string().optional().describe("Search query"),
|
|
2427
|
+
startAt: import_zod13.z.string().optional().describe("Start date filter (ISO string)"),
|
|
2428
|
+
endAt: import_zod13.z.string().optional().describe("End date filter (ISO string)")
|
|
2368
2429
|
},
|
|
2369
2430
|
async ({ locationId: locationId2, page, limit, surveyId, q, startAt, endAt }) => {
|
|
2370
2431
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2381,22 +2442,22 @@ function registerSurveyTools(server2, client) {
|
|
|
2381
2442
|
}
|
|
2382
2443
|
|
|
2383
2444
|
// src/tools/payments.ts
|
|
2384
|
-
var
|
|
2445
|
+
var import_zod14 = require("zod");
|
|
2385
2446
|
function registerPaymentTools(server2, client) {
|
|
2386
2447
|
safeTool(
|
|
2387
2448
|
server2,
|
|
2388
2449
|
"get_orders",
|
|
2389
2450
|
"List orders for a location. Offset-based pagination via limit/offset.",
|
|
2390
2451
|
{
|
|
2391
|
-
locationId:
|
|
2392
|
-
limit:
|
|
2393
|
-
offset:
|
|
2394
|
-
startAt:
|
|
2395
|
-
endAt:
|
|
2396
|
-
search:
|
|
2397
|
-
contactId:
|
|
2398
|
-
paymentMode:
|
|
2399
|
-
status:
|
|
2452
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2453
|
+
limit: import_zod14.z.number().optional().describe("Max number of orders to return"),
|
|
2454
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2455
|
+
startAt: import_zod14.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2456
|
+
endAt: import_zod14.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2457
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2458
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2459
|
+
paymentMode: import_zod14.z.string().optional().describe("Filter by payment mode"),
|
|
2460
|
+
status: import_zod14.z.string().optional().describe("Filter by order status")
|
|
2400
2461
|
},
|
|
2401
2462
|
async ({ locationId: locationId2, limit, offset, startAt, endAt, search, contactId, paymentMode, status }) => {
|
|
2402
2463
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2421,8 +2482,8 @@ function registerPaymentTools(server2, client) {
|
|
|
2421
2482
|
"get_order",
|
|
2422
2483
|
"Get a specific order by ID",
|
|
2423
2484
|
{
|
|
2424
|
-
locationId:
|
|
2425
|
-
orderId:
|
|
2485
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2486
|
+
orderId: import_zod14.z.string().describe("The order ID")
|
|
2426
2487
|
},
|
|
2427
2488
|
async ({ locationId: locationId2, orderId }) => {
|
|
2428
2489
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2438,12 +2499,12 @@ function registerPaymentTools(server2, client) {
|
|
|
2438
2499
|
"get_subscriptions",
|
|
2439
2500
|
"List subscriptions for a location. Offset-based pagination via limit/offset.",
|
|
2440
2501
|
{
|
|
2441
|
-
locationId:
|
|
2442
|
-
limit:
|
|
2443
|
-
offset:
|
|
2444
|
-
search:
|
|
2445
|
-
contactId:
|
|
2446
|
-
entityId:
|
|
2502
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2503
|
+
limit: import_zod14.z.number().optional().describe("Max number of subscriptions to return"),
|
|
2504
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2505
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2506
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2507
|
+
entityId: import_zod14.z.string().optional().describe("Filter by entity ID")
|
|
2447
2508
|
},
|
|
2448
2509
|
async ({ locationId: locationId2, limit, offset, search, contactId, entityId }) => {
|
|
2449
2510
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2464,16 +2525,16 @@ function registerPaymentTools(server2, client) {
|
|
|
2464
2525
|
"get_transactions",
|
|
2465
2526
|
"List transactions for a location. Offset-based pagination via limit/offset.",
|
|
2466
2527
|
{
|
|
2467
|
-
locationId:
|
|
2468
|
-
limit:
|
|
2469
|
-
offset:
|
|
2470
|
-
startAt:
|
|
2471
|
-
endAt:
|
|
2472
|
-
search:
|
|
2473
|
-
entityId:
|
|
2474
|
-
paymentMode:
|
|
2475
|
-
contactId:
|
|
2476
|
-
subscriptionId:
|
|
2528
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2529
|
+
limit: import_zod14.z.number().optional().describe("Max number of transactions to return"),
|
|
2530
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2531
|
+
startAt: import_zod14.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2532
|
+
endAt: import_zod14.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2533
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2534
|
+
entityId: import_zod14.z.string().optional().describe("Filter by entity ID"),
|
|
2535
|
+
paymentMode: import_zod14.z.string().optional().describe("Filter by payment mode"),
|
|
2536
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2537
|
+
subscriptionId: import_zod14.z.string().optional().describe("Filter by subscription ID")
|
|
2477
2538
|
},
|
|
2478
2539
|
async ({ locationId: locationId2, limit, offset, startAt, endAt, search, entityId, paymentMode, contactId, subscriptionId }) => {
|
|
2479
2540
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2496,21 +2557,21 @@ function registerPaymentTools(server2, client) {
|
|
|
2496
2557
|
}
|
|
2497
2558
|
|
|
2498
2559
|
// src/tools/invoices.ts
|
|
2499
|
-
var
|
|
2560
|
+
var import_zod15 = require("zod");
|
|
2500
2561
|
function registerInvoiceTools(server2, client) {
|
|
2501
2562
|
safeTool(
|
|
2502
2563
|
server2,
|
|
2503
2564
|
"list_invoices",
|
|
2504
2565
|
"List invoices for a location. Offset-based pagination via limit/offset.",
|
|
2505
2566
|
{
|
|
2506
|
-
locationId:
|
|
2507
|
-
limit:
|
|
2508
|
-
offset:
|
|
2509
|
-
status:
|
|
2510
|
-
contactId:
|
|
2511
|
-
startAt:
|
|
2512
|
-
endAt:
|
|
2513
|
-
search:
|
|
2567
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2568
|
+
limit: import_zod15.z.number().optional().describe("Max number of invoices to return"),
|
|
2569
|
+
offset: import_zod15.z.number().optional().describe("Offset for pagination"),
|
|
2570
|
+
status: import_zod15.z.enum(["draft", "sent", "paid", "void", "partially_paid"]).optional().describe("Filter by invoice status"),
|
|
2571
|
+
contactId: import_zod15.z.string().optional().describe("Filter by contact ID"),
|
|
2572
|
+
startAt: import_zod15.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2573
|
+
endAt: import_zod15.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2574
|
+
search: import_zod15.z.string().optional().describe("Search term")
|
|
2514
2575
|
},
|
|
2515
2576
|
async ({ locationId: locationId2, limit, offset, status, contactId, startAt, endAt, search }) => {
|
|
2516
2577
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2534,8 +2595,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2534
2595
|
"get_invoice",
|
|
2535
2596
|
"Get a specific invoice by ID",
|
|
2536
2597
|
{
|
|
2537
|
-
locationId:
|
|
2538
|
-
invoiceId:
|
|
2598
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2599
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID")
|
|
2539
2600
|
},
|
|
2540
2601
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2541
2602
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2551,22 +2612,22 @@ function registerInvoiceTools(server2, client) {
|
|
|
2551
2612
|
"create_invoice",
|
|
2552
2613
|
"Create a new invoice",
|
|
2553
2614
|
{
|
|
2554
|
-
locationId:
|
|
2555
|
-
name:
|
|
2556
|
-
contactId:
|
|
2557
|
-
items:
|
|
2558
|
-
name:
|
|
2559
|
-
description:
|
|
2560
|
-
quantity:
|
|
2561
|
-
price:
|
|
2562
|
-
currency:
|
|
2615
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2616
|
+
name: import_zod15.z.string().describe("Invoice name"),
|
|
2617
|
+
contactId: import_zod15.z.string().describe("Contact ID for the invoice"),
|
|
2618
|
+
items: import_zod15.z.array(import_zod15.z.object({
|
|
2619
|
+
name: import_zod15.z.string().describe("Item name"),
|
|
2620
|
+
description: import_zod15.z.string().describe("Item description"),
|
|
2621
|
+
quantity: import_zod15.z.number().describe("Item quantity"),
|
|
2622
|
+
price: import_zod15.z.number().describe("Item price"),
|
|
2623
|
+
currency: import_zod15.z.string().describe("Currency code (e.g. USD)")
|
|
2563
2624
|
})).describe("Invoice line items"),
|
|
2564
|
-
discount:
|
|
2565
|
-
type:
|
|
2566
|
-
value:
|
|
2625
|
+
discount: import_zod15.z.object({
|
|
2626
|
+
type: import_zod15.z.string().optional(),
|
|
2627
|
+
value: import_zod15.z.number().optional()
|
|
2567
2628
|
}).optional().describe("Discount to apply"),
|
|
2568
|
-
termsNotes:
|
|
2569
|
-
title:
|
|
2629
|
+
termsNotes: import_zod15.z.string().optional().describe("Terms and notes for the invoice"),
|
|
2630
|
+
title: import_zod15.z.string().optional().describe("Invoice title")
|
|
2570
2631
|
},
|
|
2571
2632
|
async ({ locationId: locationId2, name, contactId, items, discount, termsNotes, title }) => {
|
|
2572
2633
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2588,22 +2649,22 @@ function registerInvoiceTools(server2, client) {
|
|
|
2588
2649
|
"update_invoice",
|
|
2589
2650
|
"Update an existing invoice",
|
|
2590
2651
|
{
|
|
2591
|
-
locationId:
|
|
2592
|
-
invoiceId:
|
|
2593
|
-
name:
|
|
2594
|
-
items:
|
|
2595
|
-
name:
|
|
2596
|
-
description:
|
|
2597
|
-
quantity:
|
|
2598
|
-
price:
|
|
2599
|
-
currency:
|
|
2652
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2653
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to update"),
|
|
2654
|
+
name: import_zod15.z.string().optional().describe("Invoice name"),
|
|
2655
|
+
items: import_zod15.z.array(import_zod15.z.object({
|
|
2656
|
+
name: import_zod15.z.string().describe("Item name"),
|
|
2657
|
+
description: import_zod15.z.string().describe("Item description"),
|
|
2658
|
+
quantity: import_zod15.z.number().describe("Item quantity"),
|
|
2659
|
+
price: import_zod15.z.number().describe("Item price"),
|
|
2660
|
+
currency: import_zod15.z.string().describe("Currency code (e.g. USD)")
|
|
2600
2661
|
})).optional().describe("Invoice line items"),
|
|
2601
|
-
discount:
|
|
2602
|
-
type:
|
|
2603
|
-
value:
|
|
2662
|
+
discount: import_zod15.z.object({
|
|
2663
|
+
type: import_zod15.z.string().optional(),
|
|
2664
|
+
value: import_zod15.z.number().optional()
|
|
2604
2665
|
}).optional().describe("Discount to apply"),
|
|
2605
|
-
termsNotes:
|
|
2606
|
-
title:
|
|
2666
|
+
termsNotes: import_zod15.z.string().optional().describe("Terms and notes for the invoice"),
|
|
2667
|
+
title: import_zod15.z.string().optional().describe("Invoice title")
|
|
2607
2668
|
},
|
|
2608
2669
|
async ({ locationId: locationId2, invoiceId, name, items, discount, termsNotes, title }) => {
|
|
2609
2670
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2624,8 +2685,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2624
2685
|
"delete_invoice",
|
|
2625
2686
|
"Delete an invoice",
|
|
2626
2687
|
{
|
|
2627
|
-
locationId:
|
|
2628
|
-
invoiceId:
|
|
2688
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2689
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to delete")
|
|
2629
2690
|
},
|
|
2630
2691
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2631
2692
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2641,8 +2702,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2641
2702
|
"send_invoice",
|
|
2642
2703
|
"Send an invoice to the contact",
|
|
2643
2704
|
{
|
|
2644
|
-
locationId:
|
|
2645
|
-
invoiceId:
|
|
2705
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2706
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to send")
|
|
2646
2707
|
},
|
|
2647
2708
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2648
2709
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2658,8 +2719,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2658
2719
|
"void_invoice",
|
|
2659
2720
|
"Void an invoice",
|
|
2660
2721
|
{
|
|
2661
|
-
locationId:
|
|
2662
|
-
invoiceId:
|
|
2722
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2723
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to void")
|
|
2663
2724
|
},
|
|
2664
2725
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2665
2726
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2675,11 +2736,11 @@ function registerInvoiceTools(server2, client) {
|
|
|
2675
2736
|
"record_invoice_payment",
|
|
2676
2737
|
"Record a manual payment for an invoice",
|
|
2677
2738
|
{
|
|
2678
|
-
locationId:
|
|
2679
|
-
invoiceId:
|
|
2680
|
-
amount:
|
|
2681
|
-
mode:
|
|
2682
|
-
notes:
|
|
2739
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2740
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID"),
|
|
2741
|
+
amount: import_zod15.z.number().describe("Payment amount"),
|
|
2742
|
+
mode: import_zod15.z.enum(["cash", "cheque", "bank_transfer", "other"]).describe("Payment mode"),
|
|
2743
|
+
notes: import_zod15.z.string().optional().describe("Payment notes")
|
|
2683
2744
|
},
|
|
2684
2745
|
async ({ locationId: locationId2, invoiceId, amount, mode, notes }) => {
|
|
2685
2746
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2696,15 +2757,15 @@ function registerInvoiceTools(server2, client) {
|
|
|
2696
2757
|
}
|
|
2697
2758
|
|
|
2698
2759
|
// src/tools/campaigns.ts
|
|
2699
|
-
var
|
|
2760
|
+
var import_zod16 = require("zod");
|
|
2700
2761
|
function registerCampaignTools(server2, client) {
|
|
2701
2762
|
safeTool(
|
|
2702
2763
|
server2,
|
|
2703
2764
|
"get_campaigns",
|
|
2704
2765
|
"List campaigns for a location",
|
|
2705
2766
|
{
|
|
2706
|
-
locationId:
|
|
2707
|
-
status:
|
|
2767
|
+
locationId: import_zod16.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2768
|
+
status: import_zod16.z.string().optional().describe("Filter by campaign status")
|
|
2708
2769
|
},
|
|
2709
2770
|
async ({ locationId: locationId2, status }) => {
|
|
2710
2771
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2716,16 +2777,16 @@ function registerCampaignTools(server2, client) {
|
|
|
2716
2777
|
}
|
|
2717
2778
|
|
|
2718
2779
|
// src/tools/users.ts
|
|
2719
|
-
var
|
|
2780
|
+
var import_zod17 = require("zod");
|
|
2720
2781
|
function registerUserTools(server2, client) {
|
|
2721
2782
|
safeTool(
|
|
2722
2783
|
server2,
|
|
2723
2784
|
"get_users",
|
|
2724
2785
|
"List users for a location",
|
|
2725
2786
|
{
|
|
2726
|
-
locationId:
|
|
2727
|
-
limit:
|
|
2728
|
-
skip:
|
|
2787
|
+
locationId: import_zod17.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2788
|
+
limit: import_zod17.z.number().optional().describe("Max number of users to return"),
|
|
2789
|
+
skip: import_zod17.z.number().optional().describe("Number of users to skip")
|
|
2729
2790
|
},
|
|
2730
2791
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2731
2792
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2740,7 +2801,7 @@ function registerUserTools(server2, client) {
|
|
|
2740
2801
|
"get_user",
|
|
2741
2802
|
"Get a single user by ID",
|
|
2742
2803
|
{
|
|
2743
|
-
userId:
|
|
2804
|
+
userId: import_zod17.z.string().describe("The user ID")
|
|
2744
2805
|
},
|
|
2745
2806
|
async ({ userId }) => {
|
|
2746
2807
|
return client.get(`/users/${userId}`);
|
|
@@ -2749,19 +2810,19 @@ function registerUserTools(server2, client) {
|
|
|
2749
2810
|
}
|
|
2750
2811
|
|
|
2751
2812
|
// src/tools/media.ts
|
|
2752
|
-
var
|
|
2813
|
+
var import_zod18 = require("zod");
|
|
2753
2814
|
function registerMediaTools(server2, client) {
|
|
2754
2815
|
safeTool(
|
|
2755
2816
|
server2,
|
|
2756
2817
|
"get_media_files",
|
|
2757
2818
|
"List media files for a location",
|
|
2758
2819
|
{
|
|
2759
|
-
locationId:
|
|
2760
|
-
sortBy:
|
|
2761
|
-
sortOrder:
|
|
2762
|
-
limit:
|
|
2763
|
-
offset:
|
|
2764
|
-
query:
|
|
2820
|
+
locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2821
|
+
sortBy: import_zod18.z.string().optional().describe("Field to sort by"),
|
|
2822
|
+
sortOrder: import_zod18.z.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
2823
|
+
limit: import_zod18.z.number().optional().describe("Max number of files to return"),
|
|
2824
|
+
offset: import_zod18.z.number().optional().describe("Number of files to skip"),
|
|
2825
|
+
query: import_zod18.z.string().optional().describe("Search query to filter files")
|
|
2765
2826
|
},
|
|
2766
2827
|
async ({ locationId: locationId2, sortBy, sortOrder, limit, offset, query }) => {
|
|
2767
2828
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2779,8 +2840,8 @@ function registerMediaTools(server2, client) {
|
|
|
2779
2840
|
"delete_media_file",
|
|
2780
2841
|
"Delete a media file",
|
|
2781
2842
|
{
|
|
2782
|
-
mediaId:
|
|
2783
|
-
locationId:
|
|
2843
|
+
mediaId: import_zod18.z.string().describe("The media file ID to delete"),
|
|
2844
|
+
locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2784
2845
|
},
|
|
2785
2846
|
async ({ mediaId, locationId: locationId2 }) => {
|
|
2786
2847
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2792,20 +2853,20 @@ function registerMediaTools(server2, client) {
|
|
|
2792
2853
|
}
|
|
2793
2854
|
|
|
2794
2855
|
// src/tools/social-planner.ts
|
|
2795
|
-
var
|
|
2856
|
+
var import_zod19 = require("zod");
|
|
2796
2857
|
function registerSocialPlannerTools(server2, client) {
|
|
2797
2858
|
safeTool(
|
|
2798
2859
|
server2,
|
|
2799
2860
|
"get_social_posts",
|
|
2800
2861
|
"List social media posts for a location",
|
|
2801
2862
|
{
|
|
2802
|
-
locationId:
|
|
2803
|
-
type:
|
|
2804
|
-
accounts:
|
|
2805
|
-
fromDate:
|
|
2806
|
-
toDate:
|
|
2807
|
-
includeUsers:
|
|
2808
|
-
status:
|
|
2863
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2864
|
+
type: import_zod19.z.enum(["post", "story", "reel"]).optional().describe("Post type filter"),
|
|
2865
|
+
accounts: import_zod19.z.string().optional().describe("Comma-separated account IDs to filter by"),
|
|
2866
|
+
fromDate: import_zod19.z.string().optional().describe("Start date filter (ISO string)"),
|
|
2867
|
+
toDate: import_zod19.z.string().optional().describe("End date filter (ISO string)"),
|
|
2868
|
+
includeUsers: import_zod19.z.boolean().optional().describe("Whether to include user details"),
|
|
2869
|
+
status: import_zod19.z.enum(["in_review", "scheduled", "published", "failed", "in_progress"]).optional().describe("Post status filter")
|
|
2809
2870
|
},
|
|
2810
2871
|
async ({ locationId: locationId2, type, accounts, fromDate, toDate, includeUsers, status }) => {
|
|
2811
2872
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2824,7 +2885,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2824
2885
|
"get_social_post",
|
|
2825
2886
|
"Get a single social media post by ID",
|
|
2826
2887
|
{
|
|
2827
|
-
postId:
|
|
2888
|
+
postId: import_zod19.z.string().describe("The social media post ID")
|
|
2828
2889
|
},
|
|
2829
2890
|
async ({ postId }) => {
|
|
2830
2891
|
return client.get(`/social-media-posting/${postId}`);
|
|
@@ -2835,7 +2896,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2835
2896
|
"delete_social_post",
|
|
2836
2897
|
"Delete a social media post",
|
|
2837
2898
|
{
|
|
2838
|
-
postId:
|
|
2899
|
+
postId: import_zod19.z.string().describe("The social media post ID to delete")
|
|
2839
2900
|
},
|
|
2840
2901
|
async ({ postId }) => {
|
|
2841
2902
|
return client.delete(`/social-media-posting/${postId}`);
|
|
@@ -2845,7 +2906,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2845
2906
|
"get_social_media_accounts",
|
|
2846
2907
|
"Get connected social media accounts for a location",
|
|
2847
2908
|
{
|
|
2848
|
-
locationId:
|
|
2909
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2849
2910
|
},
|
|
2850
2911
|
async ({ locationId: locationId2 }) => {
|
|
2851
2912
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2871,17 +2932,17 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2871
2932
|
"create_social_post",
|
|
2872
2933
|
"Create a new social media post",
|
|
2873
2934
|
{
|
|
2874
|
-
locationId:
|
|
2875
|
-
accountIds:
|
|
2876
|
-
summary:
|
|
2877
|
-
media:
|
|
2878
|
-
status:
|
|
2879
|
-
scheduledAt:
|
|
2880
|
-
tags:
|
|
2881
|
-
ogData:
|
|
2882
|
-
title:
|
|
2883
|
-
description:
|
|
2884
|
-
image:
|
|
2935
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2936
|
+
accountIds: import_zod19.z.array(import_zod19.z.string()).describe("Array of social account IDs to post to"),
|
|
2937
|
+
summary: import_zod19.z.string().optional().describe("The post text/caption"),
|
|
2938
|
+
media: import_zod19.z.array(import_zod19.z.string()).optional().describe("Array of media URLs to attach"),
|
|
2939
|
+
status: import_zod19.z.enum(["in_review", "scheduled", "draft"]).optional().describe("Post status"),
|
|
2940
|
+
scheduledAt: import_zod19.z.string().optional().describe("Scheduled publish time (ISO string)"),
|
|
2941
|
+
tags: import_zod19.z.array(import_zod19.z.string()).optional().describe("Tags for the post"),
|
|
2942
|
+
ogData: import_zod19.z.object({
|
|
2943
|
+
title: import_zod19.z.string().optional(),
|
|
2944
|
+
description: import_zod19.z.string().optional(),
|
|
2945
|
+
image: import_zod19.z.string().optional()
|
|
2885
2946
|
}).optional().describe("Open Graph data for link previews")
|
|
2886
2947
|
},
|
|
2887
2948
|
async ({ locationId: locationId2, accountIds, summary, media, status, scheduledAt, tags, ogData }) => {
|
|
@@ -2899,16 +2960,16 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2899
2960
|
}
|
|
2900
2961
|
|
|
2901
2962
|
// src/tools/courses.ts
|
|
2902
|
-
var
|
|
2963
|
+
var import_zod20 = require("zod");
|
|
2903
2964
|
function registerCourseTools(server2, client) {
|
|
2904
2965
|
safeTool(
|
|
2905
2966
|
server2,
|
|
2906
2967
|
"get_courses",
|
|
2907
2968
|
"List courses for a location",
|
|
2908
2969
|
{
|
|
2909
|
-
locationId:
|
|
2910
|
-
limit:
|
|
2911
|
-
offset:
|
|
2970
|
+
locationId: import_zod20.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2971
|
+
limit: import_zod20.z.number().optional().describe("Max number of courses to return"),
|
|
2972
|
+
offset: import_zod20.z.number().optional().describe("Number of courses to skip")
|
|
2912
2973
|
},
|
|
2913
2974
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
2914
2975
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2921,14 +2982,14 @@ function registerCourseTools(server2, client) {
|
|
|
2921
2982
|
}
|
|
2922
2983
|
|
|
2923
2984
|
// src/tools/businesses.ts
|
|
2924
|
-
var
|
|
2985
|
+
var import_zod21 = require("zod");
|
|
2925
2986
|
function registerBusinessTools(server2, client) {
|
|
2926
2987
|
safeTool(
|
|
2927
2988
|
server2,
|
|
2928
2989
|
"get_businesses",
|
|
2929
2990
|
"List businesses for a location",
|
|
2930
2991
|
{
|
|
2931
|
-
locationId:
|
|
2992
|
+
locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2932
2993
|
},
|
|
2933
2994
|
async ({ locationId: locationId2 }) => {
|
|
2934
2995
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2940,7 +3001,7 @@ function registerBusinessTools(server2, client) {
|
|
|
2940
3001
|
"get_business",
|
|
2941
3002
|
"Get a single business by ID",
|
|
2942
3003
|
{
|
|
2943
|
-
businessId:
|
|
3004
|
+
businessId: import_zod21.z.string().describe("The business ID")
|
|
2944
3005
|
},
|
|
2945
3006
|
async ({ businessId }) => {
|
|
2946
3007
|
return client.get(`/businesses/${businessId}`);
|
|
@@ -2951,17 +3012,17 @@ function registerBusinessTools(server2, client) {
|
|
|
2951
3012
|
"create_business",
|
|
2952
3013
|
"Create a new business",
|
|
2953
3014
|
{
|
|
2954
|
-
locationId:
|
|
2955
|
-
name:
|
|
2956
|
-
phone:
|
|
2957
|
-
email:
|
|
2958
|
-
website:
|
|
2959
|
-
address:
|
|
2960
|
-
city:
|
|
2961
|
-
state:
|
|
2962
|
-
postalCode:
|
|
2963
|
-
country:
|
|
2964
|
-
description:
|
|
3015
|
+
locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3016
|
+
name: import_zod21.z.string().describe("Business name"),
|
|
3017
|
+
phone: import_zod21.z.string().optional().describe("Phone number"),
|
|
3018
|
+
email: import_zod21.z.string().optional().describe("Email address"),
|
|
3019
|
+
website: import_zod21.z.string().optional().describe("Website URL"),
|
|
3020
|
+
address: import_zod21.z.string().optional().describe("Street address"),
|
|
3021
|
+
city: import_zod21.z.string().optional().describe("City"),
|
|
3022
|
+
state: import_zod21.z.string().optional().describe("State"),
|
|
3023
|
+
postalCode: import_zod21.z.string().optional().describe("Postal/ZIP code"),
|
|
3024
|
+
country: import_zod21.z.string().optional().describe("Country"),
|
|
3025
|
+
description: import_zod21.z.string().optional().describe("Business description")
|
|
2965
3026
|
},
|
|
2966
3027
|
async ({ locationId: locationId2, name, phone, email, website, address, city, state, postalCode, country, description }) => {
|
|
2967
3028
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2983,17 +3044,17 @@ function registerBusinessTools(server2, client) {
|
|
|
2983
3044
|
"update_business",
|
|
2984
3045
|
"Update an existing business",
|
|
2985
3046
|
{
|
|
2986
|
-
businessId:
|
|
2987
|
-
name:
|
|
2988
|
-
phone:
|
|
2989
|
-
email:
|
|
2990
|
-
website:
|
|
2991
|
-
address:
|
|
2992
|
-
city:
|
|
2993
|
-
state:
|
|
2994
|
-
postalCode:
|
|
2995
|
-
country:
|
|
2996
|
-
description:
|
|
3047
|
+
businessId: import_zod21.z.string().describe("The business ID to update"),
|
|
3048
|
+
name: import_zod21.z.string().optional().describe("Business name"),
|
|
3049
|
+
phone: import_zod21.z.string().optional().describe("Phone number"),
|
|
3050
|
+
email: import_zod21.z.string().optional().describe("Email address"),
|
|
3051
|
+
website: import_zod21.z.string().optional().describe("Website URL"),
|
|
3052
|
+
address: import_zod21.z.string().optional().describe("Street address"),
|
|
3053
|
+
city: import_zod21.z.string().optional().describe("City"),
|
|
3054
|
+
state: import_zod21.z.string().optional().describe("State"),
|
|
3055
|
+
postalCode: import_zod21.z.string().optional().describe("Postal/ZIP code"),
|
|
3056
|
+
country: import_zod21.z.string().optional().describe("Country"),
|
|
3057
|
+
description: import_zod21.z.string().optional().describe("Business description")
|
|
2997
3058
|
},
|
|
2998
3059
|
async ({ businessId, name, phone, email, website, address, city, state, postalCode, country, description }) => {
|
|
2999
3060
|
const body = {};
|
|
@@ -3015,8 +3076,8 @@ function registerBusinessTools(server2, client) {
|
|
|
3015
3076
|
"delete_business",
|
|
3016
3077
|
"Permanently delete a business. IRREVERSIBLE.",
|
|
3017
3078
|
{
|
|
3018
|
-
businessId:
|
|
3019
|
-
confirm:
|
|
3079
|
+
businessId: import_zod21.z.string().describe("The business ID to delete"),
|
|
3080
|
+
confirm: import_zod21.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
3020
3081
|
},
|
|
3021
3082
|
async ({ businessId }) => {
|
|
3022
3083
|
return client.delete(`/businesses/${businessId}`);
|
|
@@ -3025,17 +3086,17 @@ function registerBusinessTools(server2, client) {
|
|
|
3025
3086
|
}
|
|
3026
3087
|
|
|
3027
3088
|
// src/tools/blogs.ts
|
|
3028
|
-
var
|
|
3089
|
+
var import_zod22 = require("zod");
|
|
3029
3090
|
function registerBlogTools(server2, client) {
|
|
3030
3091
|
safeTool(
|
|
3031
3092
|
server2,
|
|
3032
3093
|
"get_blog_posts",
|
|
3033
3094
|
"List blog posts for a location. Offset-based pagination via limit/offset.",
|
|
3034
3095
|
{
|
|
3035
|
-
locationId:
|
|
3036
|
-
limit:
|
|
3037
|
-
offset:
|
|
3038
|
-
status:
|
|
3096
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3097
|
+
limit: import_zod22.z.number().optional().describe("Number of posts to return"),
|
|
3098
|
+
offset: import_zod22.z.number().optional().describe("Offset for pagination"),
|
|
3099
|
+
status: import_zod22.z.enum(["published", "draft", "archived"]).optional().describe("Filter by post status")
|
|
3039
3100
|
},
|
|
3040
3101
|
async ({ locationId: locationId2, limit, offset, status }) => {
|
|
3041
3102
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3053,8 +3114,8 @@ function registerBlogTools(server2, client) {
|
|
|
3053
3114
|
"get_blog_post",
|
|
3054
3115
|
"Get a specific blog post by ID",
|
|
3055
3116
|
{
|
|
3056
|
-
blogId:
|
|
3057
|
-
postId:
|
|
3117
|
+
blogId: import_zod22.z.string().describe("Blog ID"),
|
|
3118
|
+
postId: import_zod22.z.string().describe("Post ID")
|
|
3058
3119
|
},
|
|
3059
3120
|
async ({ blogId, postId }) => {
|
|
3060
3121
|
return client.get(`/blogs/${blogId}/posts/${postId}`, {});
|
|
@@ -3065,7 +3126,7 @@ function registerBlogTools(server2, client) {
|
|
|
3065
3126
|
"get_blog_authors",
|
|
3066
3127
|
"List blog authors for a location",
|
|
3067
3128
|
{
|
|
3068
|
-
locationId:
|
|
3129
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3069
3130
|
},
|
|
3070
3131
|
async ({ locationId: locationId2 }) => {
|
|
3071
3132
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3079,7 +3140,7 @@ function registerBlogTools(server2, client) {
|
|
|
3079
3140
|
"get_blog_categories",
|
|
3080
3141
|
"List blog categories for a location",
|
|
3081
3142
|
{
|
|
3082
|
-
locationId:
|
|
3143
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3083
3144
|
},
|
|
3084
3145
|
async ({ locationId: locationId2 }) => {
|
|
3085
3146
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3093,8 +3154,8 @@ function registerBlogTools(server2, client) {
|
|
|
3093
3154
|
"check_blog_slug",
|
|
3094
3155
|
"Check if a blog post URL slug already exists",
|
|
3095
3156
|
{
|
|
3096
|
-
locationId:
|
|
3097
|
-
urlSlug:
|
|
3157
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3158
|
+
urlSlug: import_zod22.z.string().describe("URL slug to check")
|
|
3098
3159
|
},
|
|
3099
3160
|
async ({ locationId: locationId2, urlSlug }) => {
|
|
3100
3161
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3106,14 +3167,14 @@ function registerBlogTools(server2, client) {
|
|
|
3106
3167
|
}
|
|
3107
3168
|
|
|
3108
3169
|
// src/tools/emails.ts
|
|
3109
|
-
var
|
|
3170
|
+
var import_zod23 = require("zod");
|
|
3110
3171
|
function registerEmailTools(server2, client) {
|
|
3111
3172
|
safeTool(
|
|
3112
3173
|
server2,
|
|
3113
3174
|
"get_email_campaigns",
|
|
3114
3175
|
"List email campaigns for a location",
|
|
3115
3176
|
{
|
|
3116
|
-
locationId:
|
|
3177
|
+
locationId: import_zod23.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3117
3178
|
},
|
|
3118
3179
|
async ({ locationId: locationId2 }) => {
|
|
3119
3180
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3125,14 +3186,14 @@ function registerEmailTools(server2, client) {
|
|
|
3125
3186
|
}
|
|
3126
3187
|
|
|
3127
3188
|
// src/tools/trigger-links.ts
|
|
3128
|
-
var
|
|
3189
|
+
var import_zod24 = require("zod");
|
|
3129
3190
|
function registerTriggerLinkTools(server2, client) {
|
|
3130
3191
|
safeTool(
|
|
3131
3192
|
server2,
|
|
3132
3193
|
"get_trigger_links",
|
|
3133
3194
|
"List trigger links for a location",
|
|
3134
3195
|
{
|
|
3135
|
-
locationId:
|
|
3196
|
+
locationId: import_zod24.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3136
3197
|
},
|
|
3137
3198
|
async ({ locationId: locationId2 }) => {
|
|
3138
3199
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3144,14 +3205,14 @@ function registerTriggerLinkTools(server2, client) {
|
|
|
3144
3205
|
}
|
|
3145
3206
|
|
|
3146
3207
|
// src/tools/custom-objects.ts
|
|
3147
|
-
var
|
|
3208
|
+
var import_zod25 = require("zod");
|
|
3148
3209
|
function registerCustomObjectTools(server2, client) {
|
|
3149
3210
|
safeTool(
|
|
3150
3211
|
server2,
|
|
3151
3212
|
"list_custom_objects",
|
|
3152
3213
|
"List all custom object schemas defined in a GHL location.",
|
|
3153
3214
|
{
|
|
3154
|
-
locationId:
|
|
3215
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3155
3216
|
},
|
|
3156
3217
|
async ({ locationId: locationId2 }) => {
|
|
3157
3218
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3165,8 +3226,8 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3165
3226
|
"get_custom_object",
|
|
3166
3227
|
"Retrieve a single custom object schema by its key.",
|
|
3167
3228
|
{
|
|
3168
|
-
schemaKey:
|
|
3169
|
-
locationId:
|
|
3229
|
+
schemaKey: import_zod25.z.string().describe("The key of the custom object schema to retrieve."),
|
|
3230
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3170
3231
|
},
|
|
3171
3232
|
async ({ schemaKey, locationId: locationId2 }) => {
|
|
3172
3233
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3180,11 +3241,11 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3180
3241
|
"search_custom_object_records",
|
|
3181
3242
|
"Search records of a custom object by schema key. Supports filtering and pagination.",
|
|
3182
3243
|
{
|
|
3183
|
-
schemaKey:
|
|
3184
|
-
locationId:
|
|
3185
|
-
query:
|
|
3186
|
-
limit:
|
|
3187
|
-
offset:
|
|
3244
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3245
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3246
|
+
query: import_zod25.z.string().optional().describe("Search query to filter records."),
|
|
3247
|
+
limit: import_zod25.z.number().optional().describe("Maximum records to return. Defaults to 20."),
|
|
3248
|
+
offset: import_zod25.z.number().optional().describe("Number of records to skip for pagination.")
|
|
3188
3249
|
},
|
|
3189
3250
|
async ({ schemaKey, locationId: locationId2, query, limit, offset }) => {
|
|
3190
3251
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3203,9 +3264,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3203
3264
|
"get_custom_object_record",
|
|
3204
3265
|
"Retrieve a single custom object record by schema key and record ID.",
|
|
3205
3266
|
{
|
|
3206
|
-
schemaKey:
|
|
3207
|
-
recordId:
|
|
3208
|
-
locationId:
|
|
3267
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3268
|
+
recordId: import_zod25.z.string().describe("The record ID to retrieve."),
|
|
3269
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3209
3270
|
},
|
|
3210
3271
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3211
3272
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3219,9 +3280,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3219
3280
|
"create_custom_object_record",
|
|
3220
3281
|
"Create a new record for a custom object.",
|
|
3221
3282
|
{
|
|
3222
|
-
schemaKey:
|
|
3223
|
-
locationId:
|
|
3224
|
-
properties:
|
|
3283
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3284
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3285
|
+
properties: import_zod25.z.record(import_zod25.z.unknown()).describe("Key-value pairs of field values for the new record.")
|
|
3225
3286
|
},
|
|
3226
3287
|
async ({ schemaKey, locationId: locationId2, properties }) => {
|
|
3227
3288
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3235,10 +3296,10 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3235
3296
|
"update_custom_object_record",
|
|
3236
3297
|
"Update an existing custom object record.",
|
|
3237
3298
|
{
|
|
3238
|
-
schemaKey:
|
|
3239
|
-
recordId:
|
|
3240
|
-
locationId:
|
|
3241
|
-
properties:
|
|
3299
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3300
|
+
recordId: import_zod25.z.string().describe("The record ID to update."),
|
|
3301
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3302
|
+
properties: import_zod25.z.record(import_zod25.z.unknown()).describe("Key-value pairs of field values to update.")
|
|
3242
3303
|
},
|
|
3243
3304
|
async ({ schemaKey, recordId, locationId: locationId2, properties }) => {
|
|
3244
3305
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3252,9 +3313,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3252
3313
|
"delete_custom_object_record",
|
|
3253
3314
|
"Delete a custom object record by schema key and record ID.",
|
|
3254
3315
|
{
|
|
3255
|
-
schemaKey:
|
|
3256
|
-
recordId:
|
|
3257
|
-
locationId:
|
|
3316
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3317
|
+
recordId: import_zod25.z.string().describe("The record ID to delete."),
|
|
3318
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3258
3319
|
},
|
|
3259
3320
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3260
3321
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3266,16 +3327,16 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3266
3327
|
}
|
|
3267
3328
|
|
|
3268
3329
|
// src/tools/associations.ts
|
|
3269
|
-
var
|
|
3330
|
+
var import_zod26 = require("zod");
|
|
3270
3331
|
function registerAssociationTools(server2, client) {
|
|
3271
3332
|
safeTool(
|
|
3272
3333
|
server2,
|
|
3273
3334
|
"list_associations",
|
|
3274
3335
|
"List associations for a custom object record \u2014 shows related contacts, opportunities, or other records.",
|
|
3275
3336
|
{
|
|
3276
|
-
schemaKey:
|
|
3277
|
-
recordId:
|
|
3278
|
-
locationId:
|
|
3337
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key."),
|
|
3338
|
+
recordId: import_zod26.z.string().describe("The record ID to list associations for."),
|
|
3339
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3279
3340
|
},
|
|
3280
3341
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3281
3342
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3290,11 +3351,11 @@ function registerAssociationTools(server2, client) {
|
|
|
3290
3351
|
"create_association",
|
|
3291
3352
|
"Create an association between a custom object record and another entity (contact, opportunity, or another custom object record).",
|
|
3292
3353
|
{
|
|
3293
|
-
schemaKey:
|
|
3294
|
-
recordId:
|
|
3295
|
-
locationId:
|
|
3296
|
-
targetEntityType:
|
|
3297
|
-
targetEntityId:
|
|
3354
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key of the source record."),
|
|
3355
|
+
recordId: import_zod26.z.string().describe("The source record ID."),
|
|
3356
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3357
|
+
targetEntityType: import_zod26.z.string().describe("The target entity type (e.g. 'contact', 'opportunity', or a custom object schema key)."),
|
|
3358
|
+
targetEntityId: import_zod26.z.string().describe("The ID of the target entity to associate with.")
|
|
3298
3359
|
},
|
|
3299
3360
|
async ({ schemaKey, recordId, locationId: locationId2, targetEntityType, targetEntityId }) => {
|
|
3300
3361
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3315,10 +3376,10 @@ function registerAssociationTools(server2, client) {
|
|
|
3315
3376
|
"delete_association",
|
|
3316
3377
|
"Remove an association between a custom object record and another entity.",
|
|
3317
3378
|
{
|
|
3318
|
-
schemaKey:
|
|
3319
|
-
recordId:
|
|
3320
|
-
associationId:
|
|
3321
|
-
locationId:
|
|
3379
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key of the source record."),
|
|
3380
|
+
recordId: import_zod26.z.string().describe("The source record ID."),
|
|
3381
|
+
associationId: import_zod26.z.string().describe("The association ID to remove."),
|
|
3382
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3322
3383
|
},
|
|
3323
3384
|
async ({ schemaKey, recordId, associationId, locationId: locationId2 }) => {
|
|
3324
3385
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3331,18 +3392,18 @@ function registerAssociationTools(server2, client) {
|
|
|
3331
3392
|
}
|
|
3332
3393
|
|
|
3333
3394
|
// src/tools/estimates.ts
|
|
3334
|
-
var
|
|
3395
|
+
var import_zod27 = require("zod");
|
|
3335
3396
|
function registerEstimateTools(server2, client) {
|
|
3336
3397
|
safeTool(
|
|
3337
3398
|
server2,
|
|
3338
3399
|
"list_estimates",
|
|
3339
3400
|
"List estimates/quotes in a GHL location. Supports pagination and filtering by status.",
|
|
3340
3401
|
{
|
|
3341
|
-
locationId:
|
|
3342
|
-
status:
|
|
3343
|
-
limit:
|
|
3344
|
-
offset:
|
|
3345
|
-
contactId:
|
|
3402
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3403
|
+
status: import_zod27.z.string().optional().describe("Filter by status (e.g. 'draft', 'sent', 'accepted', 'declined')."),
|
|
3404
|
+
limit: import_zod27.z.number().optional().describe("Maximum estimates to return. Defaults to 20."),
|
|
3405
|
+
offset: import_zod27.z.number().optional().describe("Number of records to skip for pagination."),
|
|
3406
|
+
contactId: import_zod27.z.string().optional().describe("Filter estimates by contact ID.")
|
|
3346
3407
|
},
|
|
3347
3408
|
async ({ locationId: locationId2, status, limit, offset, contactId }) => {
|
|
3348
3409
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3363,8 +3424,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3363
3424
|
"get_estimate",
|
|
3364
3425
|
"Retrieve a single estimate/quote by its ID.",
|
|
3365
3426
|
{
|
|
3366
|
-
estimateId:
|
|
3367
|
-
locationId:
|
|
3427
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to retrieve."),
|
|
3428
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3368
3429
|
},
|
|
3369
3430
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3370
3431
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3378,12 +3439,12 @@ function registerEstimateTools(server2, client) {
|
|
|
3378
3439
|
"create_estimate",
|
|
3379
3440
|
"Create a new estimate/quote for a contact.",
|
|
3380
3441
|
{
|
|
3381
|
-
locationId:
|
|
3382
|
-
contactId:
|
|
3383
|
-
name:
|
|
3384
|
-
title:
|
|
3385
|
-
items:
|
|
3386
|
-
discount:
|
|
3442
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3443
|
+
contactId: import_zod27.z.string().describe("The contact ID this estimate is for."),
|
|
3444
|
+
name: import_zod27.z.string().describe("Estimate name/title."),
|
|
3445
|
+
title: import_zod27.z.string().optional().describe("Display title for the estimate."),
|
|
3446
|
+
items: import_zod27.z.array(import_zod27.z.record(import_zod27.z.unknown())).describe("Line items array. Each item should have name, description, price, qty."),
|
|
3447
|
+
discount: import_zod27.z.record(import_zod27.z.unknown()).optional().describe("Discount object (type, value).")
|
|
3387
3448
|
},
|
|
3388
3449
|
async ({ locationId: locationId2, contactId, name, title, items, discount }) => {
|
|
3389
3450
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3405,12 +3466,12 @@ function registerEstimateTools(server2, client) {
|
|
|
3405
3466
|
"update_estimate",
|
|
3406
3467
|
"Update an existing estimate/quote.",
|
|
3407
3468
|
{
|
|
3408
|
-
estimateId:
|
|
3409
|
-
locationId:
|
|
3410
|
-
name:
|
|
3411
|
-
title:
|
|
3412
|
-
items:
|
|
3413
|
-
discount:
|
|
3469
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to update."),
|
|
3470
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3471
|
+
name: import_zod27.z.string().optional().describe("Updated estimate name."),
|
|
3472
|
+
title: import_zod27.z.string().optional().describe("Updated display title."),
|
|
3473
|
+
items: import_zod27.z.array(import_zod27.z.record(import_zod27.z.unknown())).optional().describe("Updated line items array."),
|
|
3474
|
+
discount: import_zod27.z.record(import_zod27.z.unknown()).optional().describe("Updated discount object.")
|
|
3414
3475
|
},
|
|
3415
3476
|
async ({ estimateId, locationId: locationId2, name, title, items, discount }) => {
|
|
3416
3477
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3430,8 +3491,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3430
3491
|
"delete_estimate",
|
|
3431
3492
|
"Delete an estimate/quote by ID.",
|
|
3432
3493
|
{
|
|
3433
|
-
estimateId:
|
|
3434
|
-
locationId:
|
|
3494
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to delete."),
|
|
3495
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3435
3496
|
},
|
|
3436
3497
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3437
3498
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3445,8 +3506,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3445
3506
|
"send_estimate",
|
|
3446
3507
|
"Send an estimate to the contact via email.",
|
|
3447
3508
|
{
|
|
3448
|
-
estimateId:
|
|
3449
|
-
locationId:
|
|
3509
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to send."),
|
|
3510
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3450
3511
|
},
|
|
3451
3512
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3452
3513
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3458,14 +3519,14 @@ function registerEstimateTools(server2, client) {
|
|
|
3458
3519
|
}
|
|
3459
3520
|
|
|
3460
3521
|
// src/tools/coupons.ts
|
|
3461
|
-
var
|
|
3522
|
+
var import_zod28 = require("zod");
|
|
3462
3523
|
function registerCouponTools(server2, client) {
|
|
3463
3524
|
safeTool(
|
|
3464
3525
|
server2,
|
|
3465
3526
|
"list_coupons",
|
|
3466
3527
|
"List coupons/promo codes in a GHL location.",
|
|
3467
3528
|
{
|
|
3468
|
-
locationId:
|
|
3529
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3469
3530
|
},
|
|
3470
3531
|
async ({ locationId: locationId2 }) => {
|
|
3471
3532
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3479,8 +3540,8 @@ function registerCouponTools(server2, client) {
|
|
|
3479
3540
|
"get_coupon",
|
|
3480
3541
|
"Retrieve a single coupon by its ID.",
|
|
3481
3542
|
{
|
|
3482
|
-
couponId:
|
|
3483
|
-
locationId:
|
|
3543
|
+
couponId: import_zod28.z.string().describe("The coupon ID to retrieve."),
|
|
3544
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3484
3545
|
},
|
|
3485
3546
|
async ({ couponId, locationId: locationId2 }) => {
|
|
3486
3547
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3494,14 +3555,14 @@ function registerCouponTools(server2, client) {
|
|
|
3494
3555
|
"create_coupon",
|
|
3495
3556
|
"Create a new coupon/promo code.",
|
|
3496
3557
|
{
|
|
3497
|
-
locationId:
|
|
3498
|
-
name:
|
|
3499
|
-
code:
|
|
3500
|
-
type:
|
|
3501
|
-
amount:
|
|
3502
|
-
duration:
|
|
3503
|
-
durationInMonths:
|
|
3504
|
-
productIds:
|
|
3558
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3559
|
+
name: import_zod28.z.string().describe("Coupon name."),
|
|
3560
|
+
code: import_zod28.z.string().describe("Promo code string customers enter."),
|
|
3561
|
+
type: import_zod28.z.string().describe("Discount type: 'percentage' or 'fixed'."),
|
|
3562
|
+
amount: import_zod28.z.number().describe("Discount amount (percentage value or fixed dollar amount)."),
|
|
3563
|
+
duration: import_zod28.z.string().optional().describe("Duration: 'once', 'repeating', or 'forever'. Defaults to 'once'."),
|
|
3564
|
+
durationInMonths: import_zod28.z.number().optional().describe("Number of months if duration is 'repeating'."),
|
|
3565
|
+
productIds: import_zod28.z.array(import_zod28.z.string()).optional().describe("Product IDs this coupon applies to. If empty, applies to all.")
|
|
3505
3566
|
},
|
|
3506
3567
|
async ({ locationId: locationId2, name, code, type, amount, duration, durationInMonths, productIds }) => {
|
|
3507
3568
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3525,10 +3586,10 @@ function registerCouponTools(server2, client) {
|
|
|
3525
3586
|
"update_coupon",
|
|
3526
3587
|
"Update an existing coupon.",
|
|
3527
3588
|
{
|
|
3528
|
-
couponId:
|
|
3529
|
-
locationId:
|
|
3530
|
-
name:
|
|
3531
|
-
productIds:
|
|
3589
|
+
couponId: import_zod28.z.string().describe("The coupon ID to update."),
|
|
3590
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3591
|
+
name: import_zod28.z.string().optional().describe("Updated coupon name."),
|
|
3592
|
+
productIds: import_zod28.z.array(import_zod28.z.string()).optional().describe("Updated product IDs this coupon applies to.")
|
|
3532
3593
|
},
|
|
3533
3594
|
async ({ couponId, locationId: locationId2, name, productIds }) => {
|
|
3534
3595
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3546,8 +3607,8 @@ function registerCouponTools(server2, client) {
|
|
|
3546
3607
|
"delete_coupon",
|
|
3547
3608
|
"Delete a coupon by ID.",
|
|
3548
3609
|
{
|
|
3549
|
-
couponId:
|
|
3550
|
-
locationId:
|
|
3610
|
+
couponId: import_zod28.z.string().describe("The coupon ID to delete."),
|
|
3611
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3551
3612
|
},
|
|
3552
3613
|
async ({ couponId, locationId: locationId2 }) => {
|
|
3553
3614
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3559,14 +3620,14 @@ function registerCouponTools(server2, client) {
|
|
|
3559
3620
|
}
|
|
3560
3621
|
|
|
3561
3622
|
// src/tools/webhooks.ts
|
|
3562
|
-
var
|
|
3623
|
+
var import_zod29 = require("zod");
|
|
3563
3624
|
function registerWebhookTools(server2, client) {
|
|
3564
3625
|
safeTool(
|
|
3565
3626
|
server2,
|
|
3566
3627
|
"list_webhooks",
|
|
3567
3628
|
"List all webhooks configured in a GHL location.",
|
|
3568
3629
|
{
|
|
3569
|
-
locationId:
|
|
3630
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3570
3631
|
},
|
|
3571
3632
|
async ({ locationId: locationId2 }) => {
|
|
3572
3633
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3580,8 +3641,8 @@ function registerWebhookTools(server2, client) {
|
|
|
3580
3641
|
"get_webhook",
|
|
3581
3642
|
"Retrieve a single webhook by its ID.",
|
|
3582
3643
|
{
|
|
3583
|
-
webhookId:
|
|
3584
|
-
locationId:
|
|
3644
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to retrieve."),
|
|
3645
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3585
3646
|
},
|
|
3586
3647
|
async ({ webhookId, locationId: locationId2 }) => {
|
|
3587
3648
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3595,10 +3656,10 @@ function registerWebhookTools(server2, client) {
|
|
|
3595
3656
|
"create_webhook",
|
|
3596
3657
|
"Create a new webhook subscription for GHL events.",
|
|
3597
3658
|
{
|
|
3598
|
-
locationId:
|
|
3599
|
-
name:
|
|
3600
|
-
url:
|
|
3601
|
-
events:
|
|
3659
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3660
|
+
name: import_zod29.z.string().describe("Webhook name."),
|
|
3661
|
+
url: import_zod29.z.string().describe("The URL to POST events to."),
|
|
3662
|
+
events: import_zod29.z.array(import_zod29.z.string()).describe(
|
|
3602
3663
|
"List of event types to subscribe to (e.g. 'ContactCreate', 'AppointmentCreate', 'OpportunityStatusUpdate')."
|
|
3603
3664
|
)
|
|
3604
3665
|
},
|
|
@@ -3619,11 +3680,11 @@ function registerWebhookTools(server2, client) {
|
|
|
3619
3680
|
"update_webhook",
|
|
3620
3681
|
"Update an existing webhook (name, URL, or subscribed events).",
|
|
3621
3682
|
{
|
|
3622
|
-
webhookId:
|
|
3623
|
-
locationId:
|
|
3624
|
-
name:
|
|
3625
|
-
url:
|
|
3626
|
-
events:
|
|
3683
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to update."),
|
|
3684
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3685
|
+
name: import_zod29.z.string().optional().describe("Updated webhook name."),
|
|
3686
|
+
url: import_zod29.z.string().optional().describe("Updated webhook URL."),
|
|
3687
|
+
events: import_zod29.z.array(import_zod29.z.string()).optional().describe("Updated list of event types.")
|
|
3627
3688
|
},
|
|
3628
3689
|
async ({ webhookId, locationId: locationId2, name, url, events }) => {
|
|
3629
3690
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3639,8 +3700,8 @@ function registerWebhookTools(server2, client) {
|
|
|
3639
3700
|
"delete_webhook",
|
|
3640
3701
|
"Delete a webhook subscription by ID.",
|
|
3641
3702
|
{
|
|
3642
|
-
webhookId:
|
|
3643
|
-
locationId:
|
|
3703
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to delete."),
|
|
3704
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3644
3705
|
},
|
|
3645
3706
|
async ({ webhookId, locationId: locationId2 }) => {
|
|
3646
3707
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3652,16 +3713,16 @@ function registerWebhookTools(server2, client) {
|
|
|
3652
3713
|
}
|
|
3653
3714
|
|
|
3654
3715
|
// src/tools/documents.ts
|
|
3655
|
-
var
|
|
3716
|
+
var import_zod30 = require("zod");
|
|
3656
3717
|
function registerDocumentTools(server2, client) {
|
|
3657
3718
|
safeTool(
|
|
3658
3719
|
server2,
|
|
3659
3720
|
"list_documents",
|
|
3660
3721
|
"List documents and contracts in a GHL location. Supports pagination.",
|
|
3661
3722
|
{
|
|
3662
|
-
locationId:
|
|
3663
|
-
limit:
|
|
3664
|
-
offset:
|
|
3723
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3724
|
+
limit: import_zod30.z.number().optional().describe("Maximum documents to return. Defaults to 20."),
|
|
3725
|
+
offset: import_zod30.z.number().optional().describe("Number of records to skip for pagination.")
|
|
3665
3726
|
},
|
|
3666
3727
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
3667
3728
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3679,8 +3740,8 @@ function registerDocumentTools(server2, client) {
|
|
|
3679
3740
|
"get_document",
|
|
3680
3741
|
"Retrieve a single document or contract by its ID, including signature status.",
|
|
3681
3742
|
{
|
|
3682
|
-
documentId:
|
|
3683
|
-
locationId:
|
|
3743
|
+
documentId: import_zod30.z.string().describe("The document ID to retrieve."),
|
|
3744
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3684
3745
|
},
|
|
3685
3746
|
async ({ documentId, locationId: locationId2 }) => {
|
|
3686
3747
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3694,8 +3755,8 @@ function registerDocumentTools(server2, client) {
|
|
|
3694
3755
|
"delete_document",
|
|
3695
3756
|
"Delete a document or contract by ID.",
|
|
3696
3757
|
{
|
|
3697
|
-
documentId:
|
|
3698
|
-
locationId:
|
|
3758
|
+
documentId: import_zod30.z.string().describe("The document ID to delete."),
|
|
3759
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3699
3760
|
},
|
|
3700
3761
|
async ({ documentId, locationId: locationId2 }) => {
|
|
3701
3762
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3709,9 +3770,9 @@ function registerDocumentTools(server2, client) {
|
|
|
3709
3770
|
"send_document",
|
|
3710
3771
|
"Send a document/contract to a contact for electronic signature.",
|
|
3711
3772
|
{
|
|
3712
|
-
documentId:
|
|
3713
|
-
contactId:
|
|
3714
|
-
locationId:
|
|
3773
|
+
documentId: import_zod30.z.string().describe("The document ID to send."),
|
|
3774
|
+
contactId: import_zod30.z.string().describe("The contact ID to send the document to."),
|
|
3775
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3715
3776
|
},
|
|
3716
3777
|
async ({ documentId, contactId, locationId: locationId2 }) => {
|
|
3717
3778
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3723,94 +3784,20 @@ function registerDocumentTools(server2, client) {
|
|
|
3723
3784
|
}
|
|
3724
3785
|
|
|
3725
3786
|
// src/tools/workflow-builder.ts
|
|
3726
|
-
var
|
|
3727
|
-
var ActionSchema =
|
|
3728
|
-
id:
|
|
3729
|
-
name:
|
|
3730
|
-
type:
|
|
3731
|
-
attributes:
|
|
3732
|
-
next:
|
|
3733
|
-
parent:
|
|
3734
|
-
parentKey:
|
|
3735
|
-
order:
|
|
3736
|
-
cat:
|
|
3737
|
-
nodeType:
|
|
3738
|
-
sibling:
|
|
3739
|
-
}).passthrough();
|
|
3740
|
-
var TriggerActionSchema2 = import_zod30.z.object({
|
|
3741
|
-
workflow_id: import_zod30.z.string(),
|
|
3742
|
-
type: import_zod30.z.literal("add_to_workflow")
|
|
3743
|
-
}).passthrough();
|
|
3744
|
-
var TriggerCommonSchema2 = import_zod30.z.object({
|
|
3745
|
-
id: import_zod30.z.string().optional(),
|
|
3746
|
-
date_added: import_zod30.z.string().optional(),
|
|
3747
|
-
deleted: import_zod30.z.boolean().optional(),
|
|
3748
|
-
belongs_to: import_zod30.z.literal("workflow").optional(),
|
|
3749
|
-
location_id: import_zod30.z.string().optional(),
|
|
3750
|
-
origin_id: import_zod30.z.string().optional(),
|
|
3751
|
-
active: import_zod30.z.boolean().optional(),
|
|
3752
|
-
workflow_id: import_zod30.z.string().optional(),
|
|
3753
|
-
masterType: import_zod30.z.literal("highlevel").optional(),
|
|
3754
|
-
name: import_zod30.z.string().optional(),
|
|
3755
|
-
actions: import_zod30.z.array(TriggerActionSchema2).optional(),
|
|
3756
|
-
schedule_config: import_zod30.z.record(import_zod30.z.unknown()).optional(),
|
|
3757
|
-
date_updated: import_zod30.z.string().optional()
|
|
3787
|
+
var import_zod31 = require("zod");
|
|
3788
|
+
var ActionSchema = import_zod31.z.object({
|
|
3789
|
+
id: import_zod31.z.string().optional().describe("Action ID (auto-generated if omitted)."),
|
|
3790
|
+
name: import_zod31.z.string().describe("Display name for this action step."),
|
|
3791
|
+
type: import_zod31.z.string().describe("Action type."),
|
|
3792
|
+
attributes: import_zod31.z.record(import_zod31.z.unknown()).optional().describe("Action-specific configuration."),
|
|
3793
|
+
next: import_zod31.z.union([import_zod31.z.string(), import_zod31.z.array(import_zod31.z.string())]).optional().describe("Next action id, or branch id array for condition nodes."),
|
|
3794
|
+
parent: import_zod31.z.string().optional().describe("Branch parent node id."),
|
|
3795
|
+
parentKey: import_zod31.z.string().optional().describe("Previous action id or branch parent id."),
|
|
3796
|
+
order: import_zod31.z.number().optional().describe("Order within this chain or branch."),
|
|
3797
|
+
cat: import_zod31.z.string().optional().describe("Category for condition, transition, or multi-path nodes."),
|
|
3798
|
+
nodeType: import_zod31.z.string().optional().describe("Node type for if/else nodes."),
|
|
3799
|
+
sibling: import_zod31.z.array(import_zod31.z.string()).optional().describe("Sibling branch node IDs.")
|
|
3758
3800
|
}).passthrough();
|
|
3759
|
-
var ContactTagTriggerSchema2 = TriggerCommonSchema2.extend({
|
|
3760
|
-
type: import_zod30.z.literal("contact_tag"),
|
|
3761
|
-
conditions: import_zod30.z.array(import_zod30.z.object({
|
|
3762
|
-
operator: import_zod30.z.string(),
|
|
3763
|
-
field: import_zod30.z.enum(["tagsAdded", "tagsRemoved"]),
|
|
3764
|
-
value: import_zod30.z.string(),
|
|
3765
|
-
title: import_zod30.z.string().optional(),
|
|
3766
|
-
type: import_zod30.z.string().optional(),
|
|
3767
|
-
id: import_zod30.z.string().optional()
|
|
3768
|
-
}).passthrough())
|
|
3769
|
-
});
|
|
3770
|
-
var CustomerReplyTriggerSchema2 = TriggerCommonSchema2.extend({
|
|
3771
|
-
type: import_zod30.z.literal("customer_reply"),
|
|
3772
|
-
conditions: import_zod30.z.array(import_zod30.z.object({
|
|
3773
|
-
operator: import_zod30.z.string(),
|
|
3774
|
-
field: import_zod30.z.string(),
|
|
3775
|
-
value: import_zod30.z.unknown().optional(),
|
|
3776
|
-
title: import_zod30.z.string().optional(),
|
|
3777
|
-
type: import_zod30.z.string().optional(),
|
|
3778
|
-
id: import_zod30.z.string().optional()
|
|
3779
|
-
}).passthrough()).optional()
|
|
3780
|
-
});
|
|
3781
|
-
var AppointmentTriggerSchema2 = TriggerCommonSchema2.extend({
|
|
3782
|
-
type: import_zod30.z.literal("appointment"),
|
|
3783
|
-
conditions: import_zod30.z.array(import_zod30.z.object({
|
|
3784
|
-
operator: import_zod30.z.string(),
|
|
3785
|
-
field: import_zod30.z.string(),
|
|
3786
|
-
value: import_zod30.z.unknown().optional(),
|
|
3787
|
-
title: import_zod30.z.string().optional(),
|
|
3788
|
-
type: import_zod30.z.string().optional(),
|
|
3789
|
-
id: import_zod30.z.string().optional()
|
|
3790
|
-
}).passthrough()).optional()
|
|
3791
|
-
});
|
|
3792
|
-
var PipelineStageUpdatedTriggerSchema2 = TriggerCommonSchema2.extend({
|
|
3793
|
-
type: import_zod30.z.literal("pipeline_stage_updated"),
|
|
3794
|
-
conditions: import_zod30.z.array(import_zod30.z.object({
|
|
3795
|
-
operator: import_zod30.z.string(),
|
|
3796
|
-
field: import_zod30.z.string(),
|
|
3797
|
-
value: import_zod30.z.unknown().optional(),
|
|
3798
|
-
title: import_zod30.z.string().optional(),
|
|
3799
|
-
type: import_zod30.z.string().optional(),
|
|
3800
|
-
id: import_zod30.z.string().optional()
|
|
3801
|
-
}).passthrough()).optional()
|
|
3802
|
-
});
|
|
3803
|
-
var UnknownTriggerSchema2 = TriggerCommonSchema2.extend({
|
|
3804
|
-
type: import_zod30.z.string(),
|
|
3805
|
-
conditions: import_zod30.z.array(import_zod30.z.record(import_zod30.z.unknown())).optional()
|
|
3806
|
-
});
|
|
3807
|
-
var WorkflowTriggerSchema2 = import_zod30.z.union([
|
|
3808
|
-
CustomerReplyTriggerSchema2,
|
|
3809
|
-
AppointmentTriggerSchema2,
|
|
3810
|
-
ContactTagTriggerSchema2,
|
|
3811
|
-
PipelineStageUpdatedTriggerSchema2,
|
|
3812
|
-
UnknownTriggerSchema2
|
|
3813
|
-
]);
|
|
3814
3801
|
function linkBranchActions(actions, branchId, nextAfterMerge) {
|
|
3815
3802
|
const prepared = actions.map((action) => ({
|
|
3816
3803
|
...action,
|
|
@@ -3856,8 +3843,8 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3856
3843
|
"list_workflows_full",
|
|
3857
3844
|
"List all workflows with full metadata including version, permissions, and timestamps. Requires Firebase auth. Use this instead of get_workflows when you need version numbers or internal IDs for update_workflow_actions.",
|
|
3858
3845
|
{
|
|
3859
|
-
limit:
|
|
3860
|
-
skip:
|
|
3846
|
+
limit: import_zod31.z.number().optional().describe("Max workflows to return. Defaults to 50."),
|
|
3847
|
+
skip: import_zod31.z.number().optional().describe("Number of workflows to skip for pagination.")
|
|
3861
3848
|
},
|
|
3862
3849
|
async ({ limit, skip }) => {
|
|
3863
3850
|
try {
|
|
@@ -3872,7 +3859,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3872
3859
|
"get_workflow_full",
|
|
3873
3860
|
"Get a workflow with full details including all actions (steps), triggers, conditions, if/else branches, and configuration. Requires Firebase auth. ALWAYS call this before update_workflow_actions to see the current state.",
|
|
3874
3861
|
{
|
|
3875
|
-
workflowId:
|
|
3862
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to retrieve.")
|
|
3876
3863
|
},
|
|
3877
3864
|
async ({ workflowId }) => {
|
|
3878
3865
|
try {
|
|
@@ -3887,9 +3874,9 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3887
3874
|
"get_trigger_registry",
|
|
3888
3875
|
"Return GHL's marketplace catalogue of workflow triggers from 3rd-party apps (Zoom, Shopify, WooCommerce, Monday, etc.). Each app exposes one or more trigger templates with custom variable mappings. Calls /marketplace/core/search/module?type=triggers. NOTE: This is the MARKETPLACE only. GHL's NATIVE trigger types (form_submission, contact_tag, payment_received, opportunity_*, inbound_webhook, etc.) live in the workflow builder frontend bundle, not an API. For the native registry see templates/trigger-schemas.json in this repo.",
|
|
3889
3876
|
{
|
|
3890
|
-
companyId:
|
|
3891
|
-
limit:
|
|
3892
|
-
installedOnly:
|
|
3877
|
+
companyId: import_zod31.z.string().describe("Company ID for the location. Find it in any get_workflow_full response under the 'companyId' field."),
|
|
3878
|
+
limit: import_zod31.z.number().optional().describe("Max marketplace apps to return. Defaults to 200."),
|
|
3879
|
+
installedOnly: import_zod31.z.boolean().optional().describe("If true, returns only apps installed in this location. Defaults to false (full marketplace catalogue, ~85 apps).")
|
|
3893
3880
|
},
|
|
3894
3881
|
async ({ companyId, limit, installedOnly }) => {
|
|
3895
3882
|
try {
|
|
@@ -3921,7 +3908,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3921
3908
|
"create_workflow",
|
|
3922
3909
|
"Create a new empty workflow (starts as draft). Requires Firebase auth. Flow: 1) create_workflow \u2192 2) update_workflow_actions (add triggers + steps) \u2192 3) publish_workflow (make it live).",
|
|
3923
3910
|
{
|
|
3924
|
-
name:
|
|
3911
|
+
name: import_zod31.z.string().describe("Name for the new workflow.")
|
|
3925
3912
|
},
|
|
3926
3913
|
async ({ name }) => {
|
|
3927
3914
|
try {
|
|
@@ -3936,11 +3923,11 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3936
3923
|
"update_workflow_actions",
|
|
3937
3924
|
"Update a workflow's actions (steps), triggers, name, or status. IMPORTANT: Call get_workflow_full first to see the current state before updating. Handles version tracking automatically. Uses the internal builder API (requires Firebase auth). Action types: sms, email, add_contact_tag, remove_contact_tag, wait, webhook, internal_update_opportunity, custom_code, update_contact_field, add_notes, internal_notification, task_notification, remove_from_workflow, add_to_workflow, goto, transition. For if/else, call build_if_else_branch and include its returned nodes; if_else is a node discriminator, not a standalone action. Trigger types: customer_reply, appointment, contact_tag, and pipeline_stage_updated have typed validation. Any other GHL trigger type (form_submitted, opportunity_created, payment_received, inbound_webhook, etc.) passes through with a permissive schema \u2014 the payload reaches GHL untouched.",
|
|
3938
3925
|
{
|
|
3939
|
-
workflowId:
|
|
3940
|
-
name:
|
|
3941
|
-
status:
|
|
3942
|
-
actions:
|
|
3943
|
-
triggers:
|
|
3926
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to update."),
|
|
3927
|
+
name: import_zod31.z.string().optional().describe("New workflow name."),
|
|
3928
|
+
status: import_zod31.z.string().optional().describe("New status: 'draft' or 'published'."),
|
|
3929
|
+
actions: import_zod31.z.array(ActionSchema).optional().describe("Array of workflow actions/steps. For linear flows, provide in order \u2014 chaining is automatic."),
|
|
3930
|
+
triggers: import_zod31.z.array(WorkflowTriggerSchema).optional().describe("Array of workflow triggers.")
|
|
3944
3931
|
},
|
|
3945
3932
|
async ({ workflowId, name, status, actions, triggers }) => {
|
|
3946
3933
|
try {
|
|
@@ -3984,12 +3971,12 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3984
3971
|
"build_if_else_branch",
|
|
3985
3972
|
"Build a correctly-shaped GHL if/else branch node set for a tag-based condition (Build Your Own / CUSTOM recipe). Returns a condition-node, branch-yes, branch-no, and branch child actions with parent/parentKey/sibling/order links populated. Shape mirrors what GHL's UI saves so dropdowns render correctly.",
|
|
3986
3973
|
{
|
|
3987
|
-
field:
|
|
3988
|
-
operator:
|
|
3989
|
-
value:
|
|
3990
|
-
yes_actions:
|
|
3991
|
-
no_actions:
|
|
3992
|
-
next_after_merge:
|
|
3974
|
+
field: import_zod31.z.string().describe("Condition subtype, currently 'tags' for tag-based conditions."),
|
|
3975
|
+
operator: import_zod31.z.string().describe("Condition operator token. Verified: 'index-of-true' (Includes), 'index-of-false' (Does not include), 'has_value' (Is not empty), 'has_no_value' (Is empty). Emptiness operators don't take a value. Tokens must match GHL's exact internal strings or the UI dropdown renders the raw token instead of a label."),
|
|
3976
|
+
value: import_zod31.z.union([import_zod31.z.string(), import_zod31.z.array(import_zod31.z.string())]).optional().describe("Tag name(s). Required for index-of-true / index-of-false. Omit for has_value / has_no_value. Single string is auto-wrapped as an array. Tags must already exist in the location's tag library or the UI dropdown will render empty."),
|
|
3977
|
+
yes_actions: import_zod31.z.array(ActionSchema).describe("Actions to run in the Yes branch."),
|
|
3978
|
+
no_actions: import_zod31.z.array(ActionSchema).describe("Actions to run in the No branch."),
|
|
3979
|
+
next_after_merge: import_zod31.z.string().optional().describe("Optional node id to link from each non-empty branch's final child.")
|
|
3993
3980
|
},
|
|
3994
3981
|
async ({ field, operator, value, yes_actions, no_actions, next_after_merge }) => {
|
|
3995
3982
|
try {
|
|
@@ -4099,8 +4086,8 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4099
4086
|
"delete_workflow_full",
|
|
4100
4087
|
"Permanently delete a workflow. IRREVERSIBLE.",
|
|
4101
4088
|
{
|
|
4102
|
-
workflowId:
|
|
4103
|
-
confirm:
|
|
4089
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to delete."),
|
|
4090
|
+
confirm: import_zod31.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4104
4091
|
},
|
|
4105
4092
|
async ({ workflowId }) => {
|
|
4106
4093
|
try {
|
|
@@ -4115,7 +4102,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4115
4102
|
"publish_workflow",
|
|
4116
4103
|
"Publish a draft workflow, making it active and processing contacts.",
|
|
4117
4104
|
{
|
|
4118
|
-
workflowId:
|
|
4105
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to publish.")
|
|
4119
4106
|
},
|
|
4120
4107
|
async ({ workflowId }) => {
|
|
4121
4108
|
try {
|
|
@@ -4129,7 +4116,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4129
4116
|
}
|
|
4130
4117
|
|
|
4131
4118
|
// src/tools/funnel-builder.ts
|
|
4132
|
-
var
|
|
4119
|
+
var import_zod32 = require("zod");
|
|
4133
4120
|
function registerFunnelBuilderTools(server2, builderClient) {
|
|
4134
4121
|
const client = builderClient;
|
|
4135
4122
|
if (!client) return;
|
|
@@ -4170,7 +4157,7 @@ ${text2}`);
|
|
|
4170
4157
|
"list_funnels_full",
|
|
4171
4158
|
"List all funnels/websites with full details including steps, pages, and metadata. Uses the internal API for richer data than the public API.",
|
|
4172
4159
|
{
|
|
4173
|
-
limit:
|
|
4160
|
+
limit: import_zod32.z.number().optional().describe("Max funnels to return. Defaults to 50.")
|
|
4174
4161
|
},
|
|
4175
4162
|
async ({ limit }) => {
|
|
4176
4163
|
try {
|
|
@@ -4190,7 +4177,7 @@ ${text2}`);
|
|
|
4190
4177
|
"get_page_full",
|
|
4191
4178
|
"Get a funnel/website page with full builder data: metadata, version, preview snapshot URL, and page data download URL. To get the actual page content (sections, elements, styles), use get_page_content with the pageDataDownloadUrl from this response.",
|
|
4192
4179
|
{
|
|
4193
|
-
pageId:
|
|
4180
|
+
pageId: import_zod32.z.string().describe("The page ID to retrieve.")
|
|
4194
4181
|
},
|
|
4195
4182
|
async ({ pageId }) => {
|
|
4196
4183
|
try {
|
|
@@ -4210,7 +4197,7 @@ ${text2}`);
|
|
|
4210
4197
|
"get_page_content",
|
|
4211
4198
|
"Download the full page builder content from a page's data URL. Returns the complete page structure: sections, elements, settings, styles, tracking codes, and popups. Use get_page_full first to get the pageDataDownloadUrl.",
|
|
4212
4199
|
{
|
|
4213
|
-
pageDataDownloadUrl:
|
|
4200
|
+
pageDataDownloadUrl: import_zod32.z.string().describe("The pageDataDownloadUrl from get_page_full response.")
|
|
4214
4201
|
},
|
|
4215
4202
|
async ({ pageDataDownloadUrl }) => {
|
|
4216
4203
|
try {
|
|
@@ -4232,7 +4219,7 @@ ${text2}`);
|
|
|
4232
4219
|
"create_funnel",
|
|
4233
4220
|
"Create a new funnel/website. Starts empty \u2014 add steps and pages after creation.",
|
|
4234
4221
|
{
|
|
4235
|
-
name:
|
|
4222
|
+
name: import_zod32.z.string().describe("Name for the new funnel.")
|
|
4236
4223
|
},
|
|
4237
4224
|
async ({ name }) => {
|
|
4238
4225
|
try {
|
|
@@ -4254,9 +4241,9 @@ ${text2}`);
|
|
|
4254
4241
|
"update_funnel",
|
|
4255
4242
|
"Update a funnel's name, domain, or steps configuration.",
|
|
4256
4243
|
{
|
|
4257
|
-
funnelId:
|
|
4258
|
-
name:
|
|
4259
|
-
steps:
|
|
4244
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to update."),
|
|
4245
|
+
name: import_zod32.z.string().optional().describe("New funnel name."),
|
|
4246
|
+
steps: import_zod32.z.array(import_zod32.z.record(import_zod32.z.unknown())).optional().describe("Updated steps array with page references.")
|
|
4260
4247
|
},
|
|
4261
4248
|
async ({ funnelId, name, steps }) => {
|
|
4262
4249
|
try {
|
|
@@ -4276,8 +4263,8 @@ ${text2}`);
|
|
|
4276
4263
|
"delete_funnel",
|
|
4277
4264
|
"Permanently delete a funnel and all its pages. IRREVERSIBLE.",
|
|
4278
4265
|
{
|
|
4279
|
-
funnelId:
|
|
4280
|
-
confirm:
|
|
4266
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to delete."),
|
|
4267
|
+
confirm: import_zod32.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4281
4268
|
},
|
|
4282
4269
|
async ({ funnelId }) => {
|
|
4283
4270
|
try {
|
|
@@ -4294,9 +4281,9 @@ ${text2}`);
|
|
|
4294
4281
|
"create_funnel_page",
|
|
4295
4282
|
"Create a new page in a funnel. Returns the page ID which you can then update with content.",
|
|
4296
4283
|
{
|
|
4297
|
-
funnelId:
|
|
4298
|
-
name:
|
|
4299
|
-
url:
|
|
4284
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to add the page to."),
|
|
4285
|
+
name: import_zod32.z.string().describe("Page name."),
|
|
4286
|
+
url: import_zod32.z.string().optional().describe("URL slug for the page (e.g. '/thank-you').")
|
|
4300
4287
|
},
|
|
4301
4288
|
async ({ funnelId, name, url }) => {
|
|
4302
4289
|
try {
|
|
@@ -4318,8 +4305,8 @@ ${text2}`);
|
|
|
4318
4305
|
"update_page_content",
|
|
4319
4306
|
"Update a page's builder content \u2014 sections, elements, styles, tracking codes, popups. Use get_page_content first to see the current structure, modify it, and pass the updated JSON here.",
|
|
4320
4307
|
{
|
|
4321
|
-
pageId:
|
|
4322
|
-
content:
|
|
4308
|
+
pageId: import_zod32.z.string().describe("The page ID to update."),
|
|
4309
|
+
content: import_zod32.z.record(import_zod32.z.unknown()).describe("The full page content JSON (sections, settings, general, pageStyles, trackingCode, popups, popupsList).")
|
|
4323
4310
|
},
|
|
4324
4311
|
async ({ pageId, content }) => {
|
|
4325
4312
|
try {
|
|
@@ -4339,8 +4326,8 @@ ${text2}`);
|
|
|
4339
4326
|
"delete_funnel_page",
|
|
4340
4327
|
"Permanently delete a page from a funnel. IRREVERSIBLE.",
|
|
4341
4328
|
{
|
|
4342
|
-
pageId:
|
|
4343
|
-
confirm:
|
|
4329
|
+
pageId: import_zod32.z.string().describe("The page ID to delete."),
|
|
4330
|
+
confirm: import_zod32.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4344
4331
|
},
|
|
4345
4332
|
async ({ pageId }) => {
|
|
4346
4333
|
try {
|
|
@@ -4356,7 +4343,7 @@ ${text2}`);
|
|
|
4356
4343
|
}
|
|
4357
4344
|
|
|
4358
4345
|
// src/tools/form-builder.ts
|
|
4359
|
-
var
|
|
4346
|
+
var import_zod33 = require("zod");
|
|
4360
4347
|
function registerFormBuilderTools(server2, builderClient) {
|
|
4361
4348
|
const client = builderClient;
|
|
4362
4349
|
if (!client) return;
|
|
@@ -4385,7 +4372,7 @@ ${text2}`);
|
|
|
4385
4372
|
"get_form_full",
|
|
4386
4373
|
"Get a form with full builder data: all fields (labels, types, IDs, validation), conditional logic, auto-responder config, email notification settings, styling, and version history. This is the internal API \u2014 it returns everything the form builder UI shows.",
|
|
4387
4374
|
{
|
|
4388
|
-
formId:
|
|
4375
|
+
formId: import_zod33.z.string().describe("The form ID to retrieve.")
|
|
4389
4376
|
},
|
|
4390
4377
|
async ({ formId }) => {
|
|
4391
4378
|
try {
|
|
@@ -4402,9 +4389,9 @@ ${text2}`);
|
|
|
4402
4389
|
"update_form",
|
|
4403
4390
|
"Update a form's structure \u2014 fields, labels, conditional logic, auto-responder, email notifications, styling. Use get_form_full first to see the current structure, modify the formData object, and pass it here.",
|
|
4404
4391
|
{
|
|
4405
|
-
formId:
|
|
4406
|
-
formData:
|
|
4407
|
-
name:
|
|
4392
|
+
formId: import_zod33.z.string().describe("The form ID to update."),
|
|
4393
|
+
formData: import_zod33.z.record(import_zod33.z.unknown()).describe("The updated formData object containing form fields, settings, autoResponder config, etc."),
|
|
4394
|
+
name: import_zod33.z.string().optional().describe("Updated form name.")
|
|
4408
4395
|
},
|
|
4409
4396
|
async ({ formId, formData, name }) => {
|
|
4410
4397
|
try {
|
|
@@ -4423,7 +4410,7 @@ ${text2}`);
|
|
|
4423
4410
|
"create_form",
|
|
4424
4411
|
"Create a new form. Starts with a basic structure \u2014 use update_form to add fields and configure settings.",
|
|
4425
4412
|
{
|
|
4426
|
-
name:
|
|
4413
|
+
name: import_zod33.z.string().describe("Name for the new form.")
|
|
4427
4414
|
},
|
|
4428
4415
|
async ({ name }) => {
|
|
4429
4416
|
try {
|
|
@@ -4449,8 +4436,8 @@ ${text2}`);
|
|
|
4449
4436
|
"delete_form",
|
|
4450
4437
|
"Permanently delete a form. IRREVERSIBLE.",
|
|
4451
4438
|
{
|
|
4452
|
-
formId:
|
|
4453
|
-
confirm:
|
|
4439
|
+
formId: import_zod33.z.string().describe("The form ID to delete."),
|
|
4440
|
+
confirm: import_zod33.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4454
4441
|
},
|
|
4455
4442
|
async ({ formId }) => {
|
|
4456
4443
|
try {
|
|
@@ -4467,9 +4454,9 @@ ${text2}`);
|
|
|
4467
4454
|
"get_form_submissions_full",
|
|
4468
4455
|
"Get form submissions with full field data, contact info, and submission timestamps via the internal API. Offset-based pagination via skip/limit.",
|
|
4469
4456
|
{
|
|
4470
|
-
formId:
|
|
4471
|
-
limit:
|
|
4472
|
-
skip:
|
|
4457
|
+
formId: import_zod33.z.string().optional().describe("Filter by form ID. If omitted, returns all submissions."),
|
|
4458
|
+
limit: import_zod33.z.number().optional().describe("Max submissions to return. Defaults to 20."),
|
|
4459
|
+
skip: import_zod33.z.number().optional().describe("Number to skip for pagination.")
|
|
4473
4460
|
},
|
|
4474
4461
|
async ({ formId, limit, skip }) => {
|
|
4475
4462
|
try {
|
|
@@ -4488,7 +4475,7 @@ ${text2}`);
|
|
|
4488
4475
|
}
|
|
4489
4476
|
|
|
4490
4477
|
// src/tools/pipeline-builder.ts
|
|
4491
|
-
var
|
|
4478
|
+
var import_zod34 = require("zod");
|
|
4492
4479
|
function registerPipelineBuilderTools(server2, builderClient) {
|
|
4493
4480
|
const client = builderClient;
|
|
4494
4481
|
if (!client) return;
|
|
@@ -4533,7 +4520,7 @@ ${text2}`);
|
|
|
4533
4520
|
"get_pipeline_full",
|
|
4534
4521
|
"Get a single pipeline with complete stage configuration: IDs, names, positions, display settings.",
|
|
4535
4522
|
{
|
|
4536
|
-
pipelineId:
|
|
4523
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to retrieve.")
|
|
4537
4524
|
},
|
|
4538
4525
|
async ({ pipelineId }) => {
|
|
4539
4526
|
try {
|
|
@@ -4551,17 +4538,17 @@ ${text2}`);
|
|
|
4551
4538
|
"create_pipeline",
|
|
4552
4539
|
"Create a new pipeline with stages. Each stage needs a name and position (0-based).",
|
|
4553
4540
|
{
|
|
4554
|
-
name:
|
|
4555
|
-
stages:
|
|
4556
|
-
|
|
4557
|
-
name:
|
|
4558
|
-
position:
|
|
4559
|
-
showInFunnel:
|
|
4560
|
-
showInPieChart:
|
|
4541
|
+
name: import_zod34.z.string().describe("Pipeline name."),
|
|
4542
|
+
stages: import_zod34.z.array(
|
|
4543
|
+
import_zod34.z.object({
|
|
4544
|
+
name: import_zod34.z.string().describe("Stage name."),
|
|
4545
|
+
position: import_zod34.z.number().describe("Stage position (0-based)."),
|
|
4546
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show in funnel view. Defaults to true."),
|
|
4547
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show in pie chart. Defaults to true.")
|
|
4561
4548
|
})
|
|
4562
4549
|
).describe("Array of stages in order."),
|
|
4563
|
-
showInFunnel:
|
|
4564
|
-
showInPieChart:
|
|
4550
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show pipeline in funnel view. Defaults to true."),
|
|
4551
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show pipeline in pie chart. Defaults to true.")
|
|
4565
4552
|
},
|
|
4566
4553
|
async ({ name, stages, showInFunnel, showInPieChart }) => {
|
|
4567
4554
|
try {
|
|
@@ -4591,19 +4578,19 @@ ${text2}`);
|
|
|
4591
4578
|
"update_pipeline",
|
|
4592
4579
|
"Update a pipeline's name, stages, or display settings. You can add, remove, rename, or reorder stages. Pass the complete stages array \u2014 stages not included will be removed.",
|
|
4593
4580
|
{
|
|
4594
|
-
pipelineId:
|
|
4595
|
-
name:
|
|
4596
|
-
stages:
|
|
4597
|
-
|
|
4598
|
-
id:
|
|
4599
|
-
name:
|
|
4600
|
-
position:
|
|
4601
|
-
showInFunnel:
|
|
4602
|
-
showInPieChart:
|
|
4581
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to update."),
|
|
4582
|
+
name: import_zod34.z.string().optional().describe("New pipeline name."),
|
|
4583
|
+
stages: import_zod34.z.array(
|
|
4584
|
+
import_zod34.z.object({
|
|
4585
|
+
id: import_zod34.z.string().optional().describe("Existing stage ID (omit for new stages)."),
|
|
4586
|
+
name: import_zod34.z.string().describe("Stage name."),
|
|
4587
|
+
position: import_zod34.z.number().describe("Stage position (0-based)."),
|
|
4588
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show in funnel view."),
|
|
4589
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show in pie chart.")
|
|
4603
4590
|
})
|
|
4604
4591
|
).optional().describe("Complete stages array. Stages not included will be removed."),
|
|
4605
|
-
showInFunnel:
|
|
4606
|
-
showInPieChart:
|
|
4592
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show pipeline in funnel view."),
|
|
4593
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show pipeline in pie chart.")
|
|
4607
4594
|
},
|
|
4608
4595
|
async ({ pipelineId, name, stages, showInFunnel, showInPieChart }) => {
|
|
4609
4596
|
try {
|
|
@@ -4626,8 +4613,8 @@ ${text2}`);
|
|
|
4626
4613
|
"delete_pipeline",
|
|
4627
4614
|
"Permanently delete a pipeline and all its stages. Opportunities become unassigned. IRREVERSIBLE.",
|
|
4628
4615
|
{
|
|
4629
|
-
pipelineId:
|
|
4630
|
-
confirm:
|
|
4616
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to delete."),
|
|
4617
|
+
confirm: import_zod34.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4631
4618
|
},
|
|
4632
4619
|
async ({ pipelineId }) => {
|
|
4633
4620
|
try {
|
|
@@ -4644,17 +4631,19 @@ ${text2}`);
|
|
|
4644
4631
|
}
|
|
4645
4632
|
|
|
4646
4633
|
// src/tools/location-switcher.ts
|
|
4647
|
-
var
|
|
4634
|
+
var import_zod35 = require("zod");
|
|
4648
4635
|
var switchChain = Promise.resolve();
|
|
4649
4636
|
function withSwitchLock(fn) {
|
|
4650
4637
|
const next = switchChain.then(fn, fn);
|
|
4651
4638
|
switchChain = next.catch(() => void 0);
|
|
4652
4639
|
return next;
|
|
4653
4640
|
}
|
|
4654
|
-
function registerLocationSwitcherTools(server2, client, builderClient, registry2) {
|
|
4641
|
+
function registerLocationSwitcherTools(server2, client, builderClient, registry2, mcpVersion) {
|
|
4642
|
+
const versionLine = mcpVersion ? `
|
|
4643
|
+
MCP version: v${mcpVersion}` : "";
|
|
4655
4644
|
server2.tool(
|
|
4656
4645
|
"get_current_location",
|
|
4657
|
-
"Show which GHL sub-account (location) is currently active, including API key status. All tools use this location by default unless you specify a different one.",
|
|
4646
|
+
"Show which GHL sub-account (location) is currently active, including API key status and installed MCP version. All tools use this location by default unless you specify a different one.",
|
|
4658
4647
|
{},
|
|
4659
4648
|
async () => {
|
|
4660
4649
|
const locId = client.defaultLocationId || "NOT SET";
|
|
@@ -4672,17 +4661,17 @@ ID: ${client.defaultLocationId}
|
|
|
4672
4661
|
API Key: ${client.getApiKeyPrefix()}
|
|
4673
4662
|
Address: ${loc?.address || "N/A"}
|
|
4674
4663
|
Email: ${loc?.email || "N/A"}
|
|
4675
|
-
Token registry: ${registeredCount} location(s) registered`
|
|
4664
|
+
Token registry: ${registeredCount} location(s) registered${versionLine}`
|
|
4676
4665
|
}
|
|
4677
4666
|
]
|
|
4678
4667
|
};
|
|
4679
4668
|
}
|
|
4680
4669
|
return {
|
|
4681
|
-
content: [{ type: "text", text: `No default location set. Pass locationId to tools or use switch_location
|
|
4670
|
+
content: [{ type: "text", text: `No default location set. Pass locationId to tools or use switch_location.${versionLine}` }]
|
|
4682
4671
|
};
|
|
4683
4672
|
} catch (error) {
|
|
4684
4673
|
return {
|
|
4685
|
-
content: [{ type: "text", text: `Current location ID: ${locId} (could not fetch details \u2014 API key may not have access)` }]
|
|
4674
|
+
content: [{ type: "text", text: `Current location ID: ${locId} (could not fetch details \u2014 API key may not have access)${versionLine}` }]
|
|
4686
4675
|
};
|
|
4687
4676
|
}
|
|
4688
4677
|
}
|
|
@@ -4691,7 +4680,7 @@ Token registry: ${registeredCount} location(s) registered`
|
|
|
4691
4680
|
"switch_location",
|
|
4692
4681
|
"Switch the active GHL sub-account. Automatically swaps the API key from the token registry if available. After switching, all tools default to the new location.",
|
|
4693
4682
|
{
|
|
4694
|
-
locationId:
|
|
4683
|
+
locationId: import_zod35.z.string().describe("The Location ID to switch to.")
|
|
4695
4684
|
},
|
|
4696
4685
|
async ({ locationId: locationId2 }) => withSwitchLock(async () => {
|
|
4697
4686
|
const previousId = client.defaultLocationId;
|
|
@@ -4756,9 +4745,9 @@ Still on: ${previousId || "none"}${hint}` }],
|
|
|
4756
4745
|
"register_location",
|
|
4757
4746
|
"Add a GHL sub-account to the token registry so switch_location can automatically use its API key. Each sub-account needs its own Private Integration key created in GHL Settings > Integrations.",
|
|
4758
4747
|
{
|
|
4759
|
-
locationId:
|
|
4760
|
-
name:
|
|
4761
|
-
apiKey:
|
|
4748
|
+
locationId: import_zod35.z.string().describe("The GHL Location ID (from Settings > Business Profile)."),
|
|
4749
|
+
name: import_zod35.z.string().describe("A friendly name for this sub-account (e.g. 'PNTracker', 'Med Spa Template')."),
|
|
4750
|
+
apiKey: import_zod35.z.string().describe("The Private Integration API key for this sub-account (starts with 'pit-').")
|
|
4762
4751
|
},
|
|
4763
4752
|
async ({ locationId: locationId2, name, apiKey: apiKey2 }) => {
|
|
4764
4753
|
if (!registry2) {
|
|
@@ -4808,7 +4797,7 @@ The API key could not access location ${locationId2}. Make sure:
|
|
|
4808
4797
|
"unregister_location",
|
|
4809
4798
|
"Remove a GHL sub-account from the token registry.",
|
|
4810
4799
|
{
|
|
4811
|
-
locationId:
|
|
4800
|
+
locationId: import_zod35.z.string().describe("The Location ID to remove.")
|
|
4812
4801
|
},
|
|
4813
4802
|
async ({ locationId: locationId2 }) => {
|
|
4814
4803
|
if (!registry2) {
|
|
@@ -4867,8 +4856,8 @@ ${lines.join("\n")}
|
|
|
4867
4856
|
"list_available_locations",
|
|
4868
4857
|
"List all GHL sub-accounts (locations) accessible with the current or agency API key. Shows locations that exist in the GHL account \u2014 use register_location to add their tokens. Offset-based pagination via skip/limit.",
|
|
4869
4858
|
{
|
|
4870
|
-
limit:
|
|
4871
|
-
skip:
|
|
4859
|
+
limit: import_zod35.z.number().optional().describe("Max locations to return. Defaults to 20."),
|
|
4860
|
+
skip: import_zod35.z.number().optional().describe("Number to skip for pagination.")
|
|
4872
4861
|
},
|
|
4873
4862
|
async ({ limit, skip }) => {
|
|
4874
4863
|
try {
|
|
@@ -4911,7 +4900,7 @@ ${lines.join("\n")}
|
|
|
4911
4900
|
}
|
|
4912
4901
|
|
|
4913
4902
|
// src/tools/bulk-operations.ts
|
|
4914
|
-
var
|
|
4903
|
+
var import_zod36 = require("zod");
|
|
4915
4904
|
function delay(ms) {
|
|
4916
4905
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
4917
4906
|
}
|
|
@@ -4923,8 +4912,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4923
4912
|
"bulk_add_tags",
|
|
4924
4913
|
"Add tags to multiple contacts at once. Rate-limited to avoid API throttling. Returns a summary of successes and failures.",
|
|
4925
4914
|
{
|
|
4926
|
-
contactIds:
|
|
4927
|
-
tags:
|
|
4915
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to tag."),
|
|
4916
|
+
tags: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one tag required.").describe("Tags to add to each contact.")
|
|
4928
4917
|
},
|
|
4929
4918
|
async ({ contactIds, tags }) => {
|
|
4930
4919
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4946,8 +4935,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4946
4935
|
"bulk_remove_tags",
|
|
4947
4936
|
"Remove tags from multiple contacts at once. Rate-limited.",
|
|
4948
4937
|
{
|
|
4949
|
-
contactIds:
|
|
4950
|
-
tags:
|
|
4938
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs."),
|
|
4939
|
+
tags: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one tag required.").describe("Tags to remove from each contact.")
|
|
4951
4940
|
},
|
|
4952
4941
|
async ({ contactIds, tags }) => {
|
|
4953
4942
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4968,8 +4957,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4968
4957
|
"bulk_update_contacts",
|
|
4969
4958
|
"Update the same field(s) on multiple contacts at once. Rate-limited. Example: set a custom field value, change source, update address for a batch of contacts.",
|
|
4970
4959
|
{
|
|
4971
|
-
contactIds:
|
|
4972
|
-
fields:
|
|
4960
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to update."),
|
|
4961
|
+
fields: import_zod36.z.record(import_zod36.z.unknown()).describe("Fields to set on each contact (e.g. {customField: {id: 'xxx', value: 'yyy'}}, {source: 'Import'}).")
|
|
4973
4962
|
},
|
|
4974
4963
|
async ({ contactIds, fields }) => {
|
|
4975
4964
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4990,8 +4979,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4990
4979
|
"bulk_add_to_workflow",
|
|
4991
4980
|
"Enroll multiple contacts into a workflow at once. Rate-limited.",
|
|
4992
4981
|
{
|
|
4993
|
-
contactIds:
|
|
4994
|
-
workflowId:
|
|
4982
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to enroll."),
|
|
4983
|
+
workflowId: import_zod36.z.string().describe("The workflow ID to enroll contacts into.")
|
|
4995
4984
|
},
|
|
4996
4985
|
async ({ contactIds, workflowId }) => {
|
|
4997
4986
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -5012,8 +5001,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
5012
5001
|
"bulk_delete_contacts",
|
|
5013
5002
|
"Delete multiple contacts at once. IRREVERSIBLE. Rate-limited. Use with extreme caution.",
|
|
5014
5003
|
{
|
|
5015
|
-
contactIds:
|
|
5016
|
-
confirm:
|
|
5004
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to permanently delete."),
|
|
5005
|
+
confirm: import_zod36.z.literal("DELETE").describe("Must pass the string 'DELETE' to confirm. This is a safety check.")
|
|
5017
5006
|
},
|
|
5018
5007
|
async ({ contactIds, confirm }) => {
|
|
5019
5008
|
if (confirm !== "DELETE") {
|
|
@@ -5036,7 +5025,7 @@ function registerBulkOperationTools(server2, client) {
|
|
|
5036
5025
|
}
|
|
5037
5026
|
|
|
5038
5027
|
// src/tools/account-export.ts
|
|
5039
|
-
var
|
|
5028
|
+
var import_zod37 = require("zod");
|
|
5040
5029
|
function delay2(ms) {
|
|
5041
5030
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
5042
5031
|
}
|
|
@@ -5046,8 +5035,8 @@ function registerAccountExportTools(server2, client) {
|
|
|
5046
5035
|
"export_account",
|
|
5047
5036
|
"Export a complete inventory of the GHL sub-account: location info, contacts (count + sample), pipelines with stages, workflows (with full actions if builder auth is configured), funnels with pages, forms, custom fields, custom values, tags, calendars, and users. Returns a comprehensive JSON report for auditing or backup.",
|
|
5048
5037
|
{
|
|
5049
|
-
locationId:
|
|
5050
|
-
includeContacts:
|
|
5038
|
+
locationId: import_zod37.z.string().optional().describe("Location ID to export. Uses default if not specified."),
|
|
5039
|
+
includeContacts: import_zod37.z.boolean().optional().describe("Include contact list (first 100). Defaults to false for speed.")
|
|
5051
5040
|
},
|
|
5052
5041
|
async ({ locationId: locationId2, includeContacts }) => {
|
|
5053
5042
|
try {
|
|
@@ -5175,8 +5164,8 @@ function registerAccountExportTools(server2, client) {
|
|
|
5175
5164
|
"compare_locations",
|
|
5176
5165
|
"Compare two GHL sub-accounts side by side \u2014 shows differences in pipelines, workflows, custom fields, tags, forms, and funnels. Useful for ensuring consistency across locations or auditing before/after changes.",
|
|
5177
5166
|
{
|
|
5178
|
-
locationA:
|
|
5179
|
-
locationB:
|
|
5167
|
+
locationA: import_zod37.z.string().describe("First Location ID."),
|
|
5168
|
+
locationB: import_zod37.z.string().describe("Second Location ID.")
|
|
5180
5169
|
},
|
|
5181
5170
|
async ({ locationA, locationB }) => {
|
|
5182
5171
|
try {
|
|
@@ -5254,7 +5243,7 @@ function registerAccountExportTools(server2, client) {
|
|
|
5254
5243
|
}
|
|
5255
5244
|
|
|
5256
5245
|
// src/tools/workflow-cloner.ts
|
|
5257
|
-
var
|
|
5246
|
+
var import_zod38 = require("zod");
|
|
5258
5247
|
var crypto2 = __toESM(require("crypto"));
|
|
5259
5248
|
function registerWorkflowClonerTools(server2, builderClient) {
|
|
5260
5249
|
const client = builderClient;
|
|
@@ -5263,8 +5252,8 @@ function registerWorkflowClonerTools(server2, builderClient) {
|
|
|
5263
5252
|
"clone_workflow",
|
|
5264
5253
|
"Deep clone a workflow \u2014 creates an exact copy with new IDs for all actions, triggers, and references. The clone starts as a draft. Useful for creating templates or duplicating workflows across projects.",
|
|
5265
5254
|
{
|
|
5266
|
-
sourceWorkflowId:
|
|
5267
|
-
newName:
|
|
5255
|
+
sourceWorkflowId: import_zod38.z.string().describe("The workflow ID to clone."),
|
|
5256
|
+
newName: import_zod38.z.string().describe("Name for the cloned workflow.")
|
|
5268
5257
|
},
|
|
5269
5258
|
async ({ sourceWorkflowId, newName }) => {
|
|
5270
5259
|
try {
|
|
@@ -5353,41 +5342,41 @@ function registerWorkflowClonerTools(server2, builderClient) {
|
|
|
5353
5342
|
}
|
|
5354
5343
|
|
|
5355
5344
|
// src/tools/template-deployer.ts
|
|
5356
|
-
var
|
|
5345
|
+
var import_zod39 = require("zod");
|
|
5357
5346
|
var fs3 = __toESM(require("fs"));
|
|
5358
5347
|
var path3 = __toESM(require("path"));
|
|
5359
5348
|
function delay3(ms) {
|
|
5360
5349
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
5361
5350
|
}
|
|
5362
|
-
var TemplateSchema =
|
|
5363
|
-
templateName:
|
|
5364
|
-
templateVersion:
|
|
5365
|
-
description:
|
|
5366
|
-
questionnaire:
|
|
5367
|
-
id:
|
|
5368
|
-
question:
|
|
5369
|
-
type:
|
|
5370
|
-
required:
|
|
5371
|
-
placeholder:
|
|
5351
|
+
var TemplateSchema = import_zod39.z.object({
|
|
5352
|
+
templateName: import_zod39.z.string(),
|
|
5353
|
+
templateVersion: import_zod39.z.string().optional(),
|
|
5354
|
+
description: import_zod39.z.string().optional().default(""),
|
|
5355
|
+
questionnaire: import_zod39.z.array(import_zod39.z.object({
|
|
5356
|
+
id: import_zod39.z.string(),
|
|
5357
|
+
question: import_zod39.z.string(),
|
|
5358
|
+
type: import_zod39.z.string(),
|
|
5359
|
+
required: import_zod39.z.boolean().optional(),
|
|
5360
|
+
placeholder: import_zod39.z.string().optional()
|
|
5372
5361
|
})).optional().default([]),
|
|
5373
|
-
location:
|
|
5374
|
-
tags:
|
|
5375
|
-
customFields:
|
|
5376
|
-
name:
|
|
5377
|
-
dataType:
|
|
5362
|
+
location: import_zod39.z.record(import_zod39.z.unknown()).optional(),
|
|
5363
|
+
tags: import_zod39.z.array(import_zod39.z.string()).optional(),
|
|
5364
|
+
customFields: import_zod39.z.array(import_zod39.z.object({
|
|
5365
|
+
name: import_zod39.z.string(),
|
|
5366
|
+
dataType: import_zod39.z.string()
|
|
5378
5367
|
})).optional(),
|
|
5379
|
-
pipelines:
|
|
5380
|
-
name:
|
|
5381
|
-
stages:
|
|
5368
|
+
pipelines: import_zod39.z.array(import_zod39.z.object({
|
|
5369
|
+
name: import_zod39.z.string(),
|
|
5370
|
+
stages: import_zod39.z.array(import_zod39.z.object({ position: import_zod39.z.number(), name: import_zod39.z.string() }))
|
|
5382
5371
|
})).optional(),
|
|
5383
|
-
workflows:
|
|
5384
|
-
name:
|
|
5385
|
-
condition:
|
|
5386
|
-
actions:
|
|
5372
|
+
workflows: import_zod39.z.array(import_zod39.z.object({
|
|
5373
|
+
name: import_zod39.z.string(),
|
|
5374
|
+
condition: import_zod39.z.string().optional(),
|
|
5375
|
+
actions: import_zod39.z.array(import_zod39.z.record(import_zod39.z.unknown())).optional().default([])
|
|
5387
5376
|
})).optional(),
|
|
5388
|
-
calendars:
|
|
5389
|
-
name:
|
|
5390
|
-
description:
|
|
5377
|
+
calendars: import_zod39.z.array(import_zod39.z.object({
|
|
5378
|
+
name: import_zod39.z.string(),
|
|
5379
|
+
description: import_zod39.z.string().optional()
|
|
5391
5380
|
})).optional()
|
|
5392
5381
|
});
|
|
5393
5382
|
function registerTemplateDeployerTools(server2, client) {
|
|
@@ -5458,7 +5447,7 @@ function registerTemplateDeployerTools(server2, client) {
|
|
|
5458
5447
|
"get_template_questionnaire",
|
|
5459
5448
|
"Get the questionnaire for a specific template. Returns all the questions that need to be answered before deploying. Present these to the user one at a time in a conversational style.",
|
|
5460
5449
|
{
|
|
5461
|
-
templateFile:
|
|
5450
|
+
templateFile: import_zod39.z.string().describe("Path to the template JSON file (from list_templates).")
|
|
5462
5451
|
},
|
|
5463
5452
|
async ({ templateFile }) => {
|
|
5464
5453
|
try {
|
|
@@ -5491,10 +5480,10 @@ function registerTemplateDeployerTools(server2, client) {
|
|
|
5491
5480
|
"deploy_template",
|
|
5492
5481
|
"Deploy a template to set up a GHL sub-account. Creates tags, custom fields, pipelines with stages, calendars, workflows, and forms based on the template and the user's questionnaire answers. This is the main setup automation tool.",
|
|
5493
5482
|
{
|
|
5494
|
-
templateFile:
|
|
5495
|
-
answers:
|
|
5496
|
-
locationId:
|
|
5497
|
-
dryRun:
|
|
5483
|
+
templateFile: import_zod39.z.string().describe("Path to the template JSON file."),
|
|
5484
|
+
answers: import_zod39.z.record(import_zod39.z.unknown()).describe("Questionnaire answers keyed by question ID (e.g. {business_name: 'My Clinic', business_phone: '+15551234567', ...})."),
|
|
5485
|
+
locationId: import_zod39.z.string().optional().describe("Location ID to deploy to. Uses default if not specified."),
|
|
5486
|
+
dryRun: import_zod39.z.boolean().optional().describe("If true, shows what would be created without actually creating anything. Defaults to false.")
|
|
5498
5487
|
},
|
|
5499
5488
|
async ({ templateFile, answers, locationId: locationId2, dryRun }) => {
|
|
5500
5489
|
try {
|
|
@@ -5771,7 +5760,7 @@ var publicApiTools = [
|
|
|
5771
5760
|
[registerAccountExportTools, "account-export"],
|
|
5772
5761
|
[registerTemplateDeployerTools, "template-deployer"]
|
|
5773
5762
|
];
|
|
5774
|
-
function registerAllTools(server2, client, registry2) {
|
|
5763
|
+
function registerAllTools(server2, client, registry2, mcpVersion) {
|
|
5775
5764
|
for (const [register] of publicApiTools) {
|
|
5776
5765
|
register(server2, client);
|
|
5777
5766
|
}
|
|
@@ -5781,25 +5770,25 @@ function registerAllTools(server2, client, registry2) {
|
|
|
5781
5770
|
registerFormBuilderTools(server2, builderClient);
|
|
5782
5771
|
registerPipelineBuilderTools(server2, builderClient);
|
|
5783
5772
|
registerWorkflowClonerTools(server2, builderClient);
|
|
5784
|
-
registerLocationSwitcherTools(server2, client, builderClient, registry2);
|
|
5773
|
+
registerLocationSwitcherTools(server2, client, builderClient, registry2, mcpVersion);
|
|
5785
5774
|
}
|
|
5786
5775
|
|
|
5787
5776
|
// src/credentials-store.ts
|
|
5788
5777
|
var fs4 = __toESM(require("fs"));
|
|
5789
5778
|
var path4 = __toESM(require("path"));
|
|
5790
5779
|
var os = __toESM(require("os"));
|
|
5791
|
-
var
|
|
5780
|
+
var import_zod40 = require("zod");
|
|
5792
5781
|
var APP_NAME = "elitedcs-ghl-mcp";
|
|
5793
|
-
var CredentialsSchema =
|
|
5794
|
-
license_key:
|
|
5795
|
-
email:
|
|
5796
|
-
verified_at:
|
|
5797
|
-
ghl_api_key:
|
|
5798
|
-
ghl_location_id:
|
|
5799
|
-
ghl_company_id:
|
|
5800
|
-
ghl_user_id:
|
|
5801
|
-
ghl_firebase_api_key:
|
|
5802
|
-
ghl_firebase_refresh_token:
|
|
5782
|
+
var CredentialsSchema = import_zod40.z.object({
|
|
5783
|
+
license_key: import_zod40.z.string().min(1),
|
|
5784
|
+
email: import_zod40.z.string().email(),
|
|
5785
|
+
verified_at: import_zod40.z.string().min(1),
|
|
5786
|
+
ghl_api_key: import_zod40.z.string().min(1),
|
|
5787
|
+
ghl_location_id: import_zod40.z.string().min(1),
|
|
5788
|
+
ghl_company_id: import_zod40.z.string().optional(),
|
|
5789
|
+
ghl_user_id: import_zod40.z.string().optional(),
|
|
5790
|
+
ghl_firebase_api_key: import_zod40.z.string().optional(),
|
|
5791
|
+
ghl_firebase_refresh_token: import_zod40.z.string().optional()
|
|
5803
5792
|
});
|
|
5804
5793
|
function appDataDir() {
|
|
5805
5794
|
const home = os.homedir();
|
|
@@ -5849,7 +5838,7 @@ function writeCredentials(creds) {
|
|
|
5849
5838
|
// src/setup-tool.ts
|
|
5850
5839
|
var os2 = __toESM(require("os"));
|
|
5851
5840
|
var crypto3 = __toESM(require("crypto"));
|
|
5852
|
-
var
|
|
5841
|
+
var import_zod41 = require("zod");
|
|
5853
5842
|
var LICENSE_API = "https://elitedcs.com/api/validate-license";
|
|
5854
5843
|
var GHL_API = "https://services.leadconnectorhq.com";
|
|
5855
5844
|
var FIREBASE_TOKEN_API = "https://securetoken.googleapis.com/v1/token";
|
|
@@ -5920,14 +5909,14 @@ function registerSetupTool(server2) {
|
|
|
5920
5909
|
"setup_ghl_mcp",
|
|
5921
5910
|
"First-run setup for GHL Command MCP. Validates your license and GHL credentials, then writes them to a per-user credentials file. Restart Claude after this completes to load all 171 tools.",
|
|
5922
5911
|
{
|
|
5923
|
-
email:
|
|
5924
|
-
license_key:
|
|
5925
|
-
ghl_api_key:
|
|
5926
|
-
ghl_location_id:
|
|
5927
|
-
ghl_company_id:
|
|
5928
|
-
ghl_user_id:
|
|
5929
|
-
ghl_firebase_api_key:
|
|
5930
|
-
ghl_firebase_refresh_token:
|
|
5912
|
+
email: import_zod41.z.string().email().describe("Email used at purchase."),
|
|
5913
|
+
license_key: import_zod41.z.string().min(20).describe("License key from your purchase email."),
|
|
5914
|
+
ghl_api_key: import_zod41.z.string().min(10).describe("GHL Private Integration key (starts with 'pit-'). Created INSIDE the sub-account at Settings > Integrations > Private Integrations."),
|
|
5915
|
+
ghl_location_id: import_zod41.z.string().min(10).describe("GHL Location ID (sub-account ID). Found in your GHL URL: /location/THIS_PART/dashboard."),
|
|
5916
|
+
ghl_company_id: import_zod41.z.string().optional().describe("(Agency only) Company ID for multi-location access."),
|
|
5917
|
+
ghl_user_id: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase User ID. See README for browser capture instructions."),
|
|
5918
|
+
ghl_firebase_api_key: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase API Key starting with 'AIza'."),
|
|
5919
|
+
ghl_firebase_refresh_token: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase refresh token starting with 'AMf-'.")
|
|
5931
5920
|
},
|
|
5932
5921
|
async (args) => {
|
|
5933
5922
|
const lic = await validateLicense(args.email, args.license_key);
|
|
@@ -5998,6 +5987,58 @@ Note: Firebase credentials rejected (${fb.error}). Saved without Workflow Builde
|
|
|
5998
5987
|
);
|
|
5999
5988
|
}
|
|
6000
5989
|
|
|
5990
|
+
// src/version-check.ts
|
|
5991
|
+
var REGISTRY_URL = "https://registry.npmjs.org/@elitedcs/ghl-mcp/latest";
|
|
5992
|
+
async function fetchLatestVersion(timeoutMs = 5e3) {
|
|
5993
|
+
try {
|
|
5994
|
+
const response = await fetch(REGISTRY_URL, {
|
|
5995
|
+
headers: { Accept: "application/json" },
|
|
5996
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
5997
|
+
});
|
|
5998
|
+
if (!response.ok) return null;
|
|
5999
|
+
const body = await response.json();
|
|
6000
|
+
return typeof body.version === "string" ? body.version : null;
|
|
6001
|
+
} catch {
|
|
6002
|
+
return null;
|
|
6003
|
+
}
|
|
6004
|
+
}
|
|
6005
|
+
async function getVersionStatus(installed) {
|
|
6006
|
+
const latest = await fetchLatestVersion();
|
|
6007
|
+
if (latest === null) {
|
|
6008
|
+
return { installed, latest: null, upToDate: null, fetchError: "Could not reach npm registry" };
|
|
6009
|
+
}
|
|
6010
|
+
return { installed, latest, upToDate: installed === latest };
|
|
6011
|
+
}
|
|
6012
|
+
|
|
6013
|
+
// src/tools/meta.ts
|
|
6014
|
+
function registerMetaTools(server2, installedVersion) {
|
|
6015
|
+
server2.tool(
|
|
6016
|
+
"get_mcp_version",
|
|
6017
|
+
"Check the installed version of GHL Command (the GoHighLevel MCP server) against the latest version published to npm. Use this to confirm an upgrade landed after restarting Claude. Returns installed version, latest version, whether up-to-date, and the one-line restart instruction if not.",
|
|
6018
|
+
{},
|
|
6019
|
+
async () => {
|
|
6020
|
+
const status = await getVersionStatus(installedVersion);
|
|
6021
|
+
const lines = [`Installed: v${status.installed}`];
|
|
6022
|
+
if (status.latest === null) {
|
|
6023
|
+
lines.push(`Latest: unknown (${status.fetchError ?? "npm registry unreachable"})`);
|
|
6024
|
+
lines.push(`Cannot confirm whether an update is available.`);
|
|
6025
|
+
} else if (status.upToDate) {
|
|
6026
|
+
lines.push(`Latest: v${status.latest}`);
|
|
6027
|
+
lines.push(`Status: Up to date.`);
|
|
6028
|
+
} else {
|
|
6029
|
+
lines.push(`Latest: v${status.latest}`);
|
|
6030
|
+
lines.push(`Status: UPDATE AVAILABLE.`);
|
|
6031
|
+
lines.push(``);
|
|
6032
|
+
lines.push(`To upgrade: fully quit Claude Desktop (Cmd+Q on Mac, fully exit on Windows) and reopen it.`);
|
|
6033
|
+
lines.push(`The @latest tag in your config fetches the new version on next launch \u2014 no reinstall, no config edit.`);
|
|
6034
|
+
lines.push(``);
|
|
6035
|
+
lines.push(`If a restart doesn't pick up the new version, run this in a terminal once: npx clear-npx-cache`);
|
|
6036
|
+
}
|
|
6037
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
6038
|
+
}
|
|
6039
|
+
);
|
|
6040
|
+
}
|
|
6041
|
+
|
|
6001
6042
|
// src/index.ts
|
|
6002
6043
|
var pkg = require_package();
|
|
6003
6044
|
dotenv2.config();
|
|
@@ -6059,17 +6100,18 @@ var server = new import_mcp.McpServer({
|
|
|
6059
6100
|
version: pkg.version
|
|
6060
6101
|
});
|
|
6061
6102
|
var inBootstrapMode = !apiKey || !locationId;
|
|
6103
|
+
registerMetaTools(server, pkg.version);
|
|
6062
6104
|
if (inBootstrapMode) {
|
|
6063
6105
|
process.stderr.write(
|
|
6064
6106
|
`[ghl-mcp] Bootstrap mode: no credentials found.
|
|
6065
6107
|
[ghl-mcp] Looked for env vars (GHL_API_KEY, GHL_LOCATION_ID) and credentials file (${credentialsPath()}).
|
|
6066
|
-
[ghl-mcp] Only
|
|
6108
|
+
[ghl-mcp] Only setup_ghl_mcp and get_mcp_version are available. Run setup_ghl_mcp from Claude with your license + GHL credentials.
|
|
6067
6109
|
`
|
|
6068
6110
|
);
|
|
6069
6111
|
registerSetupTool(server);
|
|
6070
6112
|
} else {
|
|
6071
6113
|
const client = new GHLClient({ apiKey, locationId });
|
|
6072
|
-
registerAllTools(server, client, registry);
|
|
6114
|
+
registerAllTools(server, client, registry, pkg.version);
|
|
6073
6115
|
if (fileCreds && !process.env.GHL_API_KEY) {
|
|
6074
6116
|
process.stderr.write(`[ghl-mcp] Loaded credentials from ${credentialsPath()}
|
|
6075
6117
|
`);
|
|
@@ -6096,24 +6138,14 @@ async function validateApiKey() {
|
|
|
6096
6138
|
} catch {
|
|
6097
6139
|
}
|
|
6098
6140
|
}
|
|
6099
|
-
function checkForUpdates() {
|
|
6100
|
-
const
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
(0, import_child_process.execFile)("git", ["-C", repoDir, "rev-parse", "@{u}"], (__, remoteOut) => {
|
|
6105
|
-
if (!localOut || !remoteOut) return;
|
|
6106
|
-
const local = localOut.toString().trim();
|
|
6107
|
-
const remote = remoteOut.toString().trim();
|
|
6108
|
-
if (local !== remote) {
|
|
6109
|
-
process.stderr.write(
|
|
6110
|
-
`[ghl-mcp] Update available! Run: cd ${repoDir} && git pull && npm run build
|
|
6141
|
+
async function checkForUpdates() {
|
|
6142
|
+
const latest = await fetchLatestVersion();
|
|
6143
|
+
if (latest && latest !== pkg.version) {
|
|
6144
|
+
process.stderr.write(
|
|
6145
|
+
`[ghl-mcp] Update available: v${pkg.version} \u2192 v${latest}. Fully quit Claude (Cmd+Q on Mac) and reopen to upgrade.
|
|
6111
6146
|
`
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
});
|
|
6115
|
-
});
|
|
6116
|
-
});
|
|
6147
|
+
);
|
|
6148
|
+
}
|
|
6117
6149
|
}
|
|
6118
6150
|
async function main() {
|
|
6119
6151
|
const transport = new import_stdio.StdioServerTransport();
|