@elitedcs/ghl-mcp 3.1.1 → 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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "@elitedcs/ghl-mcp",
34
- version: "3.1.1",
34
+ version: "3.2.0",
35
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: {
@@ -382,16 +382,10 @@ var TokenRegistry = class {
382
382
  var fs2 = __toESM(require("fs"));
383
383
  var path2 = __toESM(require("path"));
384
384
  var dotenv = __toESM(require("dotenv"));
385
+ var import_zod3 = require("zod");
386
+
387
+ // src/trigger-schemas.ts
385
388
  var import_zod2 = require("zod");
386
- var BACKEND_BASE = "https://backend.leadconnectorhq.com/workflow";
387
- var FIREBASE_TOKEN_URL = "https://securetoken.googleapis.com/v1/token";
388
- var MAX_RETRIES2 = 3;
389
- var BASE_DELAY_MS2 = 500;
390
- var FirebaseTokenSchema = import_zod2.z.object({
391
- id_token: import_zod2.z.string(),
392
- refresh_token: import_zod2.z.string(),
393
- expires_in: import_zod2.z.string()
394
- });
395
389
  var TriggerActionSchema = import_zod2.z.object({
396
390
  workflow_id: import_zod2.z.string(),
397
391
  type: import_zod2.z.literal("add_to_workflow")
@@ -411,90 +405,158 @@ var TriggerCommonSchema = import_zod2.z.object({
411
405
  schedule_config: import_zod2.z.record(import_zod2.z.unknown()).optional(),
412
406
  date_updated: import_zod2.z.string().optional()
413
407
  }).passthrough();
414
- var ContactTagTriggerConditionSchema = import_zod2.z.object({
415
- operator: import_zod2.z.string(),
416
- field: import_zod2.z.enum(["tagsAdded", "tagsRemoved"]),
417
- value: import_zod2.z.string(),
418
- title: import_zod2.z.string().optional(),
419
- type: import_zod2.z.string().optional(),
420
- id: import_zod2.z.string().optional()
421
- }).passthrough();
422
- var CustomerReplyTriggerConditionSchema = import_zod2.z.object({
423
- operator: import_zod2.z.string(),
424
- field: import_zod2.z.string(),
425
- value: import_zod2.z.unknown().optional(),
426
- title: import_zod2.z.string().optional(),
427
- type: import_zod2.z.string().optional(),
428
- id: import_zod2.z.string().optional()
429
- }).passthrough();
430
- var AppointmentTriggerConditionSchema = import_zod2.z.object({
431
- operator: import_zod2.z.string(),
432
- field: import_zod2.z.string(),
433
- value: import_zod2.z.unknown().optional(),
434
- title: import_zod2.z.string().optional(),
435
- type: import_zod2.z.string().optional(),
436
- id: import_zod2.z.string().optional()
437
- }).passthrough();
438
- var PipelineStageUpdatedTriggerConditionSchema = import_zod2.z.object({
439
- operator: import_zod2.z.string(),
440
- field: import_zod2.z.string(),
441
- value: import_zod2.z.unknown().optional(),
442
- title: import_zod2.z.string().optional(),
443
- type: import_zod2.z.string().optional(),
444
- id: import_zod2.z.string().optional()
445
- }).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
+ }
446
422
  var ContactTagTriggerSchema = TriggerCommonSchema.extend({
447
423
  type: import_zod2.z.literal("contact_tag"),
448
- conditions: import_zod2.z.array(ContactTagTriggerConditionSchema)
449
- });
450
- var CustomerReplyTriggerSchema = TriggerCommonSchema.extend({
451
- type: import_zod2.z.literal("customer_reply"),
452
- conditions: import_zod2.z.array(CustomerReplyTriggerConditionSchema).optional()
453
- });
454
- var AppointmentTriggerSchema = TriggerCommonSchema.extend({
455
- type: import_zod2.z.literal("appointment"),
456
- conditions: import_zod2.z.array(AppointmentTriggerConditionSchema).optional()
457
- });
458
- var PipelineStageUpdatedTriggerSchema = TriggerCommonSchema.extend({
459
- type: import_zod2.z.literal("pipeline_stage_updated"),
460
- 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())
461
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
+ ]);
462
501
  var UnknownTriggerSchema = TriggerCommonSchema.extend({
463
502
  type: import_zod2.z.string(),
464
503
  conditions: import_zod2.z.array(import_zod2.z.record(import_zod2.z.unknown())).optional()
465
504
  });
466
505
  var WorkflowTriggerSchema = import_zod2.z.union([
506
+ // Originally typed (v3.0.x)
507
+ ContactTagTriggerSchema,
467
508
  CustomerReplyTriggerSchema,
468
509
  AppointmentTriggerSchema,
469
- ContactTagTriggerSchema,
470
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
471
522
  UnknownTriggerSchema
472
523
  ]);
473
- var WorkflowActionSchema = import_zod2.z.custom(
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(
474
536
  (value) => typeof value === "object" && value !== null && "type" in value
475
537
  );
476
- var WorkflowFullSchema = import_zod2.z.object({
477
- _id: import_zod2.z.string(),
478
- name: import_zod2.z.string(),
479
- status: import_zod2.z.string(),
480
- version: import_zod2.z.number(),
481
- dataVersion: import_zod2.z.number().optional(),
482
- timezone: import_zod2.z.string().optional(),
483
- workflowData: import_zod2.z.object({ templates: import_zod2.z.array(WorkflowActionSchema).optional() }).optional(),
484
- triggers: import_zod2.z.array(WorkflowTriggerSchema).optional(),
485
- createdAt: import_zod2.z.string().optional(),
486
- updatedAt: import_zod2.z.string().optional(),
487
- locationId: import_zod2.z.string().optional(),
488
- stopOnResponse: import_zod2.z.boolean().optional(),
489
- allowMultiple: import_zod2.z.boolean().optional(),
490
- allowMultipleOpportunity: import_zod2.z.boolean().optional(),
491
- autoMarkAsRead: import_zod2.z.boolean().optional(),
492
- removeContactFromLastStep: import_zod2.z.boolean().optional()
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()
493
555
  }).passthrough();
494
- var CreateWorkflowResponseSchema = import_zod2.z.union([
556
+ var CreateWorkflowResponseSchema = import_zod3.z.union([
495
557
  WorkflowFullSchema,
496
- import_zod2.z.object({ _id: import_zod2.z.string() }).passthrough(),
497
- import_zod2.z.object({ id: import_zod2.z.string() }).passthrough()
558
+ import_zod3.z.object({ _id: import_zod3.z.string() }).passthrough(),
559
+ import_zod3.z.object({ id: import_zod3.z.string() }).passthrough()
498
560
  ]).transform((data) => {
499
561
  const id = "_id" in data && typeof data._id === "string" ? data._id : data.id;
500
562
  return WorkflowFullSchema.parse({
@@ -975,7 +1037,7 @@ ${errorBody}`
975
1037
  };
976
1038
 
977
1039
  // src/tools/contacts.ts
978
- var import_zod4 = require("zod");
1040
+ var import_zod5 = require("zod");
979
1041
 
980
1042
  // src/tool-helpers.ts
981
1043
  function errorResponse(error) {
@@ -1012,55 +1074,55 @@ function safeTool(server2, name, description, schema, handler) {
1012
1074
  }
1013
1075
 
1014
1076
  // src/api-schemas.ts
1015
- var import_zod3 = require("zod");
1016
- var ContactSchema = import_zod3.z.object({
1017
- id: import_zod3.z.string(),
1018
- locationId: import_zod3.z.string().nullable().optional(),
1019
- firstName: import_zod3.z.string().nullable().optional(),
1020
- lastName: import_zod3.z.string().nullable().optional(),
1021
- name: import_zod3.z.string().nullable().optional(),
1022
- email: import_zod3.z.string().nullable().optional(),
1023
- phone: import_zod3.z.string().nullable().optional(),
1024
- tags: import_zod3.z.array(import_zod3.z.string()).nullable().optional(),
1025
- source: import_zod3.z.string().nullable().optional(),
1026
- dateAdded: import_zod3.z.string().nullable().optional()
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()
1027
1089
  }).passthrough();
1028
- var ContactSearchResponseSchema = import_zod3.z.object({
1029
- contacts: import_zod3.z.array(ContactSchema),
1030
- meta: import_zod3.z.object({
1031
- total: import_zod3.z.number().nullable().optional(),
1032
- count: import_zod3.z.number().nullable().optional(),
1033
- currentPage: import_zod3.z.number().nullable().optional(),
1034
- nextPage: import_zod3.z.union([import_zod3.z.number(), import_zod3.z.string()]).nullable().optional(),
1035
- prevPage: import_zod3.z.union([import_zod3.z.number(), import_zod3.z.string()]).nullable().optional(),
1036
- startAfterId: import_zod3.z.string().nullable().optional(),
1037
- startAfter: import_zod3.z.number().nullable().optional()
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()
1038
1100
  }).passthrough().optional()
1039
1101
  }).passthrough();
1040
- var ContactResponseSchema = import_zod3.z.object({
1102
+ var ContactResponseSchema = import_zod4.z.object({
1041
1103
  contact: ContactSchema
1042
1104
  }).passthrough();
1043
- var PipelineStageSchema = import_zod3.z.object({
1044
- id: import_zod3.z.string(),
1045
- name: import_zod3.z.string(),
1046
- position: import_zod3.z.number().optional()
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()
1047
1109
  }).passthrough();
1048
- var PipelineSchema = import_zod3.z.object({
1049
- id: import_zod3.z.string(),
1050
- name: import_zod3.z.string(),
1051
- stages: import_zod3.z.array(PipelineStageSchema),
1052
- locationId: import_zod3.z.string().optional()
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()
1053
1115
  }).passthrough();
1054
- var PipelinesResponseSchema = import_zod3.z.object({
1055
- pipelines: import_zod3.z.array(PipelineSchema)
1116
+ var PipelinesResponseSchema = import_zod4.z.object({
1117
+ pipelines: import_zod4.z.array(PipelineSchema)
1056
1118
  }).passthrough();
1057
- var CalendarSchema = import_zod3.z.object({
1058
- id: import_zod3.z.string(),
1059
- name: import_zod3.z.string(),
1060
- locationId: import_zod3.z.string().optional()
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()
1061
1123
  }).passthrough();
1062
- var CalendarsResponseSchema = import_zod3.z.object({
1063
- calendars: import_zod3.z.array(CalendarSchema)
1124
+ var CalendarsResponseSchema = import_zod4.z.object({
1125
+ calendars: import_zod4.z.array(CalendarSchema)
1064
1126
  }).passthrough();
1065
1127
 
1066
1128
  // src/tools/contacts.ts
@@ -1070,12 +1132,12 @@ function registerContactTools(server2, client) {
1070
1132
  "search_contacts",
1071
1133
  "Search and list contacts in a GHL location. Supports filtering by query string, pagination, and sorting.",
1072
1134
  {
1073
- locationId: import_zod4.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
1074
- query: import_zod4.z.string().optional().describe("Search query to filter contacts (searches name, email, phone, etc.)."),
1075
- limit: import_zod4.z.number().optional().describe("Maximum number of contacts to return. Defaults to 20."),
1076
- startAfterId: import_zod4.z.string().optional().describe("Contact ID to start after, for cursor-based pagination."),
1077
- sortBy: import_zod4.z.string().optional().describe("Field to sort results by (e.g. 'dateAdded', 'name')."),
1078
- sortOrder: import_zod4.z.string().optional().describe("Sort direction: 'asc' or 'desc'.")
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'.")
1079
1141
  },
1080
1142
  async ({ locationId: locationId2, query, limit, startAfterId, sortBy, sortOrder }) => {
1081
1143
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1097,7 +1159,7 @@ function registerContactTools(server2, client) {
1097
1159
  "get_contact",
1098
1160
  "Retrieve a single contact by their ID, including all profile fields, tags, and custom fields.",
1099
1161
  {
1100
- contactId: import_zod4.z.string().describe("The ID of the contact to retrieve.")
1162
+ contactId: import_zod5.z.string().describe("The ID of the contact to retrieve.")
1101
1163
  },
1102
1164
  async ({ contactId }) => {
1103
1165
  const raw = await client.get(`/contacts/${contactId}`);
@@ -1109,25 +1171,25 @@ function registerContactTools(server2, client) {
1109
1171
  "create_contact",
1110
1172
  "Create a new contact in a GHL location. At minimum, provide a locationId and at least one identifying field (name, email, or phone).",
1111
1173
  {
1112
- locationId: import_zod4.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
1113
- firstName: import_zod4.z.string().optional().describe("Contact's first name."),
1114
- lastName: import_zod4.z.string().optional().describe("Contact's last name."),
1115
- name: import_zod4.z.string().optional().describe("Contact's full name."),
1116
- email: import_zod4.z.string().optional().describe("Contact's email address."),
1117
- phone: import_zod4.z.string().optional().describe("Contact's phone number."),
1118
- tags: import_zod4.z.array(import_zod4.z.string()).optional().describe("Array of tags to assign to the contact."),
1119
- source: import_zod4.z.string().optional().describe("Lead source for the contact."),
1120
- companyName: import_zod4.z.string().optional().describe("Contact's company name."),
1121
- address1: import_zod4.z.string().optional().describe("Street address."),
1122
- city: import_zod4.z.string().optional().describe("City."),
1123
- state: import_zod4.z.string().optional().describe("State or province."),
1124
- postalCode: import_zod4.z.string().optional().describe("Postal / ZIP code."),
1125
- website: import_zod4.z.string().optional().describe("Contact's website URL."),
1126
- timezone: import_zod4.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
1127
- customFields: import_zod4.z.array(
1128
- import_zod4.z.object({
1129
- id: import_zod4.z.string().describe("Custom field ID."),
1130
- value: import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean()]).describe("Custom field 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.")
1131
1193
  })
1132
1194
  ).optional().describe("Array of custom field objects with id and value.")
1133
1195
  },
@@ -1148,25 +1210,25 @@ function registerContactTools(server2, client) {
1148
1210
  "update_contact",
1149
1211
  "Update an existing contact's fields. Only provided fields will be changed; omitted fields remain unchanged.",
1150
1212
  {
1151
- contactId: import_zod4.z.string().describe("The ID of the contact to update."),
1152
- firstName: import_zod4.z.string().optional().describe("Contact's first name."),
1153
- lastName: import_zod4.z.string().optional().describe("Contact's last name."),
1154
- name: import_zod4.z.string().optional().describe("Contact's full name."),
1155
- email: import_zod4.z.string().optional().describe("Contact's email address."),
1156
- phone: import_zod4.z.string().optional().describe("Contact's phone number."),
1157
- tags: import_zod4.z.array(import_zod4.z.string()).optional().describe("Array of tags to set on the contact (replaces existing tags)."),
1158
- source: import_zod4.z.string().optional().describe("Lead source for the contact."),
1159
- companyName: import_zod4.z.string().optional().describe("Contact's company name."),
1160
- address1: import_zod4.z.string().optional().describe("Street address."),
1161
- city: import_zod4.z.string().optional().describe("City."),
1162
- state: import_zod4.z.string().optional().describe("State or province."),
1163
- postalCode: import_zod4.z.string().optional().describe("Postal / ZIP code."),
1164
- website: import_zod4.z.string().optional().describe("Contact's website URL."),
1165
- timezone: import_zod4.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
1166
- customFields: import_zod4.z.array(
1167
- import_zod4.z.object({
1168
- id: import_zod4.z.string().describe("Custom field ID."),
1169
- value: import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean()]).describe("Custom field 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.")
1170
1232
  })
1171
1233
  ).optional().describe("Array of custom field objects with id and value.")
1172
1234
  },
@@ -1185,8 +1247,8 @@ function registerContactTools(server2, client) {
1185
1247
  "delete_contact",
1186
1248
  "Permanently delete a contact. IRREVERSIBLE.",
1187
1249
  {
1188
- contactId: import_zod4.z.string().describe("The ID of the contact to delete."),
1189
- confirm: import_zod4.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
1190
1252
  },
1191
1253
  async ({ contactId }) => {
1192
1254
  return client.delete(`/contacts/${contactId}`);
@@ -1197,25 +1259,25 @@ function registerContactTools(server2, client) {
1197
1259
  "upsert_contact",
1198
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.",
1199
1261
  {
1200
- locationId: import_zod4.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
1201
- firstName: import_zod4.z.string().optional().describe("Contact's first name."),
1202
- lastName: import_zod4.z.string().optional().describe("Contact's last name."),
1203
- name: import_zod4.z.string().optional().describe("Contact's full name."),
1204
- email: import_zod4.z.string().optional().describe("Contact's email address (used for matching)."),
1205
- phone: import_zod4.z.string().optional().describe("Contact's phone number (used for matching)."),
1206
- tags: import_zod4.z.array(import_zod4.z.string()).optional().describe("Array of tags to assign to the contact."),
1207
- source: import_zod4.z.string().optional().describe("Lead source for the contact."),
1208
- companyName: import_zod4.z.string().optional().describe("Contact's company name."),
1209
- address1: import_zod4.z.string().optional().describe("Street address."),
1210
- city: import_zod4.z.string().optional().describe("City."),
1211
- state: import_zod4.z.string().optional().describe("State or province."),
1212
- postalCode: import_zod4.z.string().optional().describe("Postal / ZIP code."),
1213
- website: import_zod4.z.string().optional().describe("Contact's website URL."),
1214
- timezone: import_zod4.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
1215
- customFields: import_zod4.z.array(
1216
- import_zod4.z.object({
1217
- id: import_zod4.z.string().describe("Custom field ID."),
1218
- value: import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean()]).describe("Custom field 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.")
1219
1281
  })
1220
1282
  ).optional().describe("Array of custom field objects with id and value.")
1221
1283
  },
@@ -1236,8 +1298,8 @@ function registerContactTools(server2, client) {
1236
1298
  "add_contact_tags",
1237
1299
  "Add one or more tags to an existing contact. Does not remove existing tags.",
1238
1300
  {
1239
- contactId: import_zod4.z.string().describe("The ID of the contact to add tags to."),
1240
- tags: import_zod4.z.array(import_zod4.z.string()).describe("Array of tag names to add to the contact.")
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.")
1241
1303
  },
1242
1304
  async ({ contactId, tags }) => {
1243
1305
  return client.post(`/contacts/${contactId}/tags`, {
@@ -1250,8 +1312,8 @@ function registerContactTools(server2, client) {
1250
1312
  "remove_contact_tags",
1251
1313
  "Remove one or more tags from an existing contact.",
1252
1314
  {
1253
- contactId: import_zod4.z.string().describe("The ID of the contact to remove tags from."),
1254
- tags: import_zod4.z.array(import_zod4.z.string()).describe("Array of tag names to remove from the contact.")
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.")
1255
1317
  },
1256
1318
  async ({ contactId, tags }) => {
1257
1319
  return client.delete(`/contacts/${contactId}/tags`, {
@@ -1264,7 +1326,7 @@ function registerContactTools(server2, client) {
1264
1326
  "get_contact_tasks",
1265
1327
  "Retrieve all tasks associated with a specific contact.",
1266
1328
  {
1267
- contactId: import_zod4.z.string().describe("The ID of the contact whose tasks to retrieve.")
1329
+ contactId: import_zod5.z.string().describe("The ID of the contact whose tasks to retrieve.")
1268
1330
  },
1269
1331
  async ({ contactId }) => {
1270
1332
  return client.get(`/contacts/${contactId}/tasks`);
@@ -1275,12 +1337,12 @@ function registerContactTools(server2, client) {
1275
1337
  "create_contact_task",
1276
1338
  "Create a new task associated with a contact (e.g. follow-up call, send proposal).",
1277
1339
  {
1278
- contactId: import_zod4.z.string().describe("The ID of the contact to create the task for."),
1279
- title: import_zod4.z.string().describe("Title / summary of the task."),
1280
- body: import_zod4.z.string().optional().describe("Detailed description of the task."),
1281
- dueDate: import_zod4.z.string().optional().describe("Due date for the task in ISO 8601 format."),
1282
- completed: import_zod4.z.boolean().optional().describe("Whether the task is already completed."),
1283
- assignedTo: import_zod4.z.string().optional().describe("User ID to assign the task to.")
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.")
1284
1346
  },
1285
1347
  async ({ contactId, title, body: taskBody, dueDate, completed, assignedTo }) => {
1286
1348
  const reqBody = { title };
@@ -1298,7 +1360,7 @@ function registerContactTools(server2, client) {
1298
1360
  "get_contact_notes",
1299
1361
  "Retrieve all notes associated with a specific contact.",
1300
1362
  {
1301
- contactId: import_zod4.z.string().describe("The ID of the contact whose notes to retrieve.")
1363
+ contactId: import_zod5.z.string().describe("The ID of the contact whose notes to retrieve.")
1302
1364
  },
1303
1365
  async ({ contactId }) => {
1304
1366
  return client.get(`/contacts/${contactId}/notes`);
@@ -1309,9 +1371,9 @@ function registerContactTools(server2, client) {
1309
1371
  "create_contact_note",
1310
1372
  "Add a note to a contact's record. Useful for logging interactions, observations, or internal memos.",
1311
1373
  {
1312
- contactId: import_zod4.z.string().describe("The ID of the contact to add the note to."),
1313
- body: import_zod4.z.string().describe("The text content of the note."),
1314
- userId: import_zod4.z.string().optional().describe("ID of the user creating the note.")
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.")
1315
1377
  },
1316
1378
  async ({ contactId, body: noteBody, userId }) => {
1317
1379
  const reqBody = { body: noteBody };
@@ -1326,7 +1388,7 @@ function registerContactTools(server2, client) {
1326
1388
  "get_contact_appointments",
1327
1389
  "Retrieve all appointments / calendar events associated with a specific contact.",
1328
1390
  {
1329
- contactId: import_zod4.z.string().describe("The ID of the contact whose appointments to retrieve.")
1391
+ contactId: import_zod5.z.string().describe("The ID of the contact whose appointments to retrieve.")
1330
1392
  },
1331
1393
  async ({ contactId }) => {
1332
1394
  return client.get(`/contacts/${contactId}/appointments`);
@@ -1337,8 +1399,8 @@ function registerContactTools(server2, client) {
1337
1399
  "add_contact_to_workflow",
1338
1400
  "Enroll a contact into an automation workflow. The contact will begin receiving the workflow's actions.",
1339
1401
  {
1340
- contactId: import_zod4.z.string().describe("The ID of the contact to add to the workflow."),
1341
- workflowId: import_zod4.z.string().describe("The ID of the workflow to enroll the contact in.")
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.")
1342
1404
  },
1343
1405
  async ({ contactId, workflowId }) => {
1344
1406
  return client.post(
@@ -1351,8 +1413,8 @@ function registerContactTools(server2, client) {
1351
1413
  "remove_contact_from_workflow",
1352
1414
  "Remove a contact from an automation workflow, stopping any pending workflow actions.",
1353
1415
  {
1354
- contactId: import_zod4.z.string().describe("The ID of the contact to remove from the workflow."),
1355
- workflowId: import_zod4.z.string().describe("The ID of the workflow to remove the contact from.")
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.")
1356
1418
  },
1357
1419
  async ({ contactId, workflowId }) => {
1358
1420
  return client.delete(
@@ -1363,20 +1425,20 @@ function registerContactTools(server2, client) {
1363
1425
  }
1364
1426
 
1365
1427
  // src/tools/conversations.ts
1366
- var import_zod5 = require("zod");
1428
+ var import_zod6 = require("zod");
1367
1429
  function registerConversationTools(server2, client) {
1368
1430
  safeTool(
1369
1431
  server2,
1370
1432
  "search_conversations",
1371
1433
  "Search conversations in GoHighLevel by various filters such as contact, assignee, status, or query string.",
1372
1434
  {
1373
- locationId: import_zod5.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
1374
- contactId: import_zod5.z.string().optional().describe("Filter conversations by contact ID."),
1375
- assignedTo: import_zod5.z.string().optional().describe("Filter conversations by the assigned user ID."),
1376
- query: import_zod5.z.string().optional().describe("Free-text search query to filter conversations."),
1377
- status: import_zod5.z.enum(["all", "read", "unread", "starred", "recents"]).optional().describe("Filter by conversation status."),
1378
- limit: import_zod5.z.number().optional().describe("Maximum number of conversations to return."),
1379
- startAfterDate: import_zod5.z.string().optional().describe("Return conversations that started after this date (ISO 8601 / epoch ms).")
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).")
1380
1442
  },
1381
1443
  async ({ locationId: locationId2, contactId, assignedTo, query, status, limit, startAfterDate }) => {
1382
1444
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1398,7 +1460,7 @@ function registerConversationTools(server2, client) {
1398
1460
  "get_conversation",
1399
1461
  "Retrieve a single conversation by its ID from GoHighLevel.",
1400
1462
  {
1401
- conversationId: import_zod5.z.string().describe("The ID of the conversation to retrieve.")
1463
+ conversationId: import_zod6.z.string().describe("The ID of the conversation to retrieve.")
1402
1464
  },
1403
1465
  async ({ conversationId }) => {
1404
1466
  return await client.get(`/conversations/${conversationId}`);
@@ -1409,8 +1471,8 @@ function registerConversationTools(server2, client) {
1409
1471
  "create_conversation",
1410
1472
  "Create a new conversation in GoHighLevel for a given contact.",
1411
1473
  {
1412
- locationId: import_zod5.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
1413
- contactId: import_zod5.z.string().describe("The contact ID to create the conversation for.")
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.")
1414
1476
  },
1415
1477
  async ({ locationId: locationId2, contactId }) => {
1416
1478
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1424,9 +1486,9 @@ function registerConversationTools(server2, client) {
1424
1486
  "get_messages",
1425
1487
  "Retrieve messages for a specific conversation from GoHighLevel.",
1426
1488
  {
1427
- conversationId: import_zod5.z.string().describe("The ID of the conversation to retrieve messages for."),
1428
- limit: import_zod5.z.number().optional().describe("Maximum number of messages to return."),
1429
- type: import_zod5.z.string().optional().describe("Filter messages by 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.")
1430
1492
  },
1431
1493
  async ({ conversationId, limit, type }) => {
1432
1494
  return await client.get(`/conversations/${conversationId}/messages`, {
@@ -1439,16 +1501,16 @@ function registerConversationTools(server2, client) {
1439
1501
  "send_message",
1440
1502
  "Send an outbound message (SMS, Email, WhatsApp, etc.) to a contact via GoHighLevel.",
1441
1503
  {
1442
- type: import_zod5.z.enum(["SMS", "Email", "WhatsApp", "GMB", "IG", "FB", "Custom", "Live_Chat"]).describe("The channel type for the outbound message."),
1443
- contactId: import_zod5.z.string().describe("The contact ID to send the message to."),
1444
- message: import_zod5.z.string().optional().describe("The message body text. Used for SMS, WhatsApp, and other chat-based channels."),
1445
- subject: import_zod5.z.string().optional().describe("Email subject line. Used when type is Email."),
1446
- html: import_zod5.z.string().optional().describe("HTML body for the email. Used when type is Email."),
1447
- emailFrom: import_zod5.z.string().optional().describe("Sender email address (for Email type)."),
1448
- emailTo: import_zod5.z.string().optional().describe("Recipient email address (for Email type)."),
1449
- emailCc: import_zod5.z.array(import_zod5.z.string()).optional().describe("CC email addresses (for Email type)."),
1450
- emailBcc: import_zod5.z.array(import_zod5.z.string()).optional().describe("BCC email addresses (for Email type)."),
1451
- attachments: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of attachment URLs to include with the message.")
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.")
1452
1514
  },
1453
1515
  async ({ type, contactId, message, subject, html, emailFrom, emailTo, emailCc, emailBcc, attachments }) => {
1454
1516
  const body = { type, contactId };
@@ -1468,10 +1530,10 @@ function registerConversationTools(server2, client) {
1468
1530
  "add_inbound_message",
1469
1531
  "Record an inbound message in a GoHighLevel conversation (e.g., from an external channel).",
1470
1532
  {
1471
- type: import_zod5.z.string().describe("The channel type of the inbound message (e.g., SMS, Email, WhatsApp)."),
1472
- conversationId: import_zod5.z.string().describe("The conversation ID to add the message to."),
1473
- conversationProviderId: import_zod5.z.string().describe("The provider ID for the conversation channel."),
1474
- message: import_zod5.z.string().describe("The inbound message body text.")
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.")
1475
1537
  },
1476
1538
  async ({ type, conversationId, conversationProviderId, message }) => {
1477
1539
  return await client.post("/conversations/messages/inbound", {
@@ -1484,9 +1546,9 @@ function registerConversationTools(server2, client) {
1484
1546
  "update_message_status",
1485
1547
  "Update the delivery/read status of a specific message in GoHighLevel.",
1486
1548
  {
1487
- messageId: import_zod5.z.string().describe("The ID of the message to update."),
1488
- status: import_zod5.z.enum(["read", "pending", "delivered", "failed"]).describe("The new status to set for the message."),
1489
- error: import_zod5.z.string().optional().describe("Error details if the status is 'failed'.")
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'.")
1490
1552
  },
1491
1553
  async ({ messageId, status, error }) => {
1492
1554
  const body = { status };
@@ -1499,7 +1561,7 @@ function registerConversationTools(server2, client) {
1499
1561
  "get_message",
1500
1562
  "Retrieve a single message by its ID from GoHighLevel.",
1501
1563
  {
1502
- messageId: import_zod5.z.string().describe("The ID of the message to retrieve.")
1564
+ messageId: import_zod6.z.string().describe("The ID of the message to retrieve.")
1503
1565
  },
1504
1566
  async ({ messageId }) => {
1505
1567
  return await client.get(`/conversations/messages/${messageId}`);
@@ -1508,30 +1570,30 @@ function registerConversationTools(server2, client) {
1508
1570
  }
1509
1571
 
1510
1572
  // src/tools/opportunities.ts
1511
- var import_zod6 = require("zod");
1512
- var statusEnum = import_zod6.z.enum(["open", "won", "lost", "abandoned"]).describe("Opportunity status");
1513
- var statusEnumWithAll = import_zod6.z.enum(["open", "won", "lost", "abandoned", "all"]).describe("Opportunity status filter (use 'all' to include every status)");
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)");
1514
1576
  function registerOpportunityTools(server2, client) {
1515
1577
  safeTool(
1516
1578
  server2,
1517
1579
  "search_opportunities",
1518
1580
  "Search opportunities in GoHighLevel with optional filters",
1519
1581
  {
1520
- locationId: import_zod6.z.string().optional().describe(
1582
+ locationId: import_zod7.z.string().optional().describe(
1521
1583
  "Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
1522
1584
  ),
1523
- pipelineId: import_zod6.z.string().optional().describe("Filter by pipeline ID"),
1524
- pipelineStageId: import_zod6.z.string().optional().describe("Filter by pipeline stage ID"),
1525
- contactId: import_zod6.z.string().optional().describe("Filter by contact ID"),
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"),
1526
1588
  status: statusEnumWithAll.optional().describe("Filter by status"),
1527
- assignedTo: import_zod6.z.string().optional().describe("Filter by assigned user ID"),
1528
- query: import_zod6.z.string().optional().describe("Search query string"),
1529
- limit: import_zod6.z.number().optional().describe("Maximum number of results to return"),
1530
- startAfter: import_zod6.z.string().optional().describe("Cursor timestamp for pagination"),
1531
- startAfterId: import_zod6.z.string().optional().describe("Cursor ID for pagination"),
1532
- order: import_zod6.z.enum(["asc", "desc"]).optional().describe("Sort order"),
1533
- endDate: import_zod6.z.string().optional().describe("End date filter (ISO string)"),
1534
- startDate: import_zod6.z.string().optional().describe("Start date filter (ISO string)")
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)")
1535
1597
  },
1536
1598
  async (args) => {
1537
1599
  const locationId2 = client.resolveLocationId(args.locationId);
@@ -1559,7 +1621,7 @@ function registerOpportunityTools(server2, client) {
1559
1621
  "get_opportunity",
1560
1622
  "Get a single opportunity by ID from GoHighLevel",
1561
1623
  {
1562
- opportunityId: import_zod6.z.string().describe("The ID of the opportunity to retrieve")
1624
+ opportunityId: import_zod7.z.string().describe("The ID of the opportunity to retrieve")
1563
1625
  },
1564
1626
  async (args) => {
1565
1627
  return await client.get(`/opportunities/${args.opportunityId}`);
@@ -1570,17 +1632,17 @@ function registerOpportunityTools(server2, client) {
1570
1632
  "create_opportunity",
1571
1633
  "Create a new opportunity in GoHighLevel",
1572
1634
  {
1573
- locationId: import_zod6.z.string().optional().describe(
1635
+ locationId: import_zod7.z.string().optional().describe(
1574
1636
  "Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
1575
1637
  ),
1576
- pipelineId: import_zod6.z.string().describe("Pipeline ID (required)"),
1577
- pipelineStageId: import_zod6.z.string().describe("Pipeline stage ID (required)"),
1578
- contactId: import_zod6.z.string().describe("Contact ID (required)"),
1579
- name: import_zod6.z.string().describe("Opportunity name (required)"),
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)"),
1580
1642
  status: statusEnum.optional().describe("Opportunity status"),
1581
- monetaryValue: import_zod6.z.number().optional().describe("Monetary value of the opportunity"),
1582
- assignedTo: import_zod6.z.string().optional().describe("User ID to assign the opportunity to"),
1583
- source: import_zod6.z.string().optional().describe("Lead 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")
1584
1646
  },
1585
1647
  async (args) => {
1586
1648
  const locationId2 = client.resolveLocationId(args.locationId);
@@ -1604,14 +1666,14 @@ function registerOpportunityTools(server2, client) {
1604
1666
  "update_opportunity",
1605
1667
  "Update an existing opportunity in GoHighLevel",
1606
1668
  {
1607
- opportunityId: import_zod6.z.string().describe("The ID of the opportunity to update"),
1608
- pipelineId: import_zod6.z.string().optional().describe("Pipeline ID"),
1609
- pipelineStageId: import_zod6.z.string().optional().describe("Pipeline stage ID"),
1610
- name: import_zod6.z.string().optional().describe("Opportunity 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"),
1611
1673
  status: statusEnum.optional().describe("Opportunity status"),
1612
- monetaryValue: import_zod6.z.number().optional().describe("Monetary value of the opportunity"),
1613
- assignedTo: import_zod6.z.string().optional().describe("User ID to assign the opportunity to"),
1614
- source: import_zod6.z.string().optional().describe("Lead 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")
1615
1677
  },
1616
1678
  async (args) => {
1617
1679
  const body = {};
@@ -1634,8 +1696,8 @@ function registerOpportunityTools(server2, client) {
1634
1696
  "delete_opportunity",
1635
1697
  "Permanently delete an opportunity. IRREVERSIBLE.",
1636
1698
  {
1637
- opportunityId: import_zod6.z.string().describe("The ID of the opportunity to delete"),
1638
- confirm: import_zod6.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
1639
1701
  },
1640
1702
  async (args) => {
1641
1703
  return await client.delete(`/opportunities/${args.opportunityId}`);
@@ -1646,7 +1708,7 @@ function registerOpportunityTools(server2, client) {
1646
1708
  "update_opportunity_status",
1647
1709
  "Update only the status of an opportunity in GoHighLevel",
1648
1710
  {
1649
- opportunityId: import_zod6.z.string().describe("The ID of the opportunity to update"),
1711
+ opportunityId: import_zod7.z.string().describe("The ID of the opportunity to update"),
1650
1712
  status: statusEnum.describe("New status for the opportunity")
1651
1713
  },
1652
1714
  async (args) => {
@@ -1661,7 +1723,7 @@ function registerOpportunityTools(server2, client) {
1661
1723
  "get_pipelines",
1662
1724
  "List all pipelines for a location in GoHighLevel",
1663
1725
  {
1664
- locationId: import_zod6.z.string().optional().describe(
1726
+ locationId: import_zod7.z.string().optional().describe(
1665
1727
  "Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
1666
1728
  )
1667
1729
  },
@@ -1676,14 +1738,14 @@ function registerOpportunityTools(server2, client) {
1676
1738
  }
1677
1739
 
1678
1740
  // src/tools/calendars.ts
1679
- var import_zod7 = require("zod");
1741
+ var import_zod8 = require("zod");
1680
1742
  function registerCalendarTools(server2, client) {
1681
1743
  safeTool(
1682
1744
  server2,
1683
1745
  "get_calendars",
1684
1746
  "List all calendars for a location",
1685
1747
  {
1686
- locationId: import_zod7.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)")
1748
+ locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)")
1687
1749
  },
1688
1750
  async ({ locationId: locationId2 }) => {
1689
1751
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1698,7 +1760,7 @@ function registerCalendarTools(server2, client) {
1698
1760
  "get_calendar",
1699
1761
  "Get a single calendar by ID",
1700
1762
  {
1701
- calendarId: import_zod7.z.string().describe("The calendar ID")
1763
+ calendarId: import_zod8.z.string().describe("The calendar ID")
1702
1764
  },
1703
1765
  async ({ calendarId }) => {
1704
1766
  return await client.get(`/calendars/${calendarId}`);
@@ -1709,19 +1771,19 @@ function registerCalendarTools(server2, client) {
1709
1771
  "create_calendar",
1710
1772
  "Create a new calendar",
1711
1773
  {
1712
- locationId: import_zod7.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
1713
- name: import_zod7.z.string().describe("Calendar name"),
1714
- description: import_zod7.z.string().optional().describe("Calendar description"),
1715
- slug: import_zod7.z.string().optional().describe("Calendar slug"),
1716
- widgetSlug: import_zod7.z.string().optional().describe("Widget slug for embedding"),
1717
- calendarType: import_zod7.z.string().optional().describe("Calendar type"),
1718
- teamMembers: import_zod7.z.array(import_zod7.z.record(import_zod7.z.unknown())).optional().describe("Array of team member objects"),
1719
- eventTitle: import_zod7.z.string().optional().describe("Default event title"),
1720
- eventColor: import_zod7.z.string().optional().describe("Event color hex code"),
1721
- slotDuration: import_zod7.z.number().optional().describe("Slot duration in minutes"),
1722
- slotBuffer: import_zod7.z.number().optional().describe("Buffer time between slots in minutes"),
1723
- slotInterval: import_zod7.z.number().optional().describe("Slot interval in minutes"),
1724
- appointmentPerSlot: import_zod7.z.number().optional().describe("Max appointments per slot")
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")
1725
1787
  },
1726
1788
  async ({ locationId: locationId2, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
1727
1789
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1748,19 +1810,19 @@ function registerCalendarTools(server2, client) {
1748
1810
  "update_calendar",
1749
1811
  "Update an existing calendar",
1750
1812
  {
1751
- calendarId: import_zod7.z.string().describe("The calendar ID to update"),
1752
- name: import_zod7.z.string().optional().describe("Calendar name"),
1753
- description: import_zod7.z.string().optional().describe("Calendar description"),
1754
- slug: import_zod7.z.string().optional().describe("Calendar slug"),
1755
- widgetSlug: import_zod7.z.string().optional().describe("Widget slug for embedding"),
1756
- calendarType: import_zod7.z.string().optional().describe("Calendar type"),
1757
- teamMembers: import_zod7.z.array(import_zod7.z.record(import_zod7.z.unknown())).optional().describe("Array of team member objects"),
1758
- eventTitle: import_zod7.z.string().optional().describe("Default event title"),
1759
- eventColor: import_zod7.z.string().optional().describe("Event color hex code"),
1760
- slotDuration: import_zod7.z.number().optional().describe("Slot duration in minutes"),
1761
- slotBuffer: import_zod7.z.number().optional().describe("Buffer time between slots in minutes"),
1762
- slotInterval: import_zod7.z.number().optional().describe("Slot interval in minutes"),
1763
- appointmentPerSlot: import_zod7.z.number().optional().describe("Max appointments per slot")
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")
1764
1826
  },
1765
1827
  async ({ calendarId, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
1766
1828
  const body = {};
@@ -1784,8 +1846,8 @@ function registerCalendarTools(server2, client) {
1784
1846
  "delete_calendar",
1785
1847
  "Permanently delete a calendar. IRREVERSIBLE.",
1786
1848
  {
1787
- calendarId: import_zod7.z.string().describe("The calendar ID to delete"),
1788
- confirm: import_zod7.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
1789
1851
  },
1790
1852
  async ({ calendarId }) => {
1791
1853
  return await client.delete(`/calendars/${calendarId}`);
@@ -1796,11 +1858,11 @@ function registerCalendarTools(server2, client) {
1796
1858
  "get_free_slots",
1797
1859
  "Get available free slots for a calendar",
1798
1860
  {
1799
- calendarId: import_zod7.z.string().describe("The calendar ID"),
1800
- startDate: import_zod7.z.string().describe("Start date in ISO format (YYYY-MM-DD)"),
1801
- endDate: import_zod7.z.string().describe("End date in ISO format (YYYY-MM-DD)"),
1802
- timezone: import_zod7.z.string().optional().describe("Timezone (e.g. America/New_York)"),
1803
- userId: import_zod7.z.string().optional().describe("Filter by user ID")
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")
1804
1866
  },
1805
1867
  async ({ calendarId, startDate, endDate, timezone, userId }) => {
1806
1868
  const params = { startDate, endDate };
@@ -1816,11 +1878,11 @@ function registerCalendarTools(server2, client) {
1816
1878
  "get_calendar_events",
1817
1879
  "List calendar events for a location within a time range",
1818
1880
  {
1819
- locationId: import_zod7.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
1820
- startTime: import_zod7.z.string().describe("Start time in ISO format"),
1821
- endTime: import_zod7.z.string().describe("End time in ISO format"),
1822
- calendarId: import_zod7.z.string().optional().describe("Filter by calendar ID"),
1823
- userId: import_zod7.z.string().optional().describe("Filter by user ID")
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")
1824
1886
  },
1825
1887
  async ({ locationId: locationId2, startTime, endTime, calendarId, userId }) => {
1826
1888
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1839,7 +1901,7 @@ function registerCalendarTools(server2, client) {
1839
1901
  "get_appointment",
1840
1902
  "Get a single appointment by event ID",
1841
1903
  {
1842
- eventId: import_zod7.z.string().describe("The appointment event ID")
1904
+ eventId: import_zod8.z.string().describe("The appointment event ID")
1843
1905
  },
1844
1906
  async ({ eventId }) => {
1845
1907
  return await client.get(
@@ -1852,17 +1914,17 @@ function registerCalendarTools(server2, client) {
1852
1914
  "create_appointment",
1853
1915
  "Create a new appointment",
1854
1916
  {
1855
- calendarId: import_zod7.z.string().describe("The calendar ID to book into"),
1856
- locationId: import_zod7.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
1857
- contactId: import_zod7.z.string().describe("The contact ID for the appointment"),
1858
- startTime: import_zod7.z.string().describe("Start time in ISO format"),
1859
- endTime: import_zod7.z.string().describe("End time in ISO format"),
1860
- title: import_zod7.z.string().optional().describe("Appointment title"),
1861
- appointmentStatus: import_zod7.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
1862
- assignedUserId: import_zod7.z.string().optional().describe("Assigned user ID"),
1863
- address: import_zod7.z.string().optional().describe("Appointment address"),
1864
- notes: import_zod7.z.string().optional().describe("Appointment notes"),
1865
- toNotify: import_zod7.z.boolean().optional().describe("Whether to send notifications")
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")
1866
1928
  },
1867
1929
  async ({ calendarId, locationId: locationId2, contactId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
1868
1930
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -1889,16 +1951,16 @@ function registerCalendarTools(server2, client) {
1889
1951
  "update_appointment",
1890
1952
  "Update an existing appointment",
1891
1953
  {
1892
- eventId: import_zod7.z.string().describe("The appointment event ID to update"),
1893
- calendarId: import_zod7.z.string().optional().describe("Calendar ID"),
1894
- startTime: import_zod7.z.string().optional().describe("Start time in ISO format"),
1895
- endTime: import_zod7.z.string().optional().describe("End time in ISO format"),
1896
- title: import_zod7.z.string().optional().describe("Appointment title"),
1897
- appointmentStatus: import_zod7.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
1898
- assignedUserId: import_zod7.z.string().optional().describe("Assigned user ID"),
1899
- address: import_zod7.z.string().optional().describe("Appointment address"),
1900
- notes: import_zod7.z.string().optional().describe("Appointment notes"),
1901
- toNotify: import_zod7.z.boolean().optional().describe("Whether to send notifications")
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")
1902
1964
  },
1903
1965
  async ({ eventId, calendarId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
1904
1966
  const body = {};
@@ -1922,8 +1984,8 @@ function registerCalendarTools(server2, client) {
1922
1984
  "delete_appointment",
1923
1985
  "Permanently delete an appointment. IRREVERSIBLE.",
1924
1986
  {
1925
- eventId: import_zod7.z.string().describe("The appointment event ID to delete"),
1926
- confirm: import_zod7.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
1927
1989
  },
1928
1990
  async ({ eventId }) => {
1929
1991
  return await client.delete(
@@ -1934,14 +1996,14 @@ function registerCalendarTools(server2, client) {
1934
1996
  }
1935
1997
 
1936
1998
  // src/tools/locations.ts
1937
- var import_zod8 = require("zod");
1999
+ var import_zod9 = require("zod");
1938
2000
  function registerLocationTools(server2, client) {
1939
2001
  safeTool(
1940
2002
  server2,
1941
2003
  "get_location",
1942
2004
  "Retrieve a single location (sub-account) by its ID from GoHighLevel.",
1943
2005
  {
1944
- locationId: import_zod8.z.string().describe("The ID of the location to retrieve.")
2006
+ locationId: import_zod9.z.string().describe("The ID of the location to retrieve.")
1945
2007
  },
1946
2008
  async ({ locationId: locationId2 }) => {
1947
2009
  return await client.get(`/locations/${locationId2}`);
@@ -1952,18 +2014,18 @@ function registerLocationTools(server2, client) {
1952
2014
  "update_location",
1953
2015
  "Update a location (sub-account) in GoHighLevel. Only provided fields will be updated.",
1954
2016
  {
1955
- locationId: import_zod8.z.string().describe("The ID of the location to update."),
1956
- name: import_zod8.z.string().optional().describe("Business name."),
1957
- address: import_zod8.z.string().optional().describe("Street address."),
1958
- city: import_zod8.z.string().optional().describe("City."),
1959
- state: import_zod8.z.string().optional().describe("State or province."),
1960
- postalCode: import_zod8.z.string().optional().describe("Postal / ZIP code."),
1961
- country: import_zod8.z.string().optional().describe("Country (e.g., 'US')."),
1962
- website: import_zod8.z.string().optional().describe("Website URL."),
1963
- timezone: import_zod8.z.string().optional().describe("IANA timezone (e.g., 'America/New_York')."),
1964
- phone: import_zod8.z.string().optional().describe("Phone number."),
1965
- email: import_zod8.z.string().optional().describe("Email address."),
1966
- settings: import_zod8.z.record(import_zod8.z.unknown()).optional().describe("Location settings object with key-value pairs.")
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.")
1967
2029
  },
1968
2030
  async ({ locationId: locationId2, name, address, city, state, postalCode, country, website, timezone, phone, email, settings }) => {
1969
2031
  const body = {};
@@ -1986,11 +2048,11 @@ function registerLocationTools(server2, client) {
1986
2048
  "search_locations",
1987
2049
  "Search locations (sub-accounts) under an agency in GoHighLevel. Requires companyId (agency-level).",
1988
2050
  {
1989
- companyId: import_zod8.z.string().describe("The agency / company ID (required for agency-level search)."),
1990
- limit: import_zod8.z.number().optional().describe("Maximum number of locations to return."),
1991
- skip: import_zod8.z.number().optional().describe("Number of locations to skip for pagination."),
1992
- order: import_zod8.z.string().optional().describe("Sort order (e.g., 'asc' or 'desc')."),
1993
- isActive: import_zod8.z.boolean().optional().describe("Filter by active status.")
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.")
1994
2056
  },
1995
2057
  async ({ companyId, limit, skip, order, isActive }) => {
1996
2058
  return await client.get("/locations/search", {
@@ -2003,9 +2065,9 @@ function registerLocationTools(server2, client) {
2003
2065
  "get_location_tags",
2004
2066
  "Retrieve tags for a location in GoHighLevel.",
2005
2067
  {
2006
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2007
- limit: import_zod8.z.number().optional().describe("Maximum number of tags to return."),
2008
- skip: import_zod8.z.number().optional().describe("Number of tags to skip for pagination.")
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.")
2009
2071
  },
2010
2072
  async ({ locationId: locationId2, limit, skip }) => {
2011
2073
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2019,8 +2081,8 @@ function registerLocationTools(server2, client) {
2019
2081
  "create_location_tag",
2020
2082
  "Create a new tag for a location in GoHighLevel.",
2021
2083
  {
2022
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2023
- name: import_zod8.z.string().describe("The name of the tag to create.")
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.")
2024
2086
  },
2025
2087
  async ({ locationId: locationId2, name }) => {
2026
2088
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2034,9 +2096,9 @@ function registerLocationTools(server2, client) {
2034
2096
  "update_location_tag",
2035
2097
  "Update an existing tag for a location in GoHighLevel.",
2036
2098
  {
2037
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2038
- tagId: import_zod8.z.string().describe("The ID of the tag to update."),
2039
- name: import_zod8.z.string().describe("The new name for the tag.")
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.")
2040
2102
  },
2041
2103
  async ({ locationId: locationId2, tagId, name }) => {
2042
2104
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2050,8 +2112,8 @@ function registerLocationTools(server2, client) {
2050
2112
  "delete_location_tag",
2051
2113
  "Delete a tag from a location in GoHighLevel.",
2052
2114
  {
2053
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2054
- tagId: import_zod8.z.string().describe("The ID of the tag to delete.")
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.")
2055
2117
  },
2056
2118
  async ({ locationId: locationId2, tagId }) => {
2057
2119
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2063,7 +2125,7 @@ function registerLocationTools(server2, client) {
2063
2125
  "get_custom_fields",
2064
2126
  "Retrieve custom fields for a location in GoHighLevel.",
2065
2127
  {
2066
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2128
+ locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2067
2129
  },
2068
2130
  async ({ locationId: locationId2 }) => {
2069
2131
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2075,9 +2137,9 @@ function registerLocationTools(server2, client) {
2075
2137
  "create_custom_field",
2076
2138
  "Create a new custom field for a location in GoHighLevel.",
2077
2139
  {
2078
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2079
- name: import_zod8.z.string().describe("The name of the custom field."),
2080
- dataType: import_zod8.z.enum([
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([
2081
2143
  "TEXT",
2082
2144
  "LARGE_TEXT",
2083
2145
  "NUMERICAL",
@@ -2092,10 +2154,10 @@ function registerLocationTools(server2, client) {
2092
2154
  "FILE_UPLOAD",
2093
2155
  "SIGNATURE"
2094
2156
  ]).describe("The data type of the custom field."),
2095
- placeholder: import_zod8.z.string().optional().describe("Placeholder text for the field."),
2096
- position: import_zod8.z.number().optional().describe("Display position / sort order of the field."),
2097
- options: import_zod8.z.array(import_zod8.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
2098
- model: import_zod8.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to. Defaults to contact.")
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.")
2099
2161
  },
2100
2162
  async ({ locationId: locationId2, name, dataType, placeholder, position, options, model }) => {
2101
2163
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2112,10 +2174,10 @@ function registerLocationTools(server2, client) {
2112
2174
  "update_custom_field",
2113
2175
  "Update an existing custom field for a location in GoHighLevel.",
2114
2176
  {
2115
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2116
- fieldId: import_zod8.z.string().describe("The ID of the custom field to update."),
2117
- name: import_zod8.z.string().optional().describe("The name of the custom field."),
2118
- dataType: import_zod8.z.enum([
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([
2119
2181
  "TEXT",
2120
2182
  "LARGE_TEXT",
2121
2183
  "NUMERICAL",
@@ -2130,10 +2192,10 @@ function registerLocationTools(server2, client) {
2130
2192
  "FILE_UPLOAD",
2131
2193
  "SIGNATURE"
2132
2194
  ]).optional().describe("The data type of the custom field."),
2133
- placeholder: import_zod8.z.string().optional().describe("Placeholder text for the field."),
2134
- position: import_zod8.z.number().optional().describe("Display position / sort order of the field."),
2135
- options: import_zod8.z.array(import_zod8.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
2136
- model: import_zod8.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to.")
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.")
2137
2199
  },
2138
2200
  async ({ locationId: locationId2, fieldId, name, dataType, placeholder, position, options, model }) => {
2139
2201
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2152,8 +2214,8 @@ function registerLocationTools(server2, client) {
2152
2214
  "delete_custom_field",
2153
2215
  "Delete a custom field from a location in GoHighLevel.",
2154
2216
  {
2155
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2156
- fieldId: import_zod8.z.string().describe("The ID of the custom field to delete.")
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.")
2157
2219
  },
2158
2220
  async ({ locationId: locationId2, fieldId }) => {
2159
2221
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2165,7 +2227,7 @@ function registerLocationTools(server2, client) {
2165
2227
  "get_custom_values",
2166
2228
  "Retrieve custom values for a location in GoHighLevel.",
2167
2229
  {
2168
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2230
+ locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2169
2231
  },
2170
2232
  async ({ locationId: locationId2 }) => {
2171
2233
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2177,9 +2239,9 @@ function registerLocationTools(server2, client) {
2177
2239
  "create_custom_value",
2178
2240
  "Create a new custom value for a location in GoHighLevel.",
2179
2241
  {
2180
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2181
- name: import_zod8.z.string().describe("The name / key of the custom value."),
2182
- value: import_zod8.z.string().describe("The value to set.")
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.")
2183
2245
  },
2184
2246
  async ({ locationId: locationId2, name, value }) => {
2185
2247
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2193,10 +2255,10 @@ function registerLocationTools(server2, client) {
2193
2255
  "update_custom_value",
2194
2256
  "Update an existing custom value for a location in GoHighLevel.",
2195
2257
  {
2196
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2197
- valueId: import_zod8.z.string().describe("The ID of the custom value to update."),
2198
- name: import_zod8.z.string().optional().describe("The new name / key of the custom value."),
2199
- value: import_zod8.z.string().optional().describe("The new value to set.")
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.")
2200
2262
  },
2201
2263
  async ({ locationId: locationId2, valueId, name, value }) => {
2202
2264
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2211,8 +2273,8 @@ function registerLocationTools(server2, client) {
2211
2273
  "delete_custom_value",
2212
2274
  "Delete a custom value from a location in GoHighLevel.",
2213
2275
  {
2214
- locationId: import_zod8.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
2215
- valueId: import_zod8.z.string().describe("The ID of the custom value to delete.")
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.")
2216
2278
  },
2217
2279
  async ({ locationId: locationId2, valueId }) => {
2218
2280
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2222,14 +2284,14 @@ function registerLocationTools(server2, client) {
2222
2284
  }
2223
2285
 
2224
2286
  // src/tools/workflows.ts
2225
- var import_zod9 = require("zod");
2287
+ var import_zod10 = require("zod");
2226
2288
  function registerWorkflowTools(server2, client) {
2227
2289
  safeTool(
2228
2290
  server2,
2229
2291
  "get_workflows",
2230
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.",
2231
2293
  {
2232
- locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2294
+ locationId: import_zod10.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
2233
2295
  },
2234
2296
  async ({ locationId: locationId2 }) => {
2235
2297
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2241,16 +2303,16 @@ function registerWorkflowTools(server2, client) {
2241
2303
  }
2242
2304
 
2243
2305
  // src/tools/funnels.ts
2244
- var import_zod10 = require("zod");
2306
+ var import_zod11 = require("zod");
2245
2307
  function registerFunnelTools(server2, client) {
2246
2308
  safeTool(
2247
2309
  server2,
2248
2310
  "get_funnels",
2249
2311
  "List funnels for a location. Offset-based pagination via limit/offset.",
2250
2312
  {
2251
- locationId: import_zod10.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2252
- limit: import_zod10.z.number().optional().describe("Max number of funnels to return"),
2253
- offset: import_zod10.z.number().optional().describe("Offset for pagination")
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")
2254
2316
  },
2255
2317
  async ({ locationId: locationId2, limit, offset }) => {
2256
2318
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2265,10 +2327,10 @@ function registerFunnelTools(server2, client) {
2265
2327
  "get_funnel_pages",
2266
2328
  "List pages for a specific funnel. Offset-based pagination via limit/offset.",
2267
2329
  {
2268
- locationId: import_zod10.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2269
- funnelId: import_zod10.z.string().describe("The funnel ID"),
2270
- limit: import_zod10.z.number().optional().describe("Max number of pages to return"),
2271
- offset: import_zod10.z.number().optional().describe("Offset for pagination")
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")
2272
2334
  },
2273
2335
  async ({ locationId: locationId2, funnelId, limit, offset }) => {
2274
2336
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2284,17 +2346,17 @@ function registerFunnelTools(server2, client) {
2284
2346
  }
2285
2347
 
2286
2348
  // src/tools/forms.ts
2287
- var import_zod11 = require("zod");
2349
+ var import_zod12 = require("zod");
2288
2350
  function registerFormTools(server2, client) {
2289
2351
  safeTool(
2290
2352
  server2,
2291
2353
  "get_forms",
2292
2354
  "List forms for a location",
2293
2355
  {
2294
- locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2295
- limit: import_zod11.z.number().optional().describe("Max number of forms to return"),
2296
- skip: import_zod11.z.number().optional().describe("Number of forms to skip"),
2297
- type: import_zod11.z.string().optional().describe("Filter by form 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")
2298
2360
  },
2299
2361
  async ({ locationId: locationId2, limit, skip, type }) => {
2300
2362
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2310,13 +2372,13 @@ function registerFormTools(server2, client) {
2310
2372
  "get_form_submissions",
2311
2373
  "List form submissions for a location. Page-based pagination via page/limit (page starts at 1).",
2312
2374
  {
2313
- locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2314
- page: import_zod11.z.number().optional().describe("Page number for pagination"),
2315
- limit: import_zod11.z.number().optional().describe("Max number of submissions to return"),
2316
- formId: import_zod11.z.string().optional().describe("Filter by specific form ID"),
2317
- q: import_zod11.z.string().optional().describe("Search query"),
2318
- startAt: import_zod11.z.string().optional().describe("Start date filter (ISO string)"),
2319
- endAt: import_zod11.z.string().optional().describe("End date filter (ISO string)")
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)")
2320
2382
  },
2321
2383
  async ({ locationId: locationId2, page, limit, formId, q, startAt, endAt }) => {
2322
2384
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2333,16 +2395,16 @@ function registerFormTools(server2, client) {
2333
2395
  }
2334
2396
 
2335
2397
  // src/tools/surveys.ts
2336
- var import_zod12 = require("zod");
2398
+ var import_zod13 = require("zod");
2337
2399
  function registerSurveyTools(server2, client) {
2338
2400
  safeTool(
2339
2401
  server2,
2340
2402
  "get_surveys",
2341
2403
  "List surveys for a location",
2342
2404
  {
2343
- locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2344
- limit: import_zod12.z.number().optional().describe("Max number of surveys to return"),
2345
- skip: import_zod12.z.number().optional().describe("Number of surveys to 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")
2346
2408
  },
2347
2409
  async ({ locationId: locationId2, limit, skip }) => {
2348
2410
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2357,13 +2419,13 @@ function registerSurveyTools(server2, client) {
2357
2419
  "get_survey_submissions",
2358
2420
  "List survey submissions for a location. Page-based pagination via page/limit (page starts at 1).",
2359
2421
  {
2360
- locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2361
- page: import_zod12.z.number().optional().describe("Page number for pagination"),
2362
- limit: import_zod12.z.number().optional().describe("Max number of submissions to return"),
2363
- surveyId: import_zod12.z.string().optional().describe("Filter by specific survey ID"),
2364
- q: import_zod12.z.string().optional().describe("Search query"),
2365
- startAt: import_zod12.z.string().optional().describe("Start date filter (ISO string)"),
2366
- endAt: import_zod12.z.string().optional().describe("End date filter (ISO string)")
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)")
2367
2429
  },
2368
2430
  async ({ locationId: locationId2, page, limit, surveyId, q, startAt, endAt }) => {
2369
2431
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2380,22 +2442,22 @@ function registerSurveyTools(server2, client) {
2380
2442
  }
2381
2443
 
2382
2444
  // src/tools/payments.ts
2383
- var import_zod13 = require("zod");
2445
+ var import_zod14 = require("zod");
2384
2446
  function registerPaymentTools(server2, client) {
2385
2447
  safeTool(
2386
2448
  server2,
2387
2449
  "get_orders",
2388
2450
  "List orders for a location. Offset-based pagination via limit/offset.",
2389
2451
  {
2390
- locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2391
- limit: import_zod13.z.number().optional().describe("Max number of orders to return"),
2392
- offset: import_zod13.z.number().optional().describe("Offset for pagination"),
2393
- startAt: import_zod13.z.string().optional().describe("Start date filter (ISO 8601)"),
2394
- endAt: import_zod13.z.string().optional().describe("End date filter (ISO 8601)"),
2395
- search: import_zod13.z.string().optional().describe("Search term"),
2396
- contactId: import_zod13.z.string().optional().describe("Filter by contact ID"),
2397
- paymentMode: import_zod13.z.string().optional().describe("Filter by payment mode"),
2398
- status: import_zod13.z.string().optional().describe("Filter by order 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")
2399
2461
  },
2400
2462
  async ({ locationId: locationId2, limit, offset, startAt, endAt, search, contactId, paymentMode, status }) => {
2401
2463
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2420,8 +2482,8 @@ function registerPaymentTools(server2, client) {
2420
2482
  "get_order",
2421
2483
  "Get a specific order by ID",
2422
2484
  {
2423
- locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2424
- orderId: import_zod13.z.string().describe("The order ID")
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")
2425
2487
  },
2426
2488
  async ({ locationId: locationId2, orderId }) => {
2427
2489
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2437,12 +2499,12 @@ function registerPaymentTools(server2, client) {
2437
2499
  "get_subscriptions",
2438
2500
  "List subscriptions for a location. Offset-based pagination via limit/offset.",
2439
2501
  {
2440
- locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2441
- limit: import_zod13.z.number().optional().describe("Max number of subscriptions to return"),
2442
- offset: import_zod13.z.number().optional().describe("Offset for pagination"),
2443
- search: import_zod13.z.string().optional().describe("Search term"),
2444
- contactId: import_zod13.z.string().optional().describe("Filter by contact ID"),
2445
- entityId: import_zod13.z.string().optional().describe("Filter by entity ID")
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")
2446
2508
  },
2447
2509
  async ({ locationId: locationId2, limit, offset, search, contactId, entityId }) => {
2448
2510
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2463,16 +2525,16 @@ function registerPaymentTools(server2, client) {
2463
2525
  "get_transactions",
2464
2526
  "List transactions for a location. Offset-based pagination via limit/offset.",
2465
2527
  {
2466
- locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2467
- limit: import_zod13.z.number().optional().describe("Max number of transactions to return"),
2468
- offset: import_zod13.z.number().optional().describe("Offset for pagination"),
2469
- startAt: import_zod13.z.string().optional().describe("Start date filter (ISO 8601)"),
2470
- endAt: import_zod13.z.string().optional().describe("End date filter (ISO 8601)"),
2471
- search: import_zod13.z.string().optional().describe("Search term"),
2472
- entityId: import_zod13.z.string().optional().describe("Filter by entity ID"),
2473
- paymentMode: import_zod13.z.string().optional().describe("Filter by payment mode"),
2474
- contactId: import_zod13.z.string().optional().describe("Filter by contact ID"),
2475
- subscriptionId: import_zod13.z.string().optional().describe("Filter by subscription ID")
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")
2476
2538
  },
2477
2539
  async ({ locationId: locationId2, limit, offset, startAt, endAt, search, entityId, paymentMode, contactId, subscriptionId }) => {
2478
2540
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2495,21 +2557,21 @@ function registerPaymentTools(server2, client) {
2495
2557
  }
2496
2558
 
2497
2559
  // src/tools/invoices.ts
2498
- var import_zod14 = require("zod");
2560
+ var import_zod15 = require("zod");
2499
2561
  function registerInvoiceTools(server2, client) {
2500
2562
  safeTool(
2501
2563
  server2,
2502
2564
  "list_invoices",
2503
2565
  "List invoices for a location. Offset-based pagination via limit/offset.",
2504
2566
  {
2505
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2506
- limit: import_zod14.z.number().optional().describe("Max number of invoices to return"),
2507
- offset: import_zod14.z.number().optional().describe("Offset for pagination"),
2508
- status: import_zod14.z.enum(["draft", "sent", "paid", "void", "partially_paid"]).optional().describe("Filter by invoice status"),
2509
- contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
2510
- startAt: import_zod14.z.string().optional().describe("Start date filter (ISO 8601)"),
2511
- endAt: import_zod14.z.string().optional().describe("End date filter (ISO 8601)"),
2512
- search: import_zod14.z.string().optional().describe("Search term")
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")
2513
2575
  },
2514
2576
  async ({ locationId: locationId2, limit, offset, status, contactId, startAt, endAt, search }) => {
2515
2577
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2533,8 +2595,8 @@ function registerInvoiceTools(server2, client) {
2533
2595
  "get_invoice",
2534
2596
  "Get a specific invoice by ID",
2535
2597
  {
2536
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2537
- invoiceId: import_zod14.z.string().describe("The invoice ID")
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")
2538
2600
  },
2539
2601
  async ({ locationId: locationId2, invoiceId }) => {
2540
2602
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2550,22 +2612,22 @@ function registerInvoiceTools(server2, client) {
2550
2612
  "create_invoice",
2551
2613
  "Create a new invoice",
2552
2614
  {
2553
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2554
- name: import_zod14.z.string().describe("Invoice name"),
2555
- contactId: import_zod14.z.string().describe("Contact ID for the invoice"),
2556
- items: import_zod14.z.array(import_zod14.z.object({
2557
- name: import_zod14.z.string().describe("Item name"),
2558
- description: import_zod14.z.string().describe("Item description"),
2559
- quantity: import_zod14.z.number().describe("Item quantity"),
2560
- price: import_zod14.z.number().describe("Item price"),
2561
- currency: import_zod14.z.string().describe("Currency code (e.g. USD)")
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)")
2562
2624
  })).describe("Invoice line items"),
2563
- discount: import_zod14.z.object({
2564
- type: import_zod14.z.string().optional(),
2565
- value: import_zod14.z.number().optional()
2625
+ discount: import_zod15.z.object({
2626
+ type: import_zod15.z.string().optional(),
2627
+ value: import_zod15.z.number().optional()
2566
2628
  }).optional().describe("Discount to apply"),
2567
- termsNotes: import_zod14.z.string().optional().describe("Terms and notes for the invoice"),
2568
- title: import_zod14.z.string().optional().describe("Invoice 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")
2569
2631
  },
2570
2632
  async ({ locationId: locationId2, name, contactId, items, discount, termsNotes, title }) => {
2571
2633
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2587,22 +2649,22 @@ function registerInvoiceTools(server2, client) {
2587
2649
  "update_invoice",
2588
2650
  "Update an existing invoice",
2589
2651
  {
2590
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2591
- invoiceId: import_zod14.z.string().describe("The invoice ID to update"),
2592
- name: import_zod14.z.string().optional().describe("Invoice name"),
2593
- items: import_zod14.z.array(import_zod14.z.object({
2594
- name: import_zod14.z.string().describe("Item name"),
2595
- description: import_zod14.z.string().describe("Item description"),
2596
- quantity: import_zod14.z.number().describe("Item quantity"),
2597
- price: import_zod14.z.number().describe("Item price"),
2598
- currency: import_zod14.z.string().describe("Currency code (e.g. USD)")
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)")
2599
2661
  })).optional().describe("Invoice line items"),
2600
- discount: import_zod14.z.object({
2601
- type: import_zod14.z.string().optional(),
2602
- value: import_zod14.z.number().optional()
2662
+ discount: import_zod15.z.object({
2663
+ type: import_zod15.z.string().optional(),
2664
+ value: import_zod15.z.number().optional()
2603
2665
  }).optional().describe("Discount to apply"),
2604
- termsNotes: import_zod14.z.string().optional().describe("Terms and notes for the invoice"),
2605
- title: import_zod14.z.string().optional().describe("Invoice 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")
2606
2668
  },
2607
2669
  async ({ locationId: locationId2, invoiceId, name, items, discount, termsNotes, title }) => {
2608
2670
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2623,8 +2685,8 @@ function registerInvoiceTools(server2, client) {
2623
2685
  "delete_invoice",
2624
2686
  "Delete an invoice",
2625
2687
  {
2626
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2627
- invoiceId: import_zod14.z.string().describe("The invoice ID to delete")
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")
2628
2690
  },
2629
2691
  async ({ locationId: locationId2, invoiceId }) => {
2630
2692
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2640,8 +2702,8 @@ function registerInvoiceTools(server2, client) {
2640
2702
  "send_invoice",
2641
2703
  "Send an invoice to the contact",
2642
2704
  {
2643
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2644
- invoiceId: import_zod14.z.string().describe("The invoice ID to send")
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")
2645
2707
  },
2646
2708
  async ({ locationId: locationId2, invoiceId }) => {
2647
2709
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2657,8 +2719,8 @@ function registerInvoiceTools(server2, client) {
2657
2719
  "void_invoice",
2658
2720
  "Void an invoice",
2659
2721
  {
2660
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2661
- invoiceId: import_zod14.z.string().describe("The invoice ID to void")
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")
2662
2724
  },
2663
2725
  async ({ locationId: locationId2, invoiceId }) => {
2664
2726
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2674,11 +2736,11 @@ function registerInvoiceTools(server2, client) {
2674
2736
  "record_invoice_payment",
2675
2737
  "Record a manual payment for an invoice",
2676
2738
  {
2677
- locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2678
- invoiceId: import_zod14.z.string().describe("The invoice ID"),
2679
- amount: import_zod14.z.number().describe("Payment amount"),
2680
- mode: import_zod14.z.enum(["cash", "cheque", "bank_transfer", "other"]).describe("Payment mode"),
2681
- notes: import_zod14.z.string().optional().describe("Payment 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")
2682
2744
  },
2683
2745
  async ({ locationId: locationId2, invoiceId, amount, mode, notes }) => {
2684
2746
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2695,15 +2757,15 @@ function registerInvoiceTools(server2, client) {
2695
2757
  }
2696
2758
 
2697
2759
  // src/tools/campaigns.ts
2698
- var import_zod15 = require("zod");
2760
+ var import_zod16 = require("zod");
2699
2761
  function registerCampaignTools(server2, client) {
2700
2762
  safeTool(
2701
2763
  server2,
2702
2764
  "get_campaigns",
2703
2765
  "List campaigns for a location",
2704
2766
  {
2705
- locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2706
- status: import_zod15.z.string().optional().describe("Filter by campaign 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")
2707
2769
  },
2708
2770
  async ({ locationId: locationId2, status }) => {
2709
2771
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2715,16 +2777,16 @@ function registerCampaignTools(server2, client) {
2715
2777
  }
2716
2778
 
2717
2779
  // src/tools/users.ts
2718
- var import_zod16 = require("zod");
2780
+ var import_zod17 = require("zod");
2719
2781
  function registerUserTools(server2, client) {
2720
2782
  safeTool(
2721
2783
  server2,
2722
2784
  "get_users",
2723
2785
  "List users for a location",
2724
2786
  {
2725
- locationId: import_zod16.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2726
- limit: import_zod16.z.number().optional().describe("Max number of users to return"),
2727
- skip: import_zod16.z.number().optional().describe("Number of users to 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")
2728
2790
  },
2729
2791
  async ({ locationId: locationId2, limit, skip }) => {
2730
2792
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2739,7 +2801,7 @@ function registerUserTools(server2, client) {
2739
2801
  "get_user",
2740
2802
  "Get a single user by ID",
2741
2803
  {
2742
- userId: import_zod16.z.string().describe("The user ID")
2804
+ userId: import_zod17.z.string().describe("The user ID")
2743
2805
  },
2744
2806
  async ({ userId }) => {
2745
2807
  return client.get(`/users/${userId}`);
@@ -2748,19 +2810,19 @@ function registerUserTools(server2, client) {
2748
2810
  }
2749
2811
 
2750
2812
  // src/tools/media.ts
2751
- var import_zod17 = require("zod");
2813
+ var import_zod18 = require("zod");
2752
2814
  function registerMediaTools(server2, client) {
2753
2815
  safeTool(
2754
2816
  server2,
2755
2817
  "get_media_files",
2756
2818
  "List media files for a location",
2757
2819
  {
2758
- locationId: import_zod17.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2759
- sortBy: import_zod17.z.string().optional().describe("Field to sort by"),
2760
- sortOrder: import_zod17.z.enum(["asc", "desc"]).optional().describe("Sort order"),
2761
- limit: import_zod17.z.number().optional().describe("Max number of files to return"),
2762
- offset: import_zod17.z.number().optional().describe("Number of files to skip"),
2763
- query: import_zod17.z.string().optional().describe("Search query to filter files")
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")
2764
2826
  },
2765
2827
  async ({ locationId: locationId2, sortBy, sortOrder, limit, offset, query }) => {
2766
2828
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2778,8 +2840,8 @@ function registerMediaTools(server2, client) {
2778
2840
  "delete_media_file",
2779
2841
  "Delete a media file",
2780
2842
  {
2781
- mediaId: import_zod17.z.string().describe("The media file ID to delete"),
2782
- locationId: import_zod17.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
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)")
2783
2845
  },
2784
2846
  async ({ mediaId, locationId: locationId2 }) => {
2785
2847
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2791,20 +2853,20 @@ function registerMediaTools(server2, client) {
2791
2853
  }
2792
2854
 
2793
2855
  // src/tools/social-planner.ts
2794
- var import_zod18 = require("zod");
2856
+ var import_zod19 = require("zod");
2795
2857
  function registerSocialPlannerTools(server2, client) {
2796
2858
  safeTool(
2797
2859
  server2,
2798
2860
  "get_social_posts",
2799
2861
  "List social media posts for a location",
2800
2862
  {
2801
- locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2802
- type: import_zod18.z.enum(["post", "story", "reel"]).optional().describe("Post type filter"),
2803
- accounts: import_zod18.z.string().optional().describe("Comma-separated account IDs to filter by"),
2804
- fromDate: import_zod18.z.string().optional().describe("Start date filter (ISO string)"),
2805
- toDate: import_zod18.z.string().optional().describe("End date filter (ISO string)"),
2806
- includeUsers: import_zod18.z.boolean().optional().describe("Whether to include user details"),
2807
- status: import_zod18.z.enum(["in_review", "scheduled", "published", "failed", "in_progress"]).optional().describe("Post status filter")
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")
2808
2870
  },
2809
2871
  async ({ locationId: locationId2, type, accounts, fromDate, toDate, includeUsers, status }) => {
2810
2872
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2823,7 +2885,7 @@ function registerSocialPlannerTools(server2, client) {
2823
2885
  "get_social_post",
2824
2886
  "Get a single social media post by ID",
2825
2887
  {
2826
- postId: import_zod18.z.string().describe("The social media post ID")
2888
+ postId: import_zod19.z.string().describe("The social media post ID")
2827
2889
  },
2828
2890
  async ({ postId }) => {
2829
2891
  return client.get(`/social-media-posting/${postId}`);
@@ -2834,7 +2896,7 @@ function registerSocialPlannerTools(server2, client) {
2834
2896
  "delete_social_post",
2835
2897
  "Delete a social media post",
2836
2898
  {
2837
- postId: import_zod18.z.string().describe("The social media post ID to delete")
2899
+ postId: import_zod19.z.string().describe("The social media post ID to delete")
2838
2900
  },
2839
2901
  async ({ postId }) => {
2840
2902
  return client.delete(`/social-media-posting/${postId}`);
@@ -2844,7 +2906,7 @@ function registerSocialPlannerTools(server2, client) {
2844
2906
  "get_social_media_accounts",
2845
2907
  "Get connected social media accounts for a location",
2846
2908
  {
2847
- locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
2909
+ locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
2848
2910
  },
2849
2911
  async ({ locationId: locationId2 }) => {
2850
2912
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2870,17 +2932,17 @@ function registerSocialPlannerTools(server2, client) {
2870
2932
  "create_social_post",
2871
2933
  "Create a new social media post",
2872
2934
  {
2873
- locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2874
- accountIds: import_zod18.z.array(import_zod18.z.string()).describe("Array of social account IDs to post to"),
2875
- summary: import_zod18.z.string().optional().describe("The post text/caption"),
2876
- media: import_zod18.z.array(import_zod18.z.string()).optional().describe("Array of media URLs to attach"),
2877
- status: import_zod18.z.enum(["in_review", "scheduled", "draft"]).optional().describe("Post status"),
2878
- scheduledAt: import_zod18.z.string().optional().describe("Scheduled publish time (ISO string)"),
2879
- tags: import_zod18.z.array(import_zod18.z.string()).optional().describe("Tags for the post"),
2880
- ogData: import_zod18.z.object({
2881
- title: import_zod18.z.string().optional(),
2882
- description: import_zod18.z.string().optional(),
2883
- image: import_zod18.z.string().optional()
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()
2884
2946
  }).optional().describe("Open Graph data for link previews")
2885
2947
  },
2886
2948
  async ({ locationId: locationId2, accountIds, summary, media, status, scheduledAt, tags, ogData }) => {
@@ -2898,16 +2960,16 @@ function registerSocialPlannerTools(server2, client) {
2898
2960
  }
2899
2961
 
2900
2962
  // src/tools/courses.ts
2901
- var import_zod19 = require("zod");
2963
+ var import_zod20 = require("zod");
2902
2964
  function registerCourseTools(server2, client) {
2903
2965
  safeTool(
2904
2966
  server2,
2905
2967
  "get_courses",
2906
2968
  "List courses for a location",
2907
2969
  {
2908
- locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2909
- limit: import_zod19.z.number().optional().describe("Max number of courses to return"),
2910
- offset: import_zod19.z.number().optional().describe("Number of courses to skip")
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")
2911
2973
  },
2912
2974
  async ({ locationId: locationId2, limit, offset }) => {
2913
2975
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2920,14 +2982,14 @@ function registerCourseTools(server2, client) {
2920
2982
  }
2921
2983
 
2922
2984
  // src/tools/businesses.ts
2923
- var import_zod20 = require("zod");
2985
+ var import_zod21 = require("zod");
2924
2986
  function registerBusinessTools(server2, client) {
2925
2987
  safeTool(
2926
2988
  server2,
2927
2989
  "get_businesses",
2928
2990
  "List businesses for a location",
2929
2991
  {
2930
- locationId: import_zod20.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
2992
+ locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
2931
2993
  },
2932
2994
  async ({ locationId: locationId2 }) => {
2933
2995
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2939,7 +3001,7 @@ function registerBusinessTools(server2, client) {
2939
3001
  "get_business",
2940
3002
  "Get a single business by ID",
2941
3003
  {
2942
- businessId: import_zod20.z.string().describe("The business ID")
3004
+ businessId: import_zod21.z.string().describe("The business ID")
2943
3005
  },
2944
3006
  async ({ businessId }) => {
2945
3007
  return client.get(`/businesses/${businessId}`);
@@ -2950,17 +3012,17 @@ function registerBusinessTools(server2, client) {
2950
3012
  "create_business",
2951
3013
  "Create a new business",
2952
3014
  {
2953
- locationId: import_zod20.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
2954
- name: import_zod20.z.string().describe("Business name"),
2955
- phone: import_zod20.z.string().optional().describe("Phone number"),
2956
- email: import_zod20.z.string().optional().describe("Email address"),
2957
- website: import_zod20.z.string().optional().describe("Website URL"),
2958
- address: import_zod20.z.string().optional().describe("Street address"),
2959
- city: import_zod20.z.string().optional().describe("City"),
2960
- state: import_zod20.z.string().optional().describe("State"),
2961
- postalCode: import_zod20.z.string().optional().describe("Postal/ZIP code"),
2962
- country: import_zod20.z.string().optional().describe("Country"),
2963
- description: import_zod20.z.string().optional().describe("Business 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")
2964
3026
  },
2965
3027
  async ({ locationId: locationId2, name, phone, email, website, address, city, state, postalCode, country, description }) => {
2966
3028
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -2982,17 +3044,17 @@ function registerBusinessTools(server2, client) {
2982
3044
  "update_business",
2983
3045
  "Update an existing business",
2984
3046
  {
2985
- businessId: import_zod20.z.string().describe("The business ID to update"),
2986
- name: import_zod20.z.string().optional().describe("Business name"),
2987
- phone: import_zod20.z.string().optional().describe("Phone number"),
2988
- email: import_zod20.z.string().optional().describe("Email address"),
2989
- website: import_zod20.z.string().optional().describe("Website URL"),
2990
- address: import_zod20.z.string().optional().describe("Street address"),
2991
- city: import_zod20.z.string().optional().describe("City"),
2992
- state: import_zod20.z.string().optional().describe("State"),
2993
- postalCode: import_zod20.z.string().optional().describe("Postal/ZIP code"),
2994
- country: import_zod20.z.string().optional().describe("Country"),
2995
- description: import_zod20.z.string().optional().describe("Business 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")
2996
3058
  },
2997
3059
  async ({ businessId, name, phone, email, website, address, city, state, postalCode, country, description }) => {
2998
3060
  const body = {};
@@ -3014,8 +3076,8 @@ function registerBusinessTools(server2, client) {
3014
3076
  "delete_business",
3015
3077
  "Permanently delete a business. IRREVERSIBLE.",
3016
3078
  {
3017
- businessId: import_zod20.z.string().describe("The business ID to delete"),
3018
- confirm: import_zod20.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
3019
3081
  },
3020
3082
  async ({ businessId }) => {
3021
3083
  return client.delete(`/businesses/${businessId}`);
@@ -3024,17 +3086,17 @@ function registerBusinessTools(server2, client) {
3024
3086
  }
3025
3087
 
3026
3088
  // src/tools/blogs.ts
3027
- var import_zod21 = require("zod");
3089
+ var import_zod22 = require("zod");
3028
3090
  function registerBlogTools(server2, client) {
3029
3091
  safeTool(
3030
3092
  server2,
3031
3093
  "get_blog_posts",
3032
3094
  "List blog posts for a location. Offset-based pagination via limit/offset.",
3033
3095
  {
3034
- locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
3035
- limit: import_zod21.z.number().optional().describe("Number of posts to return"),
3036
- offset: import_zod21.z.number().optional().describe("Offset for pagination"),
3037
- status: import_zod21.z.enum(["published", "draft", "archived"]).optional().describe("Filter by post 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")
3038
3100
  },
3039
3101
  async ({ locationId: locationId2, limit, offset, status }) => {
3040
3102
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3052,8 +3114,8 @@ function registerBlogTools(server2, client) {
3052
3114
  "get_blog_post",
3053
3115
  "Get a specific blog post by ID",
3054
3116
  {
3055
- blogId: import_zod21.z.string().describe("Blog ID"),
3056
- postId: import_zod21.z.string().describe("Post ID")
3117
+ blogId: import_zod22.z.string().describe("Blog ID"),
3118
+ postId: import_zod22.z.string().describe("Post ID")
3057
3119
  },
3058
3120
  async ({ blogId, postId }) => {
3059
3121
  return client.get(`/blogs/${blogId}/posts/${postId}`, {});
@@ -3064,7 +3126,7 @@ function registerBlogTools(server2, client) {
3064
3126
  "get_blog_authors",
3065
3127
  "List blog authors for a location",
3066
3128
  {
3067
- locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3129
+ locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3068
3130
  },
3069
3131
  async ({ locationId: locationId2 }) => {
3070
3132
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3078,7 +3140,7 @@ function registerBlogTools(server2, client) {
3078
3140
  "get_blog_categories",
3079
3141
  "List blog categories for a location",
3080
3142
  {
3081
- locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3143
+ locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3082
3144
  },
3083
3145
  async ({ locationId: locationId2 }) => {
3084
3146
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3092,8 +3154,8 @@ function registerBlogTools(server2, client) {
3092
3154
  "check_blog_slug",
3093
3155
  "Check if a blog post URL slug already exists",
3094
3156
  {
3095
- locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
3096
- urlSlug: import_zod21.z.string().describe("URL slug to check")
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")
3097
3159
  },
3098
3160
  async ({ locationId: locationId2, urlSlug }) => {
3099
3161
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3105,14 +3167,14 @@ function registerBlogTools(server2, client) {
3105
3167
  }
3106
3168
 
3107
3169
  // src/tools/emails.ts
3108
- var import_zod22 = require("zod");
3170
+ var import_zod23 = require("zod");
3109
3171
  function registerEmailTools(server2, client) {
3110
3172
  safeTool(
3111
3173
  server2,
3112
3174
  "get_email_campaigns",
3113
3175
  "List email campaigns for a location",
3114
3176
  {
3115
- locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3177
+ locationId: import_zod23.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3116
3178
  },
3117
3179
  async ({ locationId: locationId2 }) => {
3118
3180
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3124,14 +3186,14 @@ function registerEmailTools(server2, client) {
3124
3186
  }
3125
3187
 
3126
3188
  // src/tools/trigger-links.ts
3127
- var import_zod23 = require("zod");
3189
+ var import_zod24 = require("zod");
3128
3190
  function registerTriggerLinkTools(server2, client) {
3129
3191
  safeTool(
3130
3192
  server2,
3131
3193
  "get_trigger_links",
3132
3194
  "List trigger links for a location",
3133
3195
  {
3134
- locationId: import_zod23.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3196
+ locationId: import_zod24.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
3135
3197
  },
3136
3198
  async ({ locationId: locationId2 }) => {
3137
3199
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3143,14 +3205,14 @@ function registerTriggerLinkTools(server2, client) {
3143
3205
  }
3144
3206
 
3145
3207
  // src/tools/custom-objects.ts
3146
- var import_zod24 = require("zod");
3208
+ var import_zod25 = require("zod");
3147
3209
  function registerCustomObjectTools(server2, client) {
3148
3210
  safeTool(
3149
3211
  server2,
3150
3212
  "list_custom_objects",
3151
3213
  "List all custom object schemas defined in a GHL location.",
3152
3214
  {
3153
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3215
+ locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3154
3216
  },
3155
3217
  async ({ locationId: locationId2 }) => {
3156
3218
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3164,8 +3226,8 @@ function registerCustomObjectTools(server2, client) {
3164
3226
  "get_custom_object",
3165
3227
  "Retrieve a single custom object schema by its key.",
3166
3228
  {
3167
- schemaKey: import_zod24.z.string().describe("The key of the custom object schema to retrieve."),
3168
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3169
3231
  },
3170
3232
  async ({ schemaKey, locationId: locationId2 }) => {
3171
3233
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3179,11 +3241,11 @@ function registerCustomObjectTools(server2, client) {
3179
3241
  "search_custom_object_records",
3180
3242
  "Search records of a custom object by schema key. Supports filtering and pagination.",
3181
3243
  {
3182
- schemaKey: import_zod24.z.string().describe("The custom object schema key."),
3183
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3184
- query: import_zod24.z.string().optional().describe("Search query to filter records."),
3185
- limit: import_zod24.z.number().optional().describe("Maximum records to return. Defaults to 20."),
3186
- offset: import_zod24.z.number().optional().describe("Number of records to skip for pagination.")
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.")
3187
3249
  },
3188
3250
  async ({ schemaKey, locationId: locationId2, query, limit, offset }) => {
3189
3251
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3202,9 +3264,9 @@ function registerCustomObjectTools(server2, client) {
3202
3264
  "get_custom_object_record",
3203
3265
  "Retrieve a single custom object record by schema key and record ID.",
3204
3266
  {
3205
- schemaKey: import_zod24.z.string().describe("The custom object schema key."),
3206
- recordId: import_zod24.z.string().describe("The record ID to retrieve."),
3207
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3208
3270
  },
3209
3271
  async ({ schemaKey, recordId, locationId: locationId2 }) => {
3210
3272
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3218,9 +3280,9 @@ function registerCustomObjectTools(server2, client) {
3218
3280
  "create_custom_object_record",
3219
3281
  "Create a new record for a custom object.",
3220
3282
  {
3221
- schemaKey: import_zod24.z.string().describe("The custom object schema key."),
3222
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3223
- properties: import_zod24.z.record(import_zod24.z.unknown()).describe("Key-value pairs of field values for the new record.")
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.")
3224
3286
  },
3225
3287
  async ({ schemaKey, locationId: locationId2, properties }) => {
3226
3288
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3234,10 +3296,10 @@ function registerCustomObjectTools(server2, client) {
3234
3296
  "update_custom_object_record",
3235
3297
  "Update an existing custom object record.",
3236
3298
  {
3237
- schemaKey: import_zod24.z.string().describe("The custom object schema key."),
3238
- recordId: import_zod24.z.string().describe("The record ID to update."),
3239
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3240
- properties: import_zod24.z.record(import_zod24.z.unknown()).describe("Key-value pairs of field values to update.")
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.")
3241
3303
  },
3242
3304
  async ({ schemaKey, recordId, locationId: locationId2, properties }) => {
3243
3305
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3251,9 +3313,9 @@ function registerCustomObjectTools(server2, client) {
3251
3313
  "delete_custom_object_record",
3252
3314
  "Delete a custom object record by schema key and record ID.",
3253
3315
  {
3254
- schemaKey: import_zod24.z.string().describe("The custom object schema key."),
3255
- recordId: import_zod24.z.string().describe("The record ID to delete."),
3256
- locationId: import_zod24.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3257
3319
  },
3258
3320
  async ({ schemaKey, recordId, locationId: locationId2 }) => {
3259
3321
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3265,16 +3327,16 @@ function registerCustomObjectTools(server2, client) {
3265
3327
  }
3266
3328
 
3267
3329
  // src/tools/associations.ts
3268
- var import_zod25 = require("zod");
3330
+ var import_zod26 = require("zod");
3269
3331
  function registerAssociationTools(server2, client) {
3270
3332
  safeTool(
3271
3333
  server2,
3272
3334
  "list_associations",
3273
3335
  "List associations for a custom object record \u2014 shows related contacts, opportunities, or other records.",
3274
3336
  {
3275
- schemaKey: import_zod25.z.string().describe("The custom object schema key."),
3276
- recordId: import_zod25.z.string().describe("The record ID to list associations for."),
3277
- locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3278
3340
  },
3279
3341
  async ({ schemaKey, recordId, locationId: locationId2 }) => {
3280
3342
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3289,11 +3351,11 @@ function registerAssociationTools(server2, client) {
3289
3351
  "create_association",
3290
3352
  "Create an association between a custom object record and another entity (contact, opportunity, or another custom object record).",
3291
3353
  {
3292
- schemaKey: import_zod25.z.string().describe("The custom object schema key of the source record."),
3293
- recordId: import_zod25.z.string().describe("The source record ID."),
3294
- locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3295
- targetEntityType: import_zod25.z.string().describe("The target entity type (e.g. 'contact', 'opportunity', or a custom object schema key)."),
3296
- targetEntityId: import_zod25.z.string().describe("The ID of the target entity to associate with.")
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.")
3297
3359
  },
3298
3360
  async ({ schemaKey, recordId, locationId: locationId2, targetEntityType, targetEntityId }) => {
3299
3361
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3314,10 +3376,10 @@ function registerAssociationTools(server2, client) {
3314
3376
  "delete_association",
3315
3377
  "Remove an association between a custom object record and another entity.",
3316
3378
  {
3317
- schemaKey: import_zod25.z.string().describe("The custom object schema key of the source record."),
3318
- recordId: import_zod25.z.string().describe("The source record ID."),
3319
- associationId: import_zod25.z.string().describe("The association ID to remove."),
3320
- locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3321
3383
  },
3322
3384
  async ({ schemaKey, recordId, associationId, locationId: locationId2 }) => {
3323
3385
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3330,18 +3392,18 @@ function registerAssociationTools(server2, client) {
3330
3392
  }
3331
3393
 
3332
3394
  // src/tools/estimates.ts
3333
- var import_zod26 = require("zod");
3395
+ var import_zod27 = require("zod");
3334
3396
  function registerEstimateTools(server2, client) {
3335
3397
  safeTool(
3336
3398
  server2,
3337
3399
  "list_estimates",
3338
3400
  "List estimates/quotes in a GHL location. Supports pagination and filtering by status.",
3339
3401
  {
3340
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3341
- status: import_zod26.z.string().optional().describe("Filter by status (e.g. 'draft', 'sent', 'accepted', 'declined')."),
3342
- limit: import_zod26.z.number().optional().describe("Maximum estimates to return. Defaults to 20."),
3343
- offset: import_zod26.z.number().optional().describe("Number of records to skip for pagination."),
3344
- contactId: import_zod26.z.string().optional().describe("Filter estimates by contact ID.")
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.")
3345
3407
  },
3346
3408
  async ({ locationId: locationId2, status, limit, offset, contactId }) => {
3347
3409
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3362,8 +3424,8 @@ function registerEstimateTools(server2, client) {
3362
3424
  "get_estimate",
3363
3425
  "Retrieve a single estimate/quote by its ID.",
3364
3426
  {
3365
- estimateId: import_zod26.z.string().describe("The estimate ID to retrieve."),
3366
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3367
3429
  },
3368
3430
  async ({ estimateId, locationId: locationId2 }) => {
3369
3431
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3377,12 +3439,12 @@ function registerEstimateTools(server2, client) {
3377
3439
  "create_estimate",
3378
3440
  "Create a new estimate/quote for a contact.",
3379
3441
  {
3380
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3381
- contactId: import_zod26.z.string().describe("The contact ID this estimate is for."),
3382
- name: import_zod26.z.string().describe("Estimate name/title."),
3383
- title: import_zod26.z.string().optional().describe("Display title for the estimate."),
3384
- items: import_zod26.z.array(import_zod26.z.record(import_zod26.z.unknown())).describe("Line items array. Each item should have name, description, price, qty."),
3385
- discount: import_zod26.z.record(import_zod26.z.unknown()).optional().describe("Discount object (type, value).")
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).")
3386
3448
  },
3387
3449
  async ({ locationId: locationId2, contactId, name, title, items, discount }) => {
3388
3450
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3404,12 +3466,12 @@ function registerEstimateTools(server2, client) {
3404
3466
  "update_estimate",
3405
3467
  "Update an existing estimate/quote.",
3406
3468
  {
3407
- estimateId: import_zod26.z.string().describe("The estimate ID to update."),
3408
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3409
- name: import_zod26.z.string().optional().describe("Updated estimate name."),
3410
- title: import_zod26.z.string().optional().describe("Updated display title."),
3411
- items: import_zod26.z.array(import_zod26.z.record(import_zod26.z.unknown())).optional().describe("Updated line items array."),
3412
- discount: import_zod26.z.record(import_zod26.z.unknown()).optional().describe("Updated discount object.")
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.")
3413
3475
  },
3414
3476
  async ({ estimateId, locationId: locationId2, name, title, items, discount }) => {
3415
3477
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3429,8 +3491,8 @@ function registerEstimateTools(server2, client) {
3429
3491
  "delete_estimate",
3430
3492
  "Delete an estimate/quote by ID.",
3431
3493
  {
3432
- estimateId: import_zod26.z.string().describe("The estimate ID to delete."),
3433
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3434
3496
  },
3435
3497
  async ({ estimateId, locationId: locationId2 }) => {
3436
3498
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3444,8 +3506,8 @@ function registerEstimateTools(server2, client) {
3444
3506
  "send_estimate",
3445
3507
  "Send an estimate to the contact via email.",
3446
3508
  {
3447
- estimateId: import_zod26.z.string().describe("The estimate ID to send."),
3448
- locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3449
3511
  },
3450
3512
  async ({ estimateId, locationId: locationId2 }) => {
3451
3513
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3457,14 +3519,14 @@ function registerEstimateTools(server2, client) {
3457
3519
  }
3458
3520
 
3459
3521
  // src/tools/coupons.ts
3460
- var import_zod27 = require("zod");
3522
+ var import_zod28 = require("zod");
3461
3523
  function registerCouponTools(server2, client) {
3462
3524
  safeTool(
3463
3525
  server2,
3464
3526
  "list_coupons",
3465
3527
  "List coupons/promo codes in a GHL location.",
3466
3528
  {
3467
- locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3529
+ locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3468
3530
  },
3469
3531
  async ({ locationId: locationId2 }) => {
3470
3532
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3478,8 +3540,8 @@ function registerCouponTools(server2, client) {
3478
3540
  "get_coupon",
3479
3541
  "Retrieve a single coupon by its ID.",
3480
3542
  {
3481
- couponId: import_zod27.z.string().describe("The coupon ID to retrieve."),
3482
- locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3483
3545
  },
3484
3546
  async ({ couponId, locationId: locationId2 }) => {
3485
3547
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3493,14 +3555,14 @@ function registerCouponTools(server2, client) {
3493
3555
  "create_coupon",
3494
3556
  "Create a new coupon/promo code.",
3495
3557
  {
3496
- locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3497
- name: import_zod27.z.string().describe("Coupon name."),
3498
- code: import_zod27.z.string().describe("Promo code string customers enter."),
3499
- type: import_zod27.z.string().describe("Discount type: 'percentage' or 'fixed'."),
3500
- amount: import_zod27.z.number().describe("Discount amount (percentage value or fixed dollar amount)."),
3501
- duration: import_zod27.z.string().optional().describe("Duration: 'once', 'repeating', or 'forever'. Defaults to 'once'."),
3502
- durationInMonths: import_zod27.z.number().optional().describe("Number of months if duration is 'repeating'."),
3503
- productIds: import_zod27.z.array(import_zod27.z.string()).optional().describe("Product IDs this coupon applies to. If empty, applies to all.")
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.")
3504
3566
  },
3505
3567
  async ({ locationId: locationId2, name, code, type, amount, duration, durationInMonths, productIds }) => {
3506
3568
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3524,10 +3586,10 @@ function registerCouponTools(server2, client) {
3524
3586
  "update_coupon",
3525
3587
  "Update an existing coupon.",
3526
3588
  {
3527
- couponId: import_zod27.z.string().describe("The coupon ID to update."),
3528
- locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3529
- name: import_zod27.z.string().optional().describe("Updated coupon name."),
3530
- productIds: import_zod27.z.array(import_zod27.z.string()).optional().describe("Updated product IDs this coupon applies to.")
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.")
3531
3593
  },
3532
3594
  async ({ couponId, locationId: locationId2, name, productIds }) => {
3533
3595
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3545,8 +3607,8 @@ function registerCouponTools(server2, client) {
3545
3607
  "delete_coupon",
3546
3608
  "Delete a coupon by ID.",
3547
3609
  {
3548
- couponId: import_zod27.z.string().describe("The coupon ID to delete."),
3549
- locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3550
3612
  },
3551
3613
  async ({ couponId, locationId: locationId2 }) => {
3552
3614
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3558,14 +3620,14 @@ function registerCouponTools(server2, client) {
3558
3620
  }
3559
3621
 
3560
3622
  // src/tools/webhooks.ts
3561
- var import_zod28 = require("zod");
3623
+ var import_zod29 = require("zod");
3562
3624
  function registerWebhookTools(server2, client) {
3563
3625
  safeTool(
3564
3626
  server2,
3565
3627
  "list_webhooks",
3566
3628
  "List all webhooks configured in a GHL location.",
3567
3629
  {
3568
- locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3630
+ locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
3569
3631
  },
3570
3632
  async ({ locationId: locationId2 }) => {
3571
3633
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3579,8 +3641,8 @@ function registerWebhookTools(server2, client) {
3579
3641
  "get_webhook",
3580
3642
  "Retrieve a single webhook by its ID.",
3581
3643
  {
3582
- webhookId: import_zod28.z.string().describe("The webhook ID to retrieve."),
3583
- locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3584
3646
  },
3585
3647
  async ({ webhookId, locationId: locationId2 }) => {
3586
3648
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3594,10 +3656,10 @@ function registerWebhookTools(server2, client) {
3594
3656
  "create_webhook",
3595
3657
  "Create a new webhook subscription for GHL events.",
3596
3658
  {
3597
- locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3598
- name: import_zod28.z.string().describe("Webhook name."),
3599
- url: import_zod28.z.string().describe("The URL to POST events to."),
3600
- events: import_zod28.z.array(import_zod28.z.string()).describe(
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(
3601
3663
  "List of event types to subscribe to (e.g. 'ContactCreate', 'AppointmentCreate', 'OpportunityStatusUpdate')."
3602
3664
  )
3603
3665
  },
@@ -3618,11 +3680,11 @@ function registerWebhookTools(server2, client) {
3618
3680
  "update_webhook",
3619
3681
  "Update an existing webhook (name, URL, or subscribed events).",
3620
3682
  {
3621
- webhookId: import_zod28.z.string().describe("The webhook ID to update."),
3622
- locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3623
- name: import_zod28.z.string().optional().describe("Updated webhook name."),
3624
- url: import_zod28.z.string().optional().describe("Updated webhook URL."),
3625
- events: import_zod28.z.array(import_zod28.z.string()).optional().describe("Updated list of event types.")
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.")
3626
3688
  },
3627
3689
  async ({ webhookId, locationId: locationId2, name, url, events }) => {
3628
3690
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3638,8 +3700,8 @@ function registerWebhookTools(server2, client) {
3638
3700
  "delete_webhook",
3639
3701
  "Delete a webhook subscription by ID.",
3640
3702
  {
3641
- webhookId: import_zod28.z.string().describe("The webhook ID to delete."),
3642
- locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3643
3705
  },
3644
3706
  async ({ webhookId, locationId: locationId2 }) => {
3645
3707
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3651,16 +3713,16 @@ function registerWebhookTools(server2, client) {
3651
3713
  }
3652
3714
 
3653
3715
  // src/tools/documents.ts
3654
- var import_zod29 = require("zod");
3716
+ var import_zod30 = require("zod");
3655
3717
  function registerDocumentTools(server2, client) {
3656
3718
  safeTool(
3657
3719
  server2,
3658
3720
  "list_documents",
3659
3721
  "List documents and contracts in a GHL location. Supports pagination.",
3660
3722
  {
3661
- locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
3662
- limit: import_zod29.z.number().optional().describe("Maximum documents to return. Defaults to 20."),
3663
- offset: import_zod29.z.number().optional().describe("Number of records to skip for pagination.")
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.")
3664
3726
  },
3665
3727
  async ({ locationId: locationId2, limit, offset }) => {
3666
3728
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3678,8 +3740,8 @@ function registerDocumentTools(server2, client) {
3678
3740
  "get_document",
3679
3741
  "Retrieve a single document or contract by its ID, including signature status.",
3680
3742
  {
3681
- documentId: import_zod29.z.string().describe("The document ID to retrieve."),
3682
- locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3683
3745
  },
3684
3746
  async ({ documentId, locationId: locationId2 }) => {
3685
3747
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3693,8 +3755,8 @@ function registerDocumentTools(server2, client) {
3693
3755
  "delete_document",
3694
3756
  "Delete a document or contract by ID.",
3695
3757
  {
3696
- documentId: import_zod29.z.string().describe("The document ID to delete."),
3697
- locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3698
3760
  },
3699
3761
  async ({ documentId, locationId: locationId2 }) => {
3700
3762
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3708,9 +3770,9 @@ function registerDocumentTools(server2, client) {
3708
3770
  "send_document",
3709
3771
  "Send a document/contract to a contact for electronic signature.",
3710
3772
  {
3711
- documentId: import_zod29.z.string().describe("The document ID to send."),
3712
- contactId: import_zod29.z.string().describe("The contact ID to send the document to."),
3713
- locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
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.")
3714
3776
  },
3715
3777
  async ({ documentId, contactId, locationId: locationId2 }) => {
3716
3778
  const resolvedLocationId = client.resolveLocationId(locationId2);
@@ -3722,94 +3784,20 @@ function registerDocumentTools(server2, client) {
3722
3784
  }
3723
3785
 
3724
3786
  // src/tools/workflow-builder.ts
3725
- var import_zod30 = require("zod");
3726
- var ActionSchema = import_zod30.z.object({
3727
- id: import_zod30.z.string().optional().describe("Action ID (auto-generated if omitted)."),
3728
- name: import_zod30.z.string().describe("Display name for this action step."),
3729
- type: import_zod30.z.string().describe("Action type."),
3730
- attributes: import_zod30.z.record(import_zod30.z.unknown()).optional().describe("Action-specific configuration."),
3731
- next: import_zod30.z.union([import_zod30.z.string(), import_zod30.z.array(import_zod30.z.string())]).optional().describe("Next action id, or branch id array for condition nodes."),
3732
- parent: import_zod30.z.string().optional().describe("Branch parent node id."),
3733
- parentKey: import_zod30.z.string().optional().describe("Previous action id or branch parent id."),
3734
- order: import_zod30.z.number().optional().describe("Order within this chain or branch."),
3735
- cat: import_zod30.z.string().optional().describe("Category for condition, transition, or multi-path nodes."),
3736
- nodeType: import_zod30.z.string().optional().describe("Node type for if/else nodes."),
3737
- sibling: import_zod30.z.array(import_zod30.z.string()).optional().describe("Sibling branch node IDs.")
3738
- }).passthrough();
3739
- var TriggerActionSchema2 = import_zod30.z.object({
3740
- workflow_id: import_zod30.z.string(),
3741
- type: import_zod30.z.literal("add_to_workflow")
3742
- }).passthrough();
3743
- var TriggerCommonSchema2 = import_zod30.z.object({
3744
- id: import_zod30.z.string().optional(),
3745
- date_added: import_zod30.z.string().optional(),
3746
- deleted: import_zod30.z.boolean().optional(),
3747
- belongs_to: import_zod30.z.literal("workflow").optional(),
3748
- location_id: import_zod30.z.string().optional(),
3749
- origin_id: import_zod30.z.string().optional(),
3750
- active: import_zod30.z.boolean().optional(),
3751
- workflow_id: import_zod30.z.string().optional(),
3752
- masterType: import_zod30.z.literal("highlevel").optional(),
3753
- name: import_zod30.z.string().optional(),
3754
- actions: import_zod30.z.array(TriggerActionSchema2).optional(),
3755
- schedule_config: import_zod30.z.record(import_zod30.z.unknown()).optional(),
3756
- 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.")
3757
3800
  }).passthrough();
3758
- var ContactTagTriggerSchema2 = TriggerCommonSchema2.extend({
3759
- type: import_zod30.z.literal("contact_tag"),
3760
- conditions: import_zod30.z.array(import_zod30.z.object({
3761
- operator: import_zod30.z.string(),
3762
- field: import_zod30.z.enum(["tagsAdded", "tagsRemoved"]),
3763
- value: import_zod30.z.string(),
3764
- title: import_zod30.z.string().optional(),
3765
- type: import_zod30.z.string().optional(),
3766
- id: import_zod30.z.string().optional()
3767
- }).passthrough())
3768
- });
3769
- var CustomerReplyTriggerSchema2 = TriggerCommonSchema2.extend({
3770
- type: import_zod30.z.literal("customer_reply"),
3771
- conditions: import_zod30.z.array(import_zod30.z.object({
3772
- operator: import_zod30.z.string(),
3773
- field: import_zod30.z.string(),
3774
- value: import_zod30.z.unknown().optional(),
3775
- title: import_zod30.z.string().optional(),
3776
- type: import_zod30.z.string().optional(),
3777
- id: import_zod30.z.string().optional()
3778
- }).passthrough()).optional()
3779
- });
3780
- var AppointmentTriggerSchema2 = TriggerCommonSchema2.extend({
3781
- type: import_zod30.z.literal("appointment"),
3782
- conditions: import_zod30.z.array(import_zod30.z.object({
3783
- operator: import_zod30.z.string(),
3784
- field: import_zod30.z.string(),
3785
- value: import_zod30.z.unknown().optional(),
3786
- title: import_zod30.z.string().optional(),
3787
- type: import_zod30.z.string().optional(),
3788
- id: import_zod30.z.string().optional()
3789
- }).passthrough()).optional()
3790
- });
3791
- var PipelineStageUpdatedTriggerSchema2 = TriggerCommonSchema2.extend({
3792
- type: import_zod30.z.literal("pipeline_stage_updated"),
3793
- conditions: import_zod30.z.array(import_zod30.z.object({
3794
- operator: import_zod30.z.string(),
3795
- field: import_zod30.z.string(),
3796
- value: import_zod30.z.unknown().optional(),
3797
- title: import_zod30.z.string().optional(),
3798
- type: import_zod30.z.string().optional(),
3799
- id: import_zod30.z.string().optional()
3800
- }).passthrough()).optional()
3801
- });
3802
- var UnknownTriggerSchema2 = TriggerCommonSchema2.extend({
3803
- type: import_zod30.z.string(),
3804
- conditions: import_zod30.z.array(import_zod30.z.record(import_zod30.z.unknown())).optional()
3805
- });
3806
- var WorkflowTriggerSchema2 = import_zod30.z.union([
3807
- CustomerReplyTriggerSchema2,
3808
- AppointmentTriggerSchema2,
3809
- ContactTagTriggerSchema2,
3810
- PipelineStageUpdatedTriggerSchema2,
3811
- UnknownTriggerSchema2
3812
- ]);
3813
3801
  function linkBranchActions(actions, branchId, nextAfterMerge) {
3814
3802
  const prepared = actions.map((action) => ({
3815
3803
  ...action,
@@ -3855,8 +3843,8 @@ function registerWorkflowBuilderTools(server2, client) {
3855
3843
  "list_workflows_full",
3856
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.",
3857
3845
  {
3858
- limit: import_zod30.z.number().optional().describe("Max workflows to return. Defaults to 50."),
3859
- skip: import_zod30.z.number().optional().describe("Number of workflows to skip for pagination.")
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.")
3860
3848
  },
3861
3849
  async ({ limit, skip }) => {
3862
3850
  try {
@@ -3871,7 +3859,7 @@ function registerWorkflowBuilderTools(server2, client) {
3871
3859
  "get_workflow_full",
3872
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.",
3873
3861
  {
3874
- workflowId: import_zod30.z.string().describe("The workflow ID to retrieve.")
3862
+ workflowId: import_zod31.z.string().describe("The workflow ID to retrieve.")
3875
3863
  },
3876
3864
  async ({ workflowId }) => {
3877
3865
  try {
@@ -3886,9 +3874,9 @@ function registerWorkflowBuilderTools(server2, client) {
3886
3874
  "get_trigger_registry",
3887
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.",
3888
3876
  {
3889
- companyId: import_zod30.z.string().describe("Company ID for the location. Find it in any get_workflow_full response under the 'companyId' field."),
3890
- limit: import_zod30.z.number().optional().describe("Max marketplace apps to return. Defaults to 200."),
3891
- installedOnly: import_zod30.z.boolean().optional().describe("If true, returns only apps installed in this location. Defaults to false (full marketplace catalogue, ~85 apps).")
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).")
3892
3880
  },
3893
3881
  async ({ companyId, limit, installedOnly }) => {
3894
3882
  try {
@@ -3920,7 +3908,7 @@ function registerWorkflowBuilderTools(server2, client) {
3920
3908
  "create_workflow",
3921
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).",
3922
3910
  {
3923
- name: import_zod30.z.string().describe("Name for the new workflow.")
3911
+ name: import_zod31.z.string().describe("Name for the new workflow.")
3924
3912
  },
3925
3913
  async ({ name }) => {
3926
3914
  try {
@@ -3935,11 +3923,11 @@ function registerWorkflowBuilderTools(server2, client) {
3935
3923
  "update_workflow_actions",
3936
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.",
3937
3925
  {
3938
- workflowId: import_zod30.z.string().describe("The workflow ID to update."),
3939
- name: import_zod30.z.string().optional().describe("New workflow name."),
3940
- status: import_zod30.z.string().optional().describe("New status: 'draft' or 'published'."),
3941
- actions: import_zod30.z.array(ActionSchema).optional().describe("Array of workflow actions/steps. For linear flows, provide in order \u2014 chaining is automatic."),
3942
- triggers: import_zod30.z.array(WorkflowTriggerSchema2).optional().describe("Array of workflow 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.")
3943
3931
  },
3944
3932
  async ({ workflowId, name, status, actions, triggers }) => {
3945
3933
  try {
@@ -3983,12 +3971,12 @@ function registerWorkflowBuilderTools(server2, client) {
3983
3971
  "build_if_else_branch",
3984
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.",
3985
3973
  {
3986
- field: import_zod30.z.string().describe("Condition subtype, currently 'tags' for tag-based conditions."),
3987
- operator: import_zod30.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."),
3988
- value: import_zod30.z.union([import_zod30.z.string(), import_zod30.z.array(import_zod30.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."),
3989
- yes_actions: import_zod30.z.array(ActionSchema).describe("Actions to run in the Yes branch."),
3990
- no_actions: import_zod30.z.array(ActionSchema).describe("Actions to run in the No branch."),
3991
- next_after_merge: import_zod30.z.string().optional().describe("Optional node id to link from each non-empty branch's final child.")
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.")
3992
3980
  },
3993
3981
  async ({ field, operator, value, yes_actions, no_actions, next_after_merge }) => {
3994
3982
  try {
@@ -4098,8 +4086,8 @@ function registerWorkflowBuilderTools(server2, client) {
4098
4086
  "delete_workflow_full",
4099
4087
  "Permanently delete a workflow. IRREVERSIBLE.",
4100
4088
  {
4101
- workflowId: import_zod30.z.string().describe("The workflow ID to delete."),
4102
- confirm: import_zod30.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
4103
4091
  },
4104
4092
  async ({ workflowId }) => {
4105
4093
  try {
@@ -4114,7 +4102,7 @@ function registerWorkflowBuilderTools(server2, client) {
4114
4102
  "publish_workflow",
4115
4103
  "Publish a draft workflow, making it active and processing contacts.",
4116
4104
  {
4117
- workflowId: import_zod30.z.string().describe("The workflow ID to publish.")
4105
+ workflowId: import_zod31.z.string().describe("The workflow ID to publish.")
4118
4106
  },
4119
4107
  async ({ workflowId }) => {
4120
4108
  try {
@@ -4128,7 +4116,7 @@ function registerWorkflowBuilderTools(server2, client) {
4128
4116
  }
4129
4117
 
4130
4118
  // src/tools/funnel-builder.ts
4131
- var import_zod31 = require("zod");
4119
+ var import_zod32 = require("zod");
4132
4120
  function registerFunnelBuilderTools(server2, builderClient) {
4133
4121
  const client = builderClient;
4134
4122
  if (!client) return;
@@ -4169,7 +4157,7 @@ ${text2}`);
4169
4157
  "list_funnels_full",
4170
4158
  "List all funnels/websites with full details including steps, pages, and metadata. Uses the internal API for richer data than the public API.",
4171
4159
  {
4172
- limit: import_zod31.z.number().optional().describe("Max funnels to return. Defaults to 50.")
4160
+ limit: import_zod32.z.number().optional().describe("Max funnels to return. Defaults to 50.")
4173
4161
  },
4174
4162
  async ({ limit }) => {
4175
4163
  try {
@@ -4189,7 +4177,7 @@ ${text2}`);
4189
4177
  "get_page_full",
4190
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.",
4191
4179
  {
4192
- pageId: import_zod31.z.string().describe("The page ID to retrieve.")
4180
+ pageId: import_zod32.z.string().describe("The page ID to retrieve.")
4193
4181
  },
4194
4182
  async ({ pageId }) => {
4195
4183
  try {
@@ -4209,7 +4197,7 @@ ${text2}`);
4209
4197
  "get_page_content",
4210
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.",
4211
4199
  {
4212
- pageDataDownloadUrl: import_zod31.z.string().describe("The pageDataDownloadUrl from get_page_full response.")
4200
+ pageDataDownloadUrl: import_zod32.z.string().describe("The pageDataDownloadUrl from get_page_full response.")
4213
4201
  },
4214
4202
  async ({ pageDataDownloadUrl }) => {
4215
4203
  try {
@@ -4231,7 +4219,7 @@ ${text2}`);
4231
4219
  "create_funnel",
4232
4220
  "Create a new funnel/website. Starts empty \u2014 add steps and pages after creation.",
4233
4221
  {
4234
- name: import_zod31.z.string().describe("Name for the new funnel.")
4222
+ name: import_zod32.z.string().describe("Name for the new funnel.")
4235
4223
  },
4236
4224
  async ({ name }) => {
4237
4225
  try {
@@ -4253,9 +4241,9 @@ ${text2}`);
4253
4241
  "update_funnel",
4254
4242
  "Update a funnel's name, domain, or steps configuration.",
4255
4243
  {
4256
- funnelId: import_zod31.z.string().describe("The funnel ID to update."),
4257
- name: import_zod31.z.string().optional().describe("New funnel name."),
4258
- steps: import_zod31.z.array(import_zod31.z.record(import_zod31.z.unknown())).optional().describe("Updated steps array with page references.")
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.")
4259
4247
  },
4260
4248
  async ({ funnelId, name, steps }) => {
4261
4249
  try {
@@ -4275,8 +4263,8 @@ ${text2}`);
4275
4263
  "delete_funnel",
4276
4264
  "Permanently delete a funnel and all its pages. IRREVERSIBLE.",
4277
4265
  {
4278
- funnelId: import_zod31.z.string().describe("The funnel ID to delete."),
4279
- confirm: import_zod31.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
4280
4268
  },
4281
4269
  async ({ funnelId }) => {
4282
4270
  try {
@@ -4293,9 +4281,9 @@ ${text2}`);
4293
4281
  "create_funnel_page",
4294
4282
  "Create a new page in a funnel. Returns the page ID which you can then update with content.",
4295
4283
  {
4296
- funnelId: import_zod31.z.string().describe("The funnel ID to add the page to."),
4297
- name: import_zod31.z.string().describe("Page name."),
4298
- url: import_zod31.z.string().optional().describe("URL slug for the page (e.g. '/thank-you').")
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').")
4299
4287
  },
4300
4288
  async ({ funnelId, name, url }) => {
4301
4289
  try {
@@ -4317,8 +4305,8 @@ ${text2}`);
4317
4305
  "update_page_content",
4318
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.",
4319
4307
  {
4320
- pageId: import_zod31.z.string().describe("The page ID to update."),
4321
- content: import_zod31.z.record(import_zod31.z.unknown()).describe("The full page content JSON (sections, settings, general, pageStyles, trackingCode, popups, popupsList).")
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).")
4322
4310
  },
4323
4311
  async ({ pageId, content }) => {
4324
4312
  try {
@@ -4338,8 +4326,8 @@ ${text2}`);
4338
4326
  "delete_funnel_page",
4339
4327
  "Permanently delete a page from a funnel. IRREVERSIBLE.",
4340
4328
  {
4341
- pageId: import_zod31.z.string().describe("The page ID to delete."),
4342
- confirm: import_zod31.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
4343
4331
  },
4344
4332
  async ({ pageId }) => {
4345
4333
  try {
@@ -4355,7 +4343,7 @@ ${text2}`);
4355
4343
  }
4356
4344
 
4357
4345
  // src/tools/form-builder.ts
4358
- var import_zod32 = require("zod");
4346
+ var import_zod33 = require("zod");
4359
4347
  function registerFormBuilderTools(server2, builderClient) {
4360
4348
  const client = builderClient;
4361
4349
  if (!client) return;
@@ -4384,7 +4372,7 @@ ${text2}`);
4384
4372
  "get_form_full",
4385
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.",
4386
4374
  {
4387
- formId: import_zod32.z.string().describe("The form ID to retrieve.")
4375
+ formId: import_zod33.z.string().describe("The form ID to retrieve.")
4388
4376
  },
4389
4377
  async ({ formId }) => {
4390
4378
  try {
@@ -4401,9 +4389,9 @@ ${text2}`);
4401
4389
  "update_form",
4402
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.",
4403
4391
  {
4404
- formId: import_zod32.z.string().describe("The form ID to update."),
4405
- formData: import_zod32.z.record(import_zod32.z.unknown()).describe("The updated formData object containing form fields, settings, autoResponder config, etc."),
4406
- name: import_zod32.z.string().optional().describe("Updated form 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.")
4407
4395
  },
4408
4396
  async ({ formId, formData, name }) => {
4409
4397
  try {
@@ -4422,7 +4410,7 @@ ${text2}`);
4422
4410
  "create_form",
4423
4411
  "Create a new form. Starts with a basic structure \u2014 use update_form to add fields and configure settings.",
4424
4412
  {
4425
- name: import_zod32.z.string().describe("Name for the new form.")
4413
+ name: import_zod33.z.string().describe("Name for the new form.")
4426
4414
  },
4427
4415
  async ({ name }) => {
4428
4416
  try {
@@ -4448,8 +4436,8 @@ ${text2}`);
4448
4436
  "delete_form",
4449
4437
  "Permanently delete a form. IRREVERSIBLE.",
4450
4438
  {
4451
- formId: import_zod32.z.string().describe("The form ID to delete."),
4452
- confirm: import_zod32.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
4453
4441
  },
4454
4442
  async ({ formId }) => {
4455
4443
  try {
@@ -4466,9 +4454,9 @@ ${text2}`);
4466
4454
  "get_form_submissions_full",
4467
4455
  "Get form submissions with full field data, contact info, and submission timestamps via the internal API. Offset-based pagination via skip/limit.",
4468
4456
  {
4469
- formId: import_zod32.z.string().optional().describe("Filter by form ID. If omitted, returns all submissions."),
4470
- limit: import_zod32.z.number().optional().describe("Max submissions to return. Defaults to 20."),
4471
- skip: import_zod32.z.number().optional().describe("Number to skip for pagination.")
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.")
4472
4460
  },
4473
4461
  async ({ formId, limit, skip }) => {
4474
4462
  try {
@@ -4487,7 +4475,7 @@ ${text2}`);
4487
4475
  }
4488
4476
 
4489
4477
  // src/tools/pipeline-builder.ts
4490
- var import_zod33 = require("zod");
4478
+ var import_zod34 = require("zod");
4491
4479
  function registerPipelineBuilderTools(server2, builderClient) {
4492
4480
  const client = builderClient;
4493
4481
  if (!client) return;
@@ -4532,7 +4520,7 @@ ${text2}`);
4532
4520
  "get_pipeline_full",
4533
4521
  "Get a single pipeline with complete stage configuration: IDs, names, positions, display settings.",
4534
4522
  {
4535
- pipelineId: import_zod33.z.string().describe("The pipeline ID to retrieve.")
4523
+ pipelineId: import_zod34.z.string().describe("The pipeline ID to retrieve.")
4536
4524
  },
4537
4525
  async ({ pipelineId }) => {
4538
4526
  try {
@@ -4550,17 +4538,17 @@ ${text2}`);
4550
4538
  "create_pipeline",
4551
4539
  "Create a new pipeline with stages. Each stage needs a name and position (0-based).",
4552
4540
  {
4553
- name: import_zod33.z.string().describe("Pipeline name."),
4554
- stages: import_zod33.z.array(
4555
- import_zod33.z.object({
4556
- name: import_zod33.z.string().describe("Stage name."),
4557
- position: import_zod33.z.number().describe("Stage position (0-based)."),
4558
- showInFunnel: import_zod33.z.boolean().optional().describe("Show in funnel view. Defaults to true."),
4559
- showInPieChart: import_zod33.z.boolean().optional().describe("Show in pie chart. Defaults to true.")
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.")
4560
4548
  })
4561
4549
  ).describe("Array of stages in order."),
4562
- showInFunnel: import_zod33.z.boolean().optional().describe("Show pipeline in funnel view. Defaults to true."),
4563
- showInPieChart: import_zod33.z.boolean().optional().describe("Show pipeline in pie chart. Defaults to true.")
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.")
4564
4552
  },
4565
4553
  async ({ name, stages, showInFunnel, showInPieChart }) => {
4566
4554
  try {
@@ -4590,19 +4578,19 @@ ${text2}`);
4590
4578
  "update_pipeline",
4591
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.",
4592
4580
  {
4593
- pipelineId: import_zod33.z.string().describe("The pipeline ID to update."),
4594
- name: import_zod33.z.string().optional().describe("New pipeline name."),
4595
- stages: import_zod33.z.array(
4596
- import_zod33.z.object({
4597
- id: import_zod33.z.string().optional().describe("Existing stage ID (omit for new stages)."),
4598
- name: import_zod33.z.string().describe("Stage name."),
4599
- position: import_zod33.z.number().describe("Stage position (0-based)."),
4600
- showInFunnel: import_zod33.z.boolean().optional().describe("Show in funnel view."),
4601
- showInPieChart: import_zod33.z.boolean().optional().describe("Show in pie chart.")
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.")
4602
4590
  })
4603
4591
  ).optional().describe("Complete stages array. Stages not included will be removed."),
4604
- showInFunnel: import_zod33.z.boolean().optional().describe("Show pipeline in funnel view."),
4605
- showInPieChart: import_zod33.z.boolean().optional().describe("Show pipeline in pie chart.")
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.")
4606
4594
  },
4607
4595
  async ({ pipelineId, name, stages, showInFunnel, showInPieChart }) => {
4608
4596
  try {
@@ -4625,8 +4613,8 @@ ${text2}`);
4625
4613
  "delete_pipeline",
4626
4614
  "Permanently delete a pipeline and all its stages. Opportunities become unassigned. IRREVERSIBLE.",
4627
4615
  {
4628
- pipelineId: import_zod33.z.string().describe("The pipeline ID to delete."),
4629
- confirm: import_zod33.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
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.")
4630
4618
  },
4631
4619
  async ({ pipelineId }) => {
4632
4620
  try {
@@ -4643,7 +4631,7 @@ ${text2}`);
4643
4631
  }
4644
4632
 
4645
4633
  // src/tools/location-switcher.ts
4646
- var import_zod34 = require("zod");
4634
+ var import_zod35 = require("zod");
4647
4635
  var switchChain = Promise.resolve();
4648
4636
  function withSwitchLock(fn) {
4649
4637
  const next = switchChain.then(fn, fn);
@@ -4692,7 +4680,7 @@ Token registry: ${registeredCount} location(s) registered${versionLine}`
4692
4680
  "switch_location",
4693
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.",
4694
4682
  {
4695
- locationId: import_zod34.z.string().describe("The Location ID to switch to.")
4683
+ locationId: import_zod35.z.string().describe("The Location ID to switch to.")
4696
4684
  },
4697
4685
  async ({ locationId: locationId2 }) => withSwitchLock(async () => {
4698
4686
  const previousId = client.defaultLocationId;
@@ -4757,9 +4745,9 @@ Still on: ${previousId || "none"}${hint}` }],
4757
4745
  "register_location",
4758
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.",
4759
4747
  {
4760
- locationId: import_zod34.z.string().describe("The GHL Location ID (from Settings > Business Profile)."),
4761
- name: import_zod34.z.string().describe("A friendly name for this sub-account (e.g. 'PNTracker', 'Med Spa Template')."),
4762
- apiKey: import_zod34.z.string().describe("The Private Integration API key for this sub-account (starts with 'pit-').")
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-').")
4763
4751
  },
4764
4752
  async ({ locationId: locationId2, name, apiKey: apiKey2 }) => {
4765
4753
  if (!registry2) {
@@ -4809,7 +4797,7 @@ The API key could not access location ${locationId2}. Make sure:
4809
4797
  "unregister_location",
4810
4798
  "Remove a GHL sub-account from the token registry.",
4811
4799
  {
4812
- locationId: import_zod34.z.string().describe("The Location ID to remove.")
4800
+ locationId: import_zod35.z.string().describe("The Location ID to remove.")
4813
4801
  },
4814
4802
  async ({ locationId: locationId2 }) => {
4815
4803
  if (!registry2) {
@@ -4868,8 +4856,8 @@ ${lines.join("\n")}
4868
4856
  "list_available_locations",
4869
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.",
4870
4858
  {
4871
- limit: import_zod34.z.number().optional().describe("Max locations to return. Defaults to 20."),
4872
- skip: import_zod34.z.number().optional().describe("Number to skip for pagination.")
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.")
4873
4861
  },
4874
4862
  async ({ limit, skip }) => {
4875
4863
  try {
@@ -4912,7 +4900,7 @@ ${lines.join("\n")}
4912
4900
  }
4913
4901
 
4914
4902
  // src/tools/bulk-operations.ts
4915
- var import_zod35 = require("zod");
4903
+ var import_zod36 = require("zod");
4916
4904
  function delay(ms) {
4917
4905
  return new Promise((resolve5) => setTimeout(resolve5, ms));
4918
4906
  }
@@ -4924,8 +4912,8 @@ function registerBulkOperationTools(server2, client) {
4924
4912
  "bulk_add_tags",
4925
4913
  "Add tags to multiple contacts at once. Rate-limited to avoid API throttling. Returns a summary of successes and failures.",
4926
4914
  {
4927
- contactIds: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to tag."),
4928
- tags: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one tag required.").describe("Tags to add to each contact.")
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.")
4929
4917
  },
4930
4918
  async ({ contactIds, tags }) => {
4931
4919
  const results = { success: 0, failed: 0, errors: [] };
@@ -4947,8 +4935,8 @@ function registerBulkOperationTools(server2, client) {
4947
4935
  "bulk_remove_tags",
4948
4936
  "Remove tags from multiple contacts at once. Rate-limited.",
4949
4937
  {
4950
- contactIds: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs."),
4951
- tags: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one tag required.").describe("Tags to remove from each contact.")
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.")
4952
4940
  },
4953
4941
  async ({ contactIds, tags }) => {
4954
4942
  const results = { success: 0, failed: 0, errors: [] };
@@ -4969,8 +4957,8 @@ function registerBulkOperationTools(server2, client) {
4969
4957
  "bulk_update_contacts",
4970
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.",
4971
4959
  {
4972
- contactIds: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to update."),
4973
- fields: import_zod35.z.record(import_zod35.z.unknown()).describe("Fields to set on each contact (e.g. {customField: {id: 'xxx', value: 'yyy'}}, {source: 'Import'}).")
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'}).")
4974
4962
  },
4975
4963
  async ({ contactIds, fields }) => {
4976
4964
  const results = { success: 0, failed: 0, errors: [] };
@@ -4991,8 +4979,8 @@ function registerBulkOperationTools(server2, client) {
4991
4979
  "bulk_add_to_workflow",
4992
4980
  "Enroll multiple contacts into a workflow at once. Rate-limited.",
4993
4981
  {
4994
- contactIds: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to enroll."),
4995
- workflowId: import_zod35.z.string().describe("The workflow ID to enroll contacts into.")
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.")
4996
4984
  },
4997
4985
  async ({ contactIds, workflowId }) => {
4998
4986
  const results = { success: 0, failed: 0, errors: [] };
@@ -5013,8 +5001,8 @@ function registerBulkOperationTools(server2, client) {
5013
5001
  "bulk_delete_contacts",
5014
5002
  "Delete multiple contacts at once. IRREVERSIBLE. Rate-limited. Use with extreme caution.",
5015
5003
  {
5016
- contactIds: import_zod35.z.array(import_zod35.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to permanently delete."),
5017
- confirm: import_zod35.z.literal("DELETE").describe("Must pass the string 'DELETE' to confirm. This is a safety check.")
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.")
5018
5006
  },
5019
5007
  async ({ contactIds, confirm }) => {
5020
5008
  if (confirm !== "DELETE") {
@@ -5037,7 +5025,7 @@ function registerBulkOperationTools(server2, client) {
5037
5025
  }
5038
5026
 
5039
5027
  // src/tools/account-export.ts
5040
- var import_zod36 = require("zod");
5028
+ var import_zod37 = require("zod");
5041
5029
  function delay2(ms) {
5042
5030
  return new Promise((resolve5) => setTimeout(resolve5, ms));
5043
5031
  }
@@ -5047,8 +5035,8 @@ function registerAccountExportTools(server2, client) {
5047
5035
  "export_account",
5048
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.",
5049
5037
  {
5050
- locationId: import_zod36.z.string().optional().describe("Location ID to export. Uses default if not specified."),
5051
- includeContacts: import_zod36.z.boolean().optional().describe("Include contact list (first 100). Defaults to false for speed.")
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.")
5052
5040
  },
5053
5041
  async ({ locationId: locationId2, includeContacts }) => {
5054
5042
  try {
@@ -5176,8 +5164,8 @@ function registerAccountExportTools(server2, client) {
5176
5164
  "compare_locations",
5177
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.",
5178
5166
  {
5179
- locationA: import_zod36.z.string().describe("First Location ID."),
5180
- locationB: import_zod36.z.string().describe("Second Location ID.")
5167
+ locationA: import_zod37.z.string().describe("First Location ID."),
5168
+ locationB: import_zod37.z.string().describe("Second Location ID.")
5181
5169
  },
5182
5170
  async ({ locationA, locationB }) => {
5183
5171
  try {
@@ -5255,7 +5243,7 @@ function registerAccountExportTools(server2, client) {
5255
5243
  }
5256
5244
 
5257
5245
  // src/tools/workflow-cloner.ts
5258
- var import_zod37 = require("zod");
5246
+ var import_zod38 = require("zod");
5259
5247
  var crypto2 = __toESM(require("crypto"));
5260
5248
  function registerWorkflowClonerTools(server2, builderClient) {
5261
5249
  const client = builderClient;
@@ -5264,8 +5252,8 @@ function registerWorkflowClonerTools(server2, builderClient) {
5264
5252
  "clone_workflow",
5265
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.",
5266
5254
  {
5267
- sourceWorkflowId: import_zod37.z.string().describe("The workflow ID to clone."),
5268
- newName: import_zod37.z.string().describe("Name for the cloned workflow.")
5255
+ sourceWorkflowId: import_zod38.z.string().describe("The workflow ID to clone."),
5256
+ newName: import_zod38.z.string().describe("Name for the cloned workflow.")
5269
5257
  },
5270
5258
  async ({ sourceWorkflowId, newName }) => {
5271
5259
  try {
@@ -5354,41 +5342,41 @@ function registerWorkflowClonerTools(server2, builderClient) {
5354
5342
  }
5355
5343
 
5356
5344
  // src/tools/template-deployer.ts
5357
- var import_zod38 = require("zod");
5345
+ var import_zod39 = require("zod");
5358
5346
  var fs3 = __toESM(require("fs"));
5359
5347
  var path3 = __toESM(require("path"));
5360
5348
  function delay3(ms) {
5361
5349
  return new Promise((resolve5) => setTimeout(resolve5, ms));
5362
5350
  }
5363
- var TemplateSchema = import_zod38.z.object({
5364
- templateName: import_zod38.z.string(),
5365
- templateVersion: import_zod38.z.string().optional(),
5366
- description: import_zod38.z.string().optional().default(""),
5367
- questionnaire: import_zod38.z.array(import_zod38.z.object({
5368
- id: import_zod38.z.string(),
5369
- question: import_zod38.z.string(),
5370
- type: import_zod38.z.string(),
5371
- required: import_zod38.z.boolean().optional(),
5372
- placeholder: import_zod38.z.string().optional()
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()
5373
5361
  })).optional().default([]),
5374
- location: import_zod38.z.record(import_zod38.z.unknown()).optional(),
5375
- tags: import_zod38.z.array(import_zod38.z.string()).optional(),
5376
- customFields: import_zod38.z.array(import_zod38.z.object({
5377
- name: import_zod38.z.string(),
5378
- dataType: import_zod38.z.string()
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()
5379
5367
  })).optional(),
5380
- pipelines: import_zod38.z.array(import_zod38.z.object({
5381
- name: import_zod38.z.string(),
5382
- stages: import_zod38.z.array(import_zod38.z.object({ position: import_zod38.z.number(), name: import_zod38.z.string() }))
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() }))
5383
5371
  })).optional(),
5384
- workflows: import_zod38.z.array(import_zod38.z.object({
5385
- name: import_zod38.z.string(),
5386
- condition: import_zod38.z.string().optional(),
5387
- actions: import_zod38.z.array(import_zod38.z.record(import_zod38.z.unknown())).optional().default([])
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([])
5388
5376
  })).optional(),
5389
- calendars: import_zod38.z.array(import_zod38.z.object({
5390
- name: import_zod38.z.string(),
5391
- description: import_zod38.z.string().optional()
5377
+ calendars: import_zod39.z.array(import_zod39.z.object({
5378
+ name: import_zod39.z.string(),
5379
+ description: import_zod39.z.string().optional()
5392
5380
  })).optional()
5393
5381
  });
5394
5382
  function registerTemplateDeployerTools(server2, client) {
@@ -5459,7 +5447,7 @@ function registerTemplateDeployerTools(server2, client) {
5459
5447
  "get_template_questionnaire",
5460
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.",
5461
5449
  {
5462
- templateFile: import_zod38.z.string().describe("Path to the template JSON file (from list_templates).")
5450
+ templateFile: import_zod39.z.string().describe("Path to the template JSON file (from list_templates).")
5463
5451
  },
5464
5452
  async ({ templateFile }) => {
5465
5453
  try {
@@ -5492,10 +5480,10 @@ function registerTemplateDeployerTools(server2, client) {
5492
5480
  "deploy_template",
5493
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.",
5494
5482
  {
5495
- templateFile: import_zod38.z.string().describe("Path to the template JSON file."),
5496
- answers: import_zod38.z.record(import_zod38.z.unknown()).describe("Questionnaire answers keyed by question ID (e.g. {business_name: 'My Clinic', business_phone: '+15551234567', ...})."),
5497
- locationId: import_zod38.z.string().optional().describe("Location ID to deploy to. Uses default if not specified."),
5498
- dryRun: import_zod38.z.boolean().optional().describe("If true, shows what would be created without actually creating anything. Defaults to false.")
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.")
5499
5487
  },
5500
5488
  async ({ templateFile, answers, locationId: locationId2, dryRun }) => {
5501
5489
  try {
@@ -5789,18 +5777,18 @@ function registerAllTools(server2, client, registry2, mcpVersion) {
5789
5777
  var fs4 = __toESM(require("fs"));
5790
5778
  var path4 = __toESM(require("path"));
5791
5779
  var os = __toESM(require("os"));
5792
- var import_zod39 = require("zod");
5780
+ var import_zod40 = require("zod");
5793
5781
  var APP_NAME = "elitedcs-ghl-mcp";
5794
- var CredentialsSchema = import_zod39.z.object({
5795
- license_key: import_zod39.z.string().min(1),
5796
- email: import_zod39.z.string().email(),
5797
- verified_at: import_zod39.z.string().min(1),
5798
- ghl_api_key: import_zod39.z.string().min(1),
5799
- ghl_location_id: import_zod39.z.string().min(1),
5800
- ghl_company_id: import_zod39.z.string().optional(),
5801
- ghl_user_id: import_zod39.z.string().optional(),
5802
- ghl_firebase_api_key: import_zod39.z.string().optional(),
5803
- ghl_firebase_refresh_token: import_zod39.z.string().optional()
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()
5804
5792
  });
5805
5793
  function appDataDir() {
5806
5794
  const home = os.homedir();
@@ -5850,7 +5838,7 @@ function writeCredentials(creds) {
5850
5838
  // src/setup-tool.ts
5851
5839
  var os2 = __toESM(require("os"));
5852
5840
  var crypto3 = __toESM(require("crypto"));
5853
- var import_zod40 = require("zod");
5841
+ var import_zod41 = require("zod");
5854
5842
  var LICENSE_API = "https://elitedcs.com/api/validate-license";
5855
5843
  var GHL_API = "https://services.leadconnectorhq.com";
5856
5844
  var FIREBASE_TOKEN_API = "https://securetoken.googleapis.com/v1/token";
@@ -5921,14 +5909,14 @@ function registerSetupTool(server2) {
5921
5909
  "setup_ghl_mcp",
5922
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.",
5923
5911
  {
5924
- email: import_zod40.z.string().email().describe("Email used at purchase."),
5925
- license_key: import_zod40.z.string().min(20).describe("License key from your purchase email."),
5926
- ghl_api_key: import_zod40.z.string().min(10).describe("GHL Private Integration key (starts with 'pit-'). Created INSIDE the sub-account at Settings > Integrations > Private Integrations."),
5927
- ghl_location_id: import_zod40.z.string().min(10).describe("GHL Location ID (sub-account ID). Found in your GHL URL: /location/THIS_PART/dashboard."),
5928
- ghl_company_id: import_zod40.z.string().optional().describe("(Agency only) Company ID for multi-location access."),
5929
- ghl_user_id: import_zod40.z.string().optional().describe("(Workflow Builder, optional) Firebase User ID. See README for browser capture instructions."),
5930
- ghl_firebase_api_key: import_zod40.z.string().optional().describe("(Workflow Builder, optional) Firebase API Key starting with 'AIza'."),
5931
- ghl_firebase_refresh_token: import_zod40.z.string().optional().describe("(Workflow Builder, optional) Firebase refresh token starting with 'AMf-'.")
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-'.")
5932
5920
  },
5933
5921
  async (args) => {
5934
5922
  const lic = await validateLicense(args.email, args.license_key);