@elitedcs/ghl-mcp 3.1.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/README.md +1 -1
- package/dist/index.js +1121 -931
- package/package.json +1 -1
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.
|
|
34
|
+
version: "3.3.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,360 @@ 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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}).passthrough()
|
|
438
|
-
|
|
439
|
-
|
|
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 describe(status, knownFields) {
|
|
409
|
+
switch (status) {
|
|
410
|
+
case "fieldless":
|
|
411
|
+
return "No filter fields \u2014 trigger fires on any event of this type.";
|
|
412
|
+
case "documented":
|
|
413
|
+
return `Known field paths: ${knownFields.join(", ")}.`;
|
|
414
|
+
case "partial":
|
|
415
|
+
return knownFields.length > 0 ? `Known field paths: ${knownFields.join(", ")}. Note: GHL exposes additional filter fields that aren't yet captured; pass them through if known.` : "GHL exposes one or more filter fields for this trigger; the exact field paths are not yet captured. Pass through whatever you know from the GHL UI.";
|
|
416
|
+
case "uncaptured":
|
|
417
|
+
return "Filter field paths not yet captured. Pass through whatever fields you know from the GHL UI; reads will accept any.";
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function typedTrigger(typeLiteral, knownFields, status = "documented") {
|
|
421
|
+
const fieldDesc = describe(status, knownFields);
|
|
422
|
+
return TriggerCommonSchema.extend({
|
|
423
|
+
type: import_zod2.z.literal(typeLiteral),
|
|
424
|
+
conditions: import_zod2.z.array(import_zod2.z.object({
|
|
425
|
+
operator: import_zod2.z.string().describe("Comparison operator (equals, greater_than, less_than, contains, index-of-true, is-any-of, etc.)."),
|
|
426
|
+
field: import_zod2.z.string().describe(fieldDesc),
|
|
427
|
+
value: import_zod2.z.unknown().optional(),
|
|
428
|
+
title: import_zod2.z.string().optional(),
|
|
429
|
+
type: import_zod2.z.string().optional(),
|
|
430
|
+
id: import_zod2.z.string().optional()
|
|
431
|
+
}).passthrough()).optional()
|
|
432
|
+
});
|
|
433
|
+
}
|
|
446
434
|
var ContactTagTriggerSchema = TriggerCommonSchema.extend({
|
|
447
435
|
type: import_zod2.z.literal("contact_tag"),
|
|
448
|
-
conditions: import_zod2.z.array(
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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()
|
|
436
|
+
conditions: import_zod2.z.array(import_zod2.z.object({
|
|
437
|
+
operator: import_zod2.z.string(),
|
|
438
|
+
field: import_zod2.z.enum(["tagsAdded", "tagsRemoved"]),
|
|
439
|
+
value: import_zod2.z.string(),
|
|
440
|
+
title: import_zod2.z.string().optional(),
|
|
441
|
+
type: import_zod2.z.string().optional(),
|
|
442
|
+
id: import_zod2.z.string().optional()
|
|
443
|
+
}).passthrough())
|
|
461
444
|
});
|
|
445
|
+
var AppointmentTriggerSchema = typedTrigger("appointment", [
|
|
446
|
+
"calendar.id",
|
|
447
|
+
"appointment.status",
|
|
448
|
+
// new | confirmed | cancelled | showed | noshow | invalid
|
|
449
|
+
"contact.tags",
|
|
450
|
+
"appointment.eventType",
|
|
451
|
+
"appointment.modifiedBy"
|
|
452
|
+
]);
|
|
453
|
+
var BirthdayReminderTriggerSchema = typedTrigger("birthday_reminder", [
|
|
454
|
+
"contact.birthMonth",
|
|
455
|
+
"contact.birthDay",
|
|
456
|
+
"contact.dateOfBirth"
|
|
457
|
+
]);
|
|
458
|
+
var CallStatusTriggerSchema = typedTrigger("call_status", [
|
|
459
|
+
"call_status",
|
|
460
|
+
"custom_disposition",
|
|
461
|
+
"message.direction",
|
|
462
|
+
"workflow.id"
|
|
463
|
+
]);
|
|
464
|
+
var CategoryCompletedTriggerSchema = typedTrigger("category_completed", [
|
|
465
|
+
"membership.product.id"
|
|
466
|
+
]);
|
|
467
|
+
var CategoryStartedTriggerSchema = typedTrigger("category_started", [
|
|
468
|
+
"membership.product.id"
|
|
469
|
+
]);
|
|
470
|
+
var ContactChangedTriggerSchema = typedTrigger("contact_changed", [
|
|
471
|
+
"contact.tags",
|
|
472
|
+
"contact.dnd",
|
|
473
|
+
"contact.assignedTo",
|
|
474
|
+
"contact.phone",
|
|
475
|
+
"contact.email",
|
|
476
|
+
"contact.type",
|
|
477
|
+
"contact.address1",
|
|
478
|
+
"contact.city",
|
|
479
|
+
"contact.state",
|
|
480
|
+
"contact.country",
|
|
481
|
+
"contact.postalCode",
|
|
482
|
+
"contact.website"
|
|
483
|
+
]);
|
|
484
|
+
var ContactCreatedTriggerSchema = typedTrigger("contact_created", [
|
|
485
|
+
"tagsAdded",
|
|
486
|
+
"contact.phone",
|
|
487
|
+
"contact.email",
|
|
488
|
+
"contact.type"
|
|
489
|
+
]);
|
|
490
|
+
var CustomerAppointmentTriggerSchema = typedTrigger("customer_appointment", [
|
|
491
|
+
"calendar.id",
|
|
492
|
+
"contact.tags"
|
|
493
|
+
]);
|
|
494
|
+
var CustomerReplyTriggerSchema = typedTrigger("customer_reply", [
|
|
495
|
+
"workflow.id",
|
|
496
|
+
"message.type",
|
|
497
|
+
"message.body",
|
|
498
|
+
"contact.tags"
|
|
499
|
+
]);
|
|
500
|
+
var DndContactTriggerSchema = typedTrigger("dnd_contact", [
|
|
501
|
+
"contact.dnd_direction",
|
|
502
|
+
"contact.dnd",
|
|
503
|
+
"contact.tags"
|
|
504
|
+
]);
|
|
505
|
+
var FormSubmissionTriggerSchema = typedTrigger("form_submission", [
|
|
506
|
+
"form.id",
|
|
507
|
+
"formData.termsAndConditions"
|
|
508
|
+
]);
|
|
509
|
+
var InvoiceTriggerSchema = typedTrigger("invoice", [
|
|
510
|
+
"invoice.status",
|
|
511
|
+
"contact.tags"
|
|
512
|
+
]);
|
|
513
|
+
var IvrIncomingCallTriggerSchema = typedTrigger("ivr_incoming_call", [
|
|
514
|
+
"inbound_number"
|
|
515
|
+
]);
|
|
516
|
+
var LessonCompletedTriggerSchema = typedTrigger("lesson_completed", [
|
|
517
|
+
"membership.product.id"
|
|
518
|
+
]);
|
|
519
|
+
var LessonStartedTriggerSchema = typedTrigger("lesson_started", [
|
|
520
|
+
"membership.product.id"
|
|
521
|
+
]);
|
|
522
|
+
var MailgunEmailEventTriggerSchema = typedTrigger("mailgun_email_event", [
|
|
523
|
+
"workflow.id",
|
|
524
|
+
"mailgun.event"
|
|
525
|
+
// opened | clicked | bounced | delivered | etc.
|
|
526
|
+
]);
|
|
527
|
+
var MembershipContactCreatedTriggerSchema = typedTrigger("membership_contact_created", [
|
|
528
|
+
"offer.id"
|
|
529
|
+
]);
|
|
530
|
+
var NoteAddTriggerSchema = typedTrigger("note_add", [
|
|
531
|
+
"contact.tags"
|
|
532
|
+
]);
|
|
533
|
+
var NoteChangedTriggerSchema = typedTrigger("note_changed", [
|
|
534
|
+
"contact.tags"
|
|
535
|
+
]);
|
|
536
|
+
var OfferAccessGrantedTriggerSchema = typedTrigger("offer_access_granted", [
|
|
537
|
+
"offer.id"
|
|
538
|
+
]);
|
|
539
|
+
var OfferAccessRemovedTriggerSchema = typedTrigger("offer_access_removed", [
|
|
540
|
+
"offer.id"
|
|
541
|
+
]);
|
|
542
|
+
var OpportunityChangedTriggerSchema = typedTrigger("opportunity_changed", [
|
|
543
|
+
"opportunity.pipelineId",
|
|
544
|
+
"contact.tags",
|
|
545
|
+
"opportunity.assignedTo",
|
|
546
|
+
"opportunity.monetaryValue",
|
|
547
|
+
"opportunity.forecastExpectedCloseDate",
|
|
548
|
+
"opportunity.forecastProbability",
|
|
549
|
+
"opportunity.status",
|
|
550
|
+
"opportunity.lostReasonId"
|
|
551
|
+
]);
|
|
552
|
+
var OpportunityCreatedTriggerSchema = typedTrigger("opportunity_created", [
|
|
553
|
+
"opportunity.pipelineId",
|
|
554
|
+
"contact.tags",
|
|
555
|
+
"opportunity.assignedTo",
|
|
556
|
+
"opportunity.monetaryValue",
|
|
557
|
+
"opportunity.forecastExpectedCloseDate",
|
|
558
|
+
"opportunity.forecastProbability",
|
|
559
|
+
"opportunity.status",
|
|
560
|
+
"opportunity.lostReasonId"
|
|
561
|
+
]);
|
|
562
|
+
var OpportunityDecayTriggerSchema = typedTrigger("opportunity_decay", [
|
|
563
|
+
"opportunity.pipelineId",
|
|
564
|
+
"opportunity.lastActionDate",
|
|
565
|
+
"contact.tags",
|
|
566
|
+
"opportunity.assignedTo",
|
|
567
|
+
"opportunity.monetaryValue",
|
|
568
|
+
"opportunity.forecastExpectedCloseDate",
|
|
569
|
+
"opportunity.forecastProbability",
|
|
570
|
+
"opportunity.status",
|
|
571
|
+
"opportunity.lostReasonId"
|
|
572
|
+
]);
|
|
573
|
+
var OpportunityStatusChangedTriggerSchema = typedTrigger("opportunity_status_changed", [
|
|
574
|
+
"opportunity.oldStatus",
|
|
575
|
+
"opportunity.status",
|
|
576
|
+
"opportunity.pipelineId",
|
|
577
|
+
"contact.tags",
|
|
578
|
+
"opportunity.assignedTo",
|
|
579
|
+
"opportunity.monetaryValue",
|
|
580
|
+
"opportunity.forecastExpectedCloseDate",
|
|
581
|
+
"opportunity.forecastProbability",
|
|
582
|
+
"opportunity.lostReasonId"
|
|
583
|
+
]);
|
|
584
|
+
var PipelineStageUpdatedTriggerSchema = typedTrigger("pipeline_stage_updated", [
|
|
585
|
+
"opportunity.pipelineId",
|
|
586
|
+
"opportunity.pipelineStageId",
|
|
587
|
+
// not in catalogue but central to this trigger by name
|
|
588
|
+
"contact.tags",
|
|
589
|
+
"opportunity.assignedTo",
|
|
590
|
+
"opportunity.monetaryValue",
|
|
591
|
+
"opportunity.forecastExpectedCloseDate",
|
|
592
|
+
"opportunity.forecastProbability",
|
|
593
|
+
"opportunity.status",
|
|
594
|
+
"opportunity.lostReasonId"
|
|
595
|
+
]);
|
|
596
|
+
var ProductAccessGrantedTriggerSchema = typedTrigger("product_access_granted", [
|
|
597
|
+
"product.id"
|
|
598
|
+
]);
|
|
599
|
+
var ProductAccessRemovedTriggerSchema = typedTrigger("product_access_removed", [
|
|
600
|
+
"product.id"
|
|
601
|
+
]);
|
|
602
|
+
var ProductCompletedTriggerSchema = typedTrigger("product_completed", [
|
|
603
|
+
"membership.product.id"
|
|
604
|
+
]);
|
|
605
|
+
var ProductStartedTriggerSchema = typedTrigger("product_started", [
|
|
606
|
+
"membership.product.id"
|
|
607
|
+
]);
|
|
608
|
+
var ShopifyAbandonedCartTriggerSchema = typedTrigger("shopify_abandoned_cart", [
|
|
609
|
+
"duration",
|
|
610
|
+
"cart_value"
|
|
611
|
+
]);
|
|
612
|
+
var ShopifyOrderFulfilledTriggerSchema = typedTrigger("shopify_order_fulfilled", [
|
|
613
|
+
"cart_value"
|
|
614
|
+
]);
|
|
615
|
+
var ShopifyOrderPlacedTriggerSchema = typedTrigger("shopify_order_placed", [
|
|
616
|
+
"cart_value"
|
|
617
|
+
]);
|
|
618
|
+
var SurveySubmissionTriggerSchema = typedTrigger("survey_submission", [
|
|
619
|
+
"survey.id",
|
|
620
|
+
"surveySubmission.disqualified",
|
|
621
|
+
"surveyData.termsAndConditions"
|
|
622
|
+
]);
|
|
623
|
+
var TaskAddedTriggerSchema = typedTrigger("task_added", [
|
|
624
|
+
"task.assignedTo"
|
|
625
|
+
]);
|
|
626
|
+
var TaskDueDateReminderTriggerSchema = typedTrigger("task_due_date_reminder", [
|
|
627
|
+
"task.dueDate"
|
|
628
|
+
]);
|
|
629
|
+
var TikTokFormSubmittedTriggerSchema = typedTrigger("tik_tok_form_submitted", [
|
|
630
|
+
"tikTok.formId"
|
|
631
|
+
]);
|
|
632
|
+
var TriggerLinkTriggerSchema = typedTrigger("trigger_link", [
|
|
633
|
+
"link.id"
|
|
634
|
+
]);
|
|
635
|
+
var TwoStepFormSubmissionTriggerSchema = typedTrigger("two_step_form_submission", [
|
|
636
|
+
"twoStepOrderForm.funnelId",
|
|
637
|
+
"twoStepOrderForm.submissionType"
|
|
638
|
+
]);
|
|
639
|
+
var ValidationErrorTriggerSchema = typedTrigger("validation_error", [
|
|
640
|
+
"contact.phoneInfo"
|
|
641
|
+
]);
|
|
642
|
+
var VideoEventTriggerSchema = typedTrigger("video_event", [
|
|
643
|
+
"video.funnelId",
|
|
644
|
+
"video.videoId",
|
|
645
|
+
"video.duration"
|
|
646
|
+
]);
|
|
647
|
+
var CustomDateReminderTriggerSchema = typedTrigger("custom_date_reminder", [], "partial");
|
|
648
|
+
var InboundTriggerTriggerSchema = typedTrigger("inbound_trigger", ["contact.tags"], "partial");
|
|
649
|
+
var FacebookCommentOnPostTriggerSchema = typedTrigger("facebook_comment_on_post", [], "partial");
|
|
650
|
+
var IgCommentOnPostTriggerSchema = typedTrigger("ig_comment_on_post", [], "partial");
|
|
651
|
+
var InboundWebhookTriggerSchema = typedTrigger("inbound_webhook", [], "fieldless");
|
|
652
|
+
var PaymentReceivedTriggerSchema = typedTrigger("payment_received", [], "fieldless");
|
|
653
|
+
var AffiliateCreatedTriggerSchema = typedTrigger("affiliate_created", [], "uncaptured");
|
|
654
|
+
var SchedulerTriggerTriggerSchema = typedTrigger("scheduler_trigger", [], "uncaptured");
|
|
655
|
+
var UserLogInTriggerSchema = typedTrigger("user_log_in", [], "uncaptured");
|
|
656
|
+
var OrderSubmissionTriggerSchema = typedTrigger("order_submission", [], "uncaptured");
|
|
657
|
+
var ConvAiTriggerTriggerSchema = typedTrigger("conv_ai_trigger", [], "uncaptured");
|
|
658
|
+
var ConvAiAutonomousTriggerTriggerSchema = typedTrigger("conv_ai_autonomous_trigger", [], "uncaptured");
|
|
659
|
+
var CustomObjectCreatedTriggerSchema = typedTrigger("custom_object_created", [], "uncaptured");
|
|
660
|
+
var CustomObjectChangedTriggerSchema = typedTrigger("custom_object_changed", [], "uncaptured");
|
|
661
|
+
var FacebookLeadGenTriggerSchema = typedTrigger("facebook_lead_gen", [], "uncaptured");
|
|
462
662
|
var UnknownTriggerSchema = TriggerCommonSchema.extend({
|
|
463
663
|
type: import_zod2.z.string(),
|
|
464
664
|
conditions: import_zod2.z.array(import_zod2.z.record(import_zod2.z.unknown())).optional()
|
|
465
665
|
});
|
|
466
666
|
var WorkflowTriggerSchema = import_zod2.z.union([
|
|
467
|
-
CustomerReplyTriggerSchema,
|
|
468
|
-
AppointmentTriggerSchema,
|
|
469
667
|
ContactTagTriggerSchema,
|
|
668
|
+
AppointmentTriggerSchema,
|
|
669
|
+
BirthdayReminderTriggerSchema,
|
|
670
|
+
CallStatusTriggerSchema,
|
|
671
|
+
CategoryCompletedTriggerSchema,
|
|
672
|
+
CategoryStartedTriggerSchema,
|
|
673
|
+
ContactChangedTriggerSchema,
|
|
674
|
+
ContactCreatedTriggerSchema,
|
|
675
|
+
CustomerAppointmentTriggerSchema,
|
|
676
|
+
CustomerReplyTriggerSchema,
|
|
677
|
+
DndContactTriggerSchema,
|
|
678
|
+
FormSubmissionTriggerSchema,
|
|
679
|
+
InvoiceTriggerSchema,
|
|
680
|
+
IvrIncomingCallTriggerSchema,
|
|
681
|
+
LessonCompletedTriggerSchema,
|
|
682
|
+
LessonStartedTriggerSchema,
|
|
683
|
+
MailgunEmailEventTriggerSchema,
|
|
684
|
+
MembershipContactCreatedTriggerSchema,
|
|
685
|
+
NoteAddTriggerSchema,
|
|
686
|
+
NoteChangedTriggerSchema,
|
|
687
|
+
OfferAccessGrantedTriggerSchema,
|
|
688
|
+
OfferAccessRemovedTriggerSchema,
|
|
689
|
+
OpportunityChangedTriggerSchema,
|
|
690
|
+
OpportunityCreatedTriggerSchema,
|
|
691
|
+
OpportunityDecayTriggerSchema,
|
|
692
|
+
OpportunityStatusChangedTriggerSchema,
|
|
470
693
|
PipelineStageUpdatedTriggerSchema,
|
|
694
|
+
ProductAccessGrantedTriggerSchema,
|
|
695
|
+
ProductAccessRemovedTriggerSchema,
|
|
696
|
+
ProductCompletedTriggerSchema,
|
|
697
|
+
ProductStartedTriggerSchema,
|
|
698
|
+
ShopifyAbandonedCartTriggerSchema,
|
|
699
|
+
ShopifyOrderFulfilledTriggerSchema,
|
|
700
|
+
ShopifyOrderPlacedTriggerSchema,
|
|
701
|
+
SurveySubmissionTriggerSchema,
|
|
702
|
+
TaskAddedTriggerSchema,
|
|
703
|
+
TaskDueDateReminderTriggerSchema,
|
|
704
|
+
TikTokFormSubmittedTriggerSchema,
|
|
705
|
+
TriggerLinkTriggerSchema,
|
|
706
|
+
TwoStepFormSubmissionTriggerSchema,
|
|
707
|
+
ValidationErrorTriggerSchema,
|
|
708
|
+
VideoEventTriggerSchema,
|
|
709
|
+
CustomDateReminderTriggerSchema,
|
|
710
|
+
InboundTriggerTriggerSchema,
|
|
711
|
+
FacebookCommentOnPostTriggerSchema,
|
|
712
|
+
IgCommentOnPostTriggerSchema,
|
|
713
|
+
InboundWebhookTriggerSchema,
|
|
714
|
+
PaymentReceivedTriggerSchema,
|
|
715
|
+
AffiliateCreatedTriggerSchema,
|
|
716
|
+
SchedulerTriggerTriggerSchema,
|
|
717
|
+
UserLogInTriggerSchema,
|
|
718
|
+
OrderSubmissionTriggerSchema,
|
|
719
|
+
ConvAiTriggerTriggerSchema,
|
|
720
|
+
ConvAiAutonomousTriggerTriggerSchema,
|
|
721
|
+
CustomObjectCreatedTriggerSchema,
|
|
722
|
+
CustomObjectChangedTriggerSchema,
|
|
723
|
+
FacebookLeadGenTriggerSchema,
|
|
471
724
|
UnknownTriggerSchema
|
|
472
725
|
]);
|
|
473
|
-
|
|
726
|
+
|
|
727
|
+
// src/workflow-builder-client.ts
|
|
728
|
+
var BACKEND_BASE = "https://backend.leadconnectorhq.com/workflow";
|
|
729
|
+
var FIREBASE_TOKEN_URL = "https://securetoken.googleapis.com/v1/token";
|
|
730
|
+
var MAX_RETRIES2 = 3;
|
|
731
|
+
var BASE_DELAY_MS2 = 500;
|
|
732
|
+
var FirebaseTokenSchema = import_zod3.z.object({
|
|
733
|
+
id_token: import_zod3.z.string(),
|
|
734
|
+
refresh_token: import_zod3.z.string(),
|
|
735
|
+
expires_in: import_zod3.z.string()
|
|
736
|
+
});
|
|
737
|
+
var WorkflowActionSchema = import_zod3.z.custom(
|
|
474
738
|
(value) => typeof value === "object" && value !== null && "type" in value
|
|
475
739
|
);
|
|
476
|
-
var WorkflowFullSchema =
|
|
477
|
-
_id:
|
|
478
|
-
name:
|
|
479
|
-
status:
|
|
480
|
-
version:
|
|
481
|
-
dataVersion:
|
|
482
|
-
timezone:
|
|
483
|
-
workflowData:
|
|
484
|
-
triggers:
|
|
485
|
-
createdAt:
|
|
486
|
-
updatedAt:
|
|
487
|
-
locationId:
|
|
488
|
-
stopOnResponse:
|
|
489
|
-
allowMultiple:
|
|
490
|
-
allowMultipleOpportunity:
|
|
491
|
-
autoMarkAsRead:
|
|
492
|
-
removeContactFromLastStep:
|
|
740
|
+
var WorkflowFullSchema = import_zod3.z.object({
|
|
741
|
+
_id: import_zod3.z.string(),
|
|
742
|
+
name: import_zod3.z.string(),
|
|
743
|
+
status: import_zod3.z.string(),
|
|
744
|
+
version: import_zod3.z.number(),
|
|
745
|
+
dataVersion: import_zod3.z.number().optional(),
|
|
746
|
+
timezone: import_zod3.z.string().optional(),
|
|
747
|
+
workflowData: import_zod3.z.object({ templates: import_zod3.z.array(WorkflowActionSchema).optional() }).optional(),
|
|
748
|
+
triggers: import_zod3.z.array(WorkflowTriggerSchema).optional(),
|
|
749
|
+
createdAt: import_zod3.z.string().optional(),
|
|
750
|
+
updatedAt: import_zod3.z.string().optional(),
|
|
751
|
+
locationId: import_zod3.z.string().optional(),
|
|
752
|
+
stopOnResponse: import_zod3.z.boolean().optional(),
|
|
753
|
+
allowMultiple: import_zod3.z.boolean().optional(),
|
|
754
|
+
allowMultipleOpportunity: import_zod3.z.boolean().optional(),
|
|
755
|
+
autoMarkAsRead: import_zod3.z.boolean().optional(),
|
|
756
|
+
removeContactFromLastStep: import_zod3.z.boolean().optional()
|
|
493
757
|
}).passthrough();
|
|
494
|
-
var CreateWorkflowResponseSchema =
|
|
758
|
+
var CreateWorkflowResponseSchema = import_zod3.z.union([
|
|
495
759
|
WorkflowFullSchema,
|
|
496
|
-
|
|
497
|
-
|
|
760
|
+
import_zod3.z.object({ _id: import_zod3.z.string() }).passthrough(),
|
|
761
|
+
import_zod3.z.object({ id: import_zod3.z.string() }).passthrough()
|
|
498
762
|
]).transform((data) => {
|
|
499
763
|
const id = "_id" in data && typeof data._id === "string" ? data._id : data.id;
|
|
500
764
|
return WorkflowFullSchema.parse({
|
|
@@ -975,7 +1239,7 @@ ${errorBody}`
|
|
|
975
1239
|
};
|
|
976
1240
|
|
|
977
1241
|
// src/tools/contacts.ts
|
|
978
|
-
var
|
|
1242
|
+
var import_zod5 = require("zod");
|
|
979
1243
|
|
|
980
1244
|
// src/tool-helpers.ts
|
|
981
1245
|
function errorResponse(error) {
|
|
@@ -1012,55 +1276,55 @@ function safeTool(server2, name, description, schema, handler) {
|
|
|
1012
1276
|
}
|
|
1013
1277
|
|
|
1014
1278
|
// src/api-schemas.ts
|
|
1015
|
-
var
|
|
1016
|
-
var ContactSchema =
|
|
1017
|
-
id:
|
|
1018
|
-
locationId:
|
|
1019
|
-
firstName:
|
|
1020
|
-
lastName:
|
|
1021
|
-
name:
|
|
1022
|
-
email:
|
|
1023
|
-
phone:
|
|
1024
|
-
tags:
|
|
1025
|
-
source:
|
|
1026
|
-
dateAdded:
|
|
1279
|
+
var import_zod4 = require("zod");
|
|
1280
|
+
var ContactSchema = import_zod4.z.object({
|
|
1281
|
+
id: import_zod4.z.string(),
|
|
1282
|
+
locationId: import_zod4.z.string().nullable().optional(),
|
|
1283
|
+
firstName: import_zod4.z.string().nullable().optional(),
|
|
1284
|
+
lastName: import_zod4.z.string().nullable().optional(),
|
|
1285
|
+
name: import_zod4.z.string().nullable().optional(),
|
|
1286
|
+
email: import_zod4.z.string().nullable().optional(),
|
|
1287
|
+
phone: import_zod4.z.string().nullable().optional(),
|
|
1288
|
+
tags: import_zod4.z.array(import_zod4.z.string()).nullable().optional(),
|
|
1289
|
+
source: import_zod4.z.string().nullable().optional(),
|
|
1290
|
+
dateAdded: import_zod4.z.string().nullable().optional()
|
|
1027
1291
|
}).passthrough();
|
|
1028
|
-
var ContactSearchResponseSchema =
|
|
1029
|
-
contacts:
|
|
1030
|
-
meta:
|
|
1031
|
-
total:
|
|
1032
|
-
count:
|
|
1033
|
-
currentPage:
|
|
1034
|
-
nextPage:
|
|
1035
|
-
prevPage:
|
|
1036
|
-
startAfterId:
|
|
1037
|
-
startAfter:
|
|
1292
|
+
var ContactSearchResponseSchema = import_zod4.z.object({
|
|
1293
|
+
contacts: import_zod4.z.array(ContactSchema),
|
|
1294
|
+
meta: import_zod4.z.object({
|
|
1295
|
+
total: import_zod4.z.number().nullable().optional(),
|
|
1296
|
+
count: import_zod4.z.number().nullable().optional(),
|
|
1297
|
+
currentPage: import_zod4.z.number().nullable().optional(),
|
|
1298
|
+
nextPage: import_zod4.z.union([import_zod4.z.number(), import_zod4.z.string()]).nullable().optional(),
|
|
1299
|
+
prevPage: import_zod4.z.union([import_zod4.z.number(), import_zod4.z.string()]).nullable().optional(),
|
|
1300
|
+
startAfterId: import_zod4.z.string().nullable().optional(),
|
|
1301
|
+
startAfter: import_zod4.z.number().nullable().optional()
|
|
1038
1302
|
}).passthrough().optional()
|
|
1039
1303
|
}).passthrough();
|
|
1040
|
-
var ContactResponseSchema =
|
|
1304
|
+
var ContactResponseSchema = import_zod4.z.object({
|
|
1041
1305
|
contact: ContactSchema
|
|
1042
1306
|
}).passthrough();
|
|
1043
|
-
var PipelineStageSchema =
|
|
1044
|
-
id:
|
|
1045
|
-
name:
|
|
1046
|
-
position:
|
|
1307
|
+
var PipelineStageSchema = import_zod4.z.object({
|
|
1308
|
+
id: import_zod4.z.string(),
|
|
1309
|
+
name: import_zod4.z.string(),
|
|
1310
|
+
position: import_zod4.z.number().optional()
|
|
1047
1311
|
}).passthrough();
|
|
1048
|
-
var PipelineSchema =
|
|
1049
|
-
id:
|
|
1050
|
-
name:
|
|
1051
|
-
stages:
|
|
1052
|
-
locationId:
|
|
1312
|
+
var PipelineSchema = import_zod4.z.object({
|
|
1313
|
+
id: import_zod4.z.string(),
|
|
1314
|
+
name: import_zod4.z.string(),
|
|
1315
|
+
stages: import_zod4.z.array(PipelineStageSchema),
|
|
1316
|
+
locationId: import_zod4.z.string().optional()
|
|
1053
1317
|
}).passthrough();
|
|
1054
|
-
var PipelinesResponseSchema =
|
|
1055
|
-
pipelines:
|
|
1318
|
+
var PipelinesResponseSchema = import_zod4.z.object({
|
|
1319
|
+
pipelines: import_zod4.z.array(PipelineSchema)
|
|
1056
1320
|
}).passthrough();
|
|
1057
|
-
var CalendarSchema =
|
|
1058
|
-
id:
|
|
1059
|
-
name:
|
|
1060
|
-
locationId:
|
|
1321
|
+
var CalendarSchema = import_zod4.z.object({
|
|
1322
|
+
id: import_zod4.z.string(),
|
|
1323
|
+
name: import_zod4.z.string(),
|
|
1324
|
+
locationId: import_zod4.z.string().optional()
|
|
1061
1325
|
}).passthrough();
|
|
1062
|
-
var CalendarsResponseSchema =
|
|
1063
|
-
calendars:
|
|
1326
|
+
var CalendarsResponseSchema = import_zod4.z.object({
|
|
1327
|
+
calendars: import_zod4.z.array(CalendarSchema)
|
|
1064
1328
|
}).passthrough();
|
|
1065
1329
|
|
|
1066
1330
|
// src/tools/contacts.ts
|
|
@@ -1070,12 +1334,12 @@ function registerContactTools(server2, client) {
|
|
|
1070
1334
|
"search_contacts",
|
|
1071
1335
|
"Search and list contacts in a GHL location. Supports filtering by query string, pagination, and sorting.",
|
|
1072
1336
|
{
|
|
1073
|
-
locationId:
|
|
1074
|
-
query:
|
|
1075
|
-
limit:
|
|
1076
|
-
startAfterId:
|
|
1077
|
-
sortBy:
|
|
1078
|
-
sortOrder:
|
|
1337
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1338
|
+
query: import_zod5.z.string().optional().describe("Search query to filter contacts (searches name, email, phone, etc.)."),
|
|
1339
|
+
limit: import_zod5.z.number().optional().describe("Maximum number of contacts to return. Defaults to 20."),
|
|
1340
|
+
startAfterId: import_zod5.z.string().optional().describe("Contact ID to start after, for cursor-based pagination."),
|
|
1341
|
+
sortBy: import_zod5.z.string().optional().describe("Field to sort results by (e.g. 'dateAdded', 'name')."),
|
|
1342
|
+
sortOrder: import_zod5.z.string().optional().describe("Sort direction: 'asc' or 'desc'.")
|
|
1079
1343
|
},
|
|
1080
1344
|
async ({ locationId: locationId2, query, limit, startAfterId, sortBy, sortOrder }) => {
|
|
1081
1345
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1097,7 +1361,7 @@ function registerContactTools(server2, client) {
|
|
|
1097
1361
|
"get_contact",
|
|
1098
1362
|
"Retrieve a single contact by their ID, including all profile fields, tags, and custom fields.",
|
|
1099
1363
|
{
|
|
1100
|
-
contactId:
|
|
1364
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to retrieve.")
|
|
1101
1365
|
},
|
|
1102
1366
|
async ({ contactId }) => {
|
|
1103
1367
|
const raw = await client.get(`/contacts/${contactId}`);
|
|
@@ -1109,25 +1373,25 @@ function registerContactTools(server2, client) {
|
|
|
1109
1373
|
"create_contact",
|
|
1110
1374
|
"Create a new contact in a GHL location. At minimum, provide a locationId and at least one identifying field (name, email, or phone).",
|
|
1111
1375
|
{
|
|
1112
|
-
locationId:
|
|
1113
|
-
firstName:
|
|
1114
|
-
lastName:
|
|
1115
|
-
name:
|
|
1116
|
-
email:
|
|
1117
|
-
phone:
|
|
1118
|
-
tags:
|
|
1119
|
-
source:
|
|
1120
|
-
companyName:
|
|
1121
|
-
address1:
|
|
1122
|
-
city:
|
|
1123
|
-
state:
|
|
1124
|
-
postalCode:
|
|
1125
|
-
website:
|
|
1126
|
-
timezone:
|
|
1127
|
-
customFields:
|
|
1128
|
-
|
|
1129
|
-
id:
|
|
1130
|
-
value:
|
|
1376
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1377
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1378
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1379
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1380
|
+
email: import_zod5.z.string().optional().describe("Contact's email address."),
|
|
1381
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number."),
|
|
1382
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to assign to the contact."),
|
|
1383
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1384
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1385
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1386
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1387
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1388
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1389
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1390
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1391
|
+
customFields: import_zod5.z.array(
|
|
1392
|
+
import_zod5.z.object({
|
|
1393
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1394
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1131
1395
|
})
|
|
1132
1396
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1133
1397
|
},
|
|
@@ -1148,25 +1412,25 @@ function registerContactTools(server2, client) {
|
|
|
1148
1412
|
"update_contact",
|
|
1149
1413
|
"Update an existing contact's fields. Only provided fields will be changed; omitted fields remain unchanged.",
|
|
1150
1414
|
{
|
|
1151
|
-
contactId:
|
|
1152
|
-
firstName:
|
|
1153
|
-
lastName:
|
|
1154
|
-
name:
|
|
1155
|
-
email:
|
|
1156
|
-
phone:
|
|
1157
|
-
tags:
|
|
1158
|
-
source:
|
|
1159
|
-
companyName:
|
|
1160
|
-
address1:
|
|
1161
|
-
city:
|
|
1162
|
-
state:
|
|
1163
|
-
postalCode:
|
|
1164
|
-
website:
|
|
1165
|
-
timezone:
|
|
1166
|
-
customFields:
|
|
1167
|
-
|
|
1168
|
-
id:
|
|
1169
|
-
value:
|
|
1415
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to update."),
|
|
1416
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1417
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1418
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1419
|
+
email: import_zod5.z.string().optional().describe("Contact's email address."),
|
|
1420
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number."),
|
|
1421
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to set on the contact (replaces existing tags)."),
|
|
1422
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1423
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1424
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1425
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1426
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1427
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1428
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1429
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1430
|
+
customFields: import_zod5.z.array(
|
|
1431
|
+
import_zod5.z.object({
|
|
1432
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1433
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1170
1434
|
})
|
|
1171
1435
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1172
1436
|
},
|
|
@@ -1185,8 +1449,8 @@ function registerContactTools(server2, client) {
|
|
|
1185
1449
|
"delete_contact",
|
|
1186
1450
|
"Permanently delete a contact. IRREVERSIBLE.",
|
|
1187
1451
|
{
|
|
1188
|
-
contactId:
|
|
1189
|
-
confirm:
|
|
1452
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to delete."),
|
|
1453
|
+
confirm: import_zod5.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1190
1454
|
},
|
|
1191
1455
|
async ({ contactId }) => {
|
|
1192
1456
|
return client.delete(`/contacts/${contactId}`);
|
|
@@ -1197,25 +1461,25 @@ function registerContactTools(server2, client) {
|
|
|
1197
1461
|
"upsert_contact",
|
|
1198
1462
|
"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
1463
|
{
|
|
1200
|
-
locationId:
|
|
1201
|
-
firstName:
|
|
1202
|
-
lastName:
|
|
1203
|
-
name:
|
|
1204
|
-
email:
|
|
1205
|
-
phone:
|
|
1206
|
-
tags:
|
|
1207
|
-
source:
|
|
1208
|
-
companyName:
|
|
1209
|
-
address1:
|
|
1210
|
-
city:
|
|
1211
|
-
state:
|
|
1212
|
-
postalCode:
|
|
1213
|
-
website:
|
|
1214
|
-
timezone:
|
|
1215
|
-
customFields:
|
|
1216
|
-
|
|
1217
|
-
id:
|
|
1218
|
-
value:
|
|
1464
|
+
locationId: import_zod5.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
1465
|
+
firstName: import_zod5.z.string().optional().describe("Contact's first name."),
|
|
1466
|
+
lastName: import_zod5.z.string().optional().describe("Contact's last name."),
|
|
1467
|
+
name: import_zod5.z.string().optional().describe("Contact's full name."),
|
|
1468
|
+
email: import_zod5.z.string().optional().describe("Contact's email address (used for matching)."),
|
|
1469
|
+
phone: import_zod5.z.string().optional().describe("Contact's phone number (used for matching)."),
|
|
1470
|
+
tags: import_zod5.z.array(import_zod5.z.string()).optional().describe("Array of tags to assign to the contact."),
|
|
1471
|
+
source: import_zod5.z.string().optional().describe("Lead source for the contact."),
|
|
1472
|
+
companyName: import_zod5.z.string().optional().describe("Contact's company name."),
|
|
1473
|
+
address1: import_zod5.z.string().optional().describe("Street address."),
|
|
1474
|
+
city: import_zod5.z.string().optional().describe("City."),
|
|
1475
|
+
state: import_zod5.z.string().optional().describe("State or province."),
|
|
1476
|
+
postalCode: import_zod5.z.string().optional().describe("Postal / ZIP code."),
|
|
1477
|
+
website: import_zod5.z.string().optional().describe("Contact's website URL."),
|
|
1478
|
+
timezone: import_zod5.z.string().optional().describe("Contact's timezone (e.g. 'America/New_York')."),
|
|
1479
|
+
customFields: import_zod5.z.array(
|
|
1480
|
+
import_zod5.z.object({
|
|
1481
|
+
id: import_zod5.z.string().describe("Custom field ID."),
|
|
1482
|
+
value: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number(), import_zod5.z.boolean()]).describe("Custom field value.")
|
|
1219
1483
|
})
|
|
1220
1484
|
).optional().describe("Array of custom field objects with id and value.")
|
|
1221
1485
|
},
|
|
@@ -1236,8 +1500,8 @@ function registerContactTools(server2, client) {
|
|
|
1236
1500
|
"add_contact_tags",
|
|
1237
1501
|
"Add one or more tags to an existing contact. Does not remove existing tags.",
|
|
1238
1502
|
{
|
|
1239
|
-
contactId:
|
|
1240
|
-
tags:
|
|
1503
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add tags to."),
|
|
1504
|
+
tags: import_zod5.z.array(import_zod5.z.string()).describe("Array of tag names to add to the contact.")
|
|
1241
1505
|
},
|
|
1242
1506
|
async ({ contactId, tags }) => {
|
|
1243
1507
|
return client.post(`/contacts/${contactId}/tags`, {
|
|
@@ -1250,8 +1514,8 @@ function registerContactTools(server2, client) {
|
|
|
1250
1514
|
"remove_contact_tags",
|
|
1251
1515
|
"Remove one or more tags from an existing contact.",
|
|
1252
1516
|
{
|
|
1253
|
-
contactId:
|
|
1254
|
-
tags:
|
|
1517
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to remove tags from."),
|
|
1518
|
+
tags: import_zod5.z.array(import_zod5.z.string()).describe("Array of tag names to remove from the contact.")
|
|
1255
1519
|
},
|
|
1256
1520
|
async ({ contactId, tags }) => {
|
|
1257
1521
|
return client.delete(`/contacts/${contactId}/tags`, {
|
|
@@ -1264,7 +1528,7 @@ function registerContactTools(server2, client) {
|
|
|
1264
1528
|
"get_contact_tasks",
|
|
1265
1529
|
"Retrieve all tasks associated with a specific contact.",
|
|
1266
1530
|
{
|
|
1267
|
-
contactId:
|
|
1531
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose tasks to retrieve.")
|
|
1268
1532
|
},
|
|
1269
1533
|
async ({ contactId }) => {
|
|
1270
1534
|
return client.get(`/contacts/${contactId}/tasks`);
|
|
@@ -1275,12 +1539,12 @@ function registerContactTools(server2, client) {
|
|
|
1275
1539
|
"create_contact_task",
|
|
1276
1540
|
"Create a new task associated with a contact (e.g. follow-up call, send proposal).",
|
|
1277
1541
|
{
|
|
1278
|
-
contactId:
|
|
1279
|
-
title:
|
|
1280
|
-
body:
|
|
1281
|
-
dueDate:
|
|
1282
|
-
completed:
|
|
1283
|
-
assignedTo:
|
|
1542
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to create the task for."),
|
|
1543
|
+
title: import_zod5.z.string().describe("Title / summary of the task."),
|
|
1544
|
+
body: import_zod5.z.string().optional().describe("Detailed description of the task."),
|
|
1545
|
+
dueDate: import_zod5.z.string().optional().describe("Due date for the task in ISO 8601 format."),
|
|
1546
|
+
completed: import_zod5.z.boolean().optional().describe("Whether the task is already completed."),
|
|
1547
|
+
assignedTo: import_zod5.z.string().optional().describe("User ID to assign the task to.")
|
|
1284
1548
|
},
|
|
1285
1549
|
async ({ contactId, title, body: taskBody, dueDate, completed, assignedTo }) => {
|
|
1286
1550
|
const reqBody = { title };
|
|
@@ -1298,7 +1562,7 @@ function registerContactTools(server2, client) {
|
|
|
1298
1562
|
"get_contact_notes",
|
|
1299
1563
|
"Retrieve all notes associated with a specific contact.",
|
|
1300
1564
|
{
|
|
1301
|
-
contactId:
|
|
1565
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose notes to retrieve.")
|
|
1302
1566
|
},
|
|
1303
1567
|
async ({ contactId }) => {
|
|
1304
1568
|
return client.get(`/contacts/${contactId}/notes`);
|
|
@@ -1309,9 +1573,9 @@ function registerContactTools(server2, client) {
|
|
|
1309
1573
|
"create_contact_note",
|
|
1310
1574
|
"Add a note to a contact's record. Useful for logging interactions, observations, or internal memos.",
|
|
1311
1575
|
{
|
|
1312
|
-
contactId:
|
|
1313
|
-
body:
|
|
1314
|
-
userId:
|
|
1576
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add the note to."),
|
|
1577
|
+
body: import_zod5.z.string().describe("The text content of the note."),
|
|
1578
|
+
userId: import_zod5.z.string().optional().describe("ID of the user creating the note.")
|
|
1315
1579
|
},
|
|
1316
1580
|
async ({ contactId, body: noteBody, userId }) => {
|
|
1317
1581
|
const reqBody = { body: noteBody };
|
|
@@ -1326,7 +1590,7 @@ function registerContactTools(server2, client) {
|
|
|
1326
1590
|
"get_contact_appointments",
|
|
1327
1591
|
"Retrieve all appointments / calendar events associated with a specific contact.",
|
|
1328
1592
|
{
|
|
1329
|
-
contactId:
|
|
1593
|
+
contactId: import_zod5.z.string().describe("The ID of the contact whose appointments to retrieve.")
|
|
1330
1594
|
},
|
|
1331
1595
|
async ({ contactId }) => {
|
|
1332
1596
|
return client.get(`/contacts/${contactId}/appointments`);
|
|
@@ -1337,8 +1601,8 @@ function registerContactTools(server2, client) {
|
|
|
1337
1601
|
"add_contact_to_workflow",
|
|
1338
1602
|
"Enroll a contact into an automation workflow. The contact will begin receiving the workflow's actions.",
|
|
1339
1603
|
{
|
|
1340
|
-
contactId:
|
|
1341
|
-
workflowId:
|
|
1604
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to add to the workflow."),
|
|
1605
|
+
workflowId: import_zod5.z.string().describe("The ID of the workflow to enroll the contact in.")
|
|
1342
1606
|
},
|
|
1343
1607
|
async ({ contactId, workflowId }) => {
|
|
1344
1608
|
return client.post(
|
|
@@ -1351,8 +1615,8 @@ function registerContactTools(server2, client) {
|
|
|
1351
1615
|
"remove_contact_from_workflow",
|
|
1352
1616
|
"Remove a contact from an automation workflow, stopping any pending workflow actions.",
|
|
1353
1617
|
{
|
|
1354
|
-
contactId:
|
|
1355
|
-
workflowId:
|
|
1618
|
+
contactId: import_zod5.z.string().describe("The ID of the contact to remove from the workflow."),
|
|
1619
|
+
workflowId: import_zod5.z.string().describe("The ID of the workflow to remove the contact from.")
|
|
1356
1620
|
},
|
|
1357
1621
|
async ({ contactId, workflowId }) => {
|
|
1358
1622
|
return client.delete(
|
|
@@ -1363,20 +1627,20 @@ function registerContactTools(server2, client) {
|
|
|
1363
1627
|
}
|
|
1364
1628
|
|
|
1365
1629
|
// src/tools/conversations.ts
|
|
1366
|
-
var
|
|
1630
|
+
var import_zod6 = require("zod");
|
|
1367
1631
|
function registerConversationTools(server2, client) {
|
|
1368
1632
|
safeTool(
|
|
1369
1633
|
server2,
|
|
1370
1634
|
"search_conversations",
|
|
1371
1635
|
"Search conversations in GoHighLevel by various filters such as contact, assignee, status, or query string.",
|
|
1372
1636
|
{
|
|
1373
|
-
locationId:
|
|
1374
|
-
contactId:
|
|
1375
|
-
assignedTo:
|
|
1376
|
-
query:
|
|
1377
|
-
status:
|
|
1378
|
-
limit:
|
|
1379
|
-
startAfterDate:
|
|
1637
|
+
locationId: import_zod6.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
1638
|
+
contactId: import_zod6.z.string().optional().describe("Filter conversations by contact ID."),
|
|
1639
|
+
assignedTo: import_zod6.z.string().optional().describe("Filter conversations by the assigned user ID."),
|
|
1640
|
+
query: import_zod6.z.string().optional().describe("Free-text search query to filter conversations."),
|
|
1641
|
+
status: import_zod6.z.enum(["all", "read", "unread", "starred", "recents"]).optional().describe("Filter by conversation status."),
|
|
1642
|
+
limit: import_zod6.z.number().optional().describe("Maximum number of conversations to return."),
|
|
1643
|
+
startAfterDate: import_zod6.z.string().optional().describe("Return conversations that started after this date (ISO 8601 / epoch ms).")
|
|
1380
1644
|
},
|
|
1381
1645
|
async ({ locationId: locationId2, contactId, assignedTo, query, status, limit, startAfterDate }) => {
|
|
1382
1646
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1398,7 +1662,7 @@ function registerConversationTools(server2, client) {
|
|
|
1398
1662
|
"get_conversation",
|
|
1399
1663
|
"Retrieve a single conversation by its ID from GoHighLevel.",
|
|
1400
1664
|
{
|
|
1401
|
-
conversationId:
|
|
1665
|
+
conversationId: import_zod6.z.string().describe("The ID of the conversation to retrieve.")
|
|
1402
1666
|
},
|
|
1403
1667
|
async ({ conversationId }) => {
|
|
1404
1668
|
return await client.get(`/conversations/${conversationId}`);
|
|
@@ -1409,8 +1673,8 @@ function registerConversationTools(server2, client) {
|
|
|
1409
1673
|
"create_conversation",
|
|
1410
1674
|
"Create a new conversation in GoHighLevel for a given contact.",
|
|
1411
1675
|
{
|
|
1412
|
-
locationId:
|
|
1413
|
-
contactId:
|
|
1676
|
+
locationId: import_zod6.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
1677
|
+
contactId: import_zod6.z.string().describe("The contact ID to create the conversation for.")
|
|
1414
1678
|
},
|
|
1415
1679
|
async ({ locationId: locationId2, contactId }) => {
|
|
1416
1680
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1424,9 +1688,9 @@ function registerConversationTools(server2, client) {
|
|
|
1424
1688
|
"get_messages",
|
|
1425
1689
|
"Retrieve messages for a specific conversation from GoHighLevel.",
|
|
1426
1690
|
{
|
|
1427
|
-
conversationId:
|
|
1428
|
-
limit:
|
|
1429
|
-
type:
|
|
1691
|
+
conversationId: import_zod6.z.string().describe("The ID of the conversation to retrieve messages for."),
|
|
1692
|
+
limit: import_zod6.z.number().optional().describe("Maximum number of messages to return."),
|
|
1693
|
+
type: import_zod6.z.string().optional().describe("Filter messages by type.")
|
|
1430
1694
|
},
|
|
1431
1695
|
async ({ conversationId, limit, type }) => {
|
|
1432
1696
|
return await client.get(`/conversations/${conversationId}/messages`, {
|
|
@@ -1439,16 +1703,16 @@ function registerConversationTools(server2, client) {
|
|
|
1439
1703
|
"send_message",
|
|
1440
1704
|
"Send an outbound message (SMS, Email, WhatsApp, etc.) to a contact via GoHighLevel.",
|
|
1441
1705
|
{
|
|
1442
|
-
type:
|
|
1443
|
-
contactId:
|
|
1444
|
-
message:
|
|
1445
|
-
subject:
|
|
1446
|
-
html:
|
|
1447
|
-
emailFrom:
|
|
1448
|
-
emailTo:
|
|
1449
|
-
emailCc:
|
|
1450
|
-
emailBcc:
|
|
1451
|
-
attachments:
|
|
1706
|
+
type: import_zod6.z.enum(["SMS", "Email", "WhatsApp", "GMB", "IG", "FB", "Custom", "Live_Chat"]).describe("The channel type for the outbound message."),
|
|
1707
|
+
contactId: import_zod6.z.string().describe("The contact ID to send the message to."),
|
|
1708
|
+
message: import_zod6.z.string().optional().describe("The message body text. Used for SMS, WhatsApp, and other chat-based channels."),
|
|
1709
|
+
subject: import_zod6.z.string().optional().describe("Email subject line. Used when type is Email."),
|
|
1710
|
+
html: import_zod6.z.string().optional().describe("HTML body for the email. Used when type is Email."),
|
|
1711
|
+
emailFrom: import_zod6.z.string().optional().describe("Sender email address (for Email type)."),
|
|
1712
|
+
emailTo: import_zod6.z.string().optional().describe("Recipient email address (for Email type)."),
|
|
1713
|
+
emailCc: import_zod6.z.array(import_zod6.z.string()).optional().describe("CC email addresses (for Email type)."),
|
|
1714
|
+
emailBcc: import_zod6.z.array(import_zod6.z.string()).optional().describe("BCC email addresses (for Email type)."),
|
|
1715
|
+
attachments: import_zod6.z.array(import_zod6.z.string()).optional().describe("Array of attachment URLs to include with the message.")
|
|
1452
1716
|
},
|
|
1453
1717
|
async ({ type, contactId, message, subject, html, emailFrom, emailTo, emailCc, emailBcc, attachments }) => {
|
|
1454
1718
|
const body = { type, contactId };
|
|
@@ -1468,10 +1732,10 @@ function registerConversationTools(server2, client) {
|
|
|
1468
1732
|
"add_inbound_message",
|
|
1469
1733
|
"Record an inbound message in a GoHighLevel conversation (e.g., from an external channel).",
|
|
1470
1734
|
{
|
|
1471
|
-
type:
|
|
1472
|
-
conversationId:
|
|
1473
|
-
conversationProviderId:
|
|
1474
|
-
message:
|
|
1735
|
+
type: import_zod6.z.string().describe("The channel type of the inbound message (e.g., SMS, Email, WhatsApp)."),
|
|
1736
|
+
conversationId: import_zod6.z.string().describe("The conversation ID to add the message to."),
|
|
1737
|
+
conversationProviderId: import_zod6.z.string().describe("The provider ID for the conversation channel."),
|
|
1738
|
+
message: import_zod6.z.string().describe("The inbound message body text.")
|
|
1475
1739
|
},
|
|
1476
1740
|
async ({ type, conversationId, conversationProviderId, message }) => {
|
|
1477
1741
|
return await client.post("/conversations/messages/inbound", {
|
|
@@ -1484,9 +1748,9 @@ function registerConversationTools(server2, client) {
|
|
|
1484
1748
|
"update_message_status",
|
|
1485
1749
|
"Update the delivery/read status of a specific message in GoHighLevel.",
|
|
1486
1750
|
{
|
|
1487
|
-
messageId:
|
|
1488
|
-
status:
|
|
1489
|
-
error:
|
|
1751
|
+
messageId: import_zod6.z.string().describe("The ID of the message to update."),
|
|
1752
|
+
status: import_zod6.z.enum(["read", "pending", "delivered", "failed"]).describe("The new status to set for the message."),
|
|
1753
|
+
error: import_zod6.z.string().optional().describe("Error details if the status is 'failed'.")
|
|
1490
1754
|
},
|
|
1491
1755
|
async ({ messageId, status, error }) => {
|
|
1492
1756
|
const body = { status };
|
|
@@ -1499,7 +1763,7 @@ function registerConversationTools(server2, client) {
|
|
|
1499
1763
|
"get_message",
|
|
1500
1764
|
"Retrieve a single message by its ID from GoHighLevel.",
|
|
1501
1765
|
{
|
|
1502
|
-
messageId:
|
|
1766
|
+
messageId: import_zod6.z.string().describe("The ID of the message to retrieve.")
|
|
1503
1767
|
},
|
|
1504
1768
|
async ({ messageId }) => {
|
|
1505
1769
|
return await client.get(`/conversations/messages/${messageId}`);
|
|
@@ -1508,30 +1772,30 @@ function registerConversationTools(server2, client) {
|
|
|
1508
1772
|
}
|
|
1509
1773
|
|
|
1510
1774
|
// src/tools/opportunities.ts
|
|
1511
|
-
var
|
|
1512
|
-
var statusEnum =
|
|
1513
|
-
var statusEnumWithAll =
|
|
1775
|
+
var import_zod7 = require("zod");
|
|
1776
|
+
var statusEnum = import_zod7.z.enum(["open", "won", "lost", "abandoned"]).describe("Opportunity status");
|
|
1777
|
+
var statusEnumWithAll = import_zod7.z.enum(["open", "won", "lost", "abandoned", "all"]).describe("Opportunity status filter (use 'all' to include every status)");
|
|
1514
1778
|
function registerOpportunityTools(server2, client) {
|
|
1515
1779
|
safeTool(
|
|
1516
1780
|
server2,
|
|
1517
1781
|
"search_opportunities",
|
|
1518
1782
|
"Search opportunities in GoHighLevel with optional filters",
|
|
1519
1783
|
{
|
|
1520
|
-
locationId:
|
|
1784
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1521
1785
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1522
1786
|
),
|
|
1523
|
-
pipelineId:
|
|
1524
|
-
pipelineStageId:
|
|
1525
|
-
contactId:
|
|
1787
|
+
pipelineId: import_zod7.z.string().optional().describe("Filter by pipeline ID"),
|
|
1788
|
+
pipelineStageId: import_zod7.z.string().optional().describe("Filter by pipeline stage ID"),
|
|
1789
|
+
contactId: import_zod7.z.string().optional().describe("Filter by contact ID"),
|
|
1526
1790
|
status: statusEnumWithAll.optional().describe("Filter by status"),
|
|
1527
|
-
assignedTo:
|
|
1528
|
-
query:
|
|
1529
|
-
limit:
|
|
1530
|
-
startAfter:
|
|
1531
|
-
startAfterId:
|
|
1532
|
-
order:
|
|
1533
|
-
endDate:
|
|
1534
|
-
startDate:
|
|
1791
|
+
assignedTo: import_zod7.z.string().optional().describe("Filter by assigned user ID"),
|
|
1792
|
+
query: import_zod7.z.string().optional().describe("Search query string"),
|
|
1793
|
+
limit: import_zod7.z.number().optional().describe("Maximum number of results to return"),
|
|
1794
|
+
startAfter: import_zod7.z.string().optional().describe("Cursor timestamp for pagination"),
|
|
1795
|
+
startAfterId: import_zod7.z.string().optional().describe("Cursor ID for pagination"),
|
|
1796
|
+
order: import_zod7.z.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
1797
|
+
endDate: import_zod7.z.string().optional().describe("End date filter (ISO string)"),
|
|
1798
|
+
startDate: import_zod7.z.string().optional().describe("Start date filter (ISO string)")
|
|
1535
1799
|
},
|
|
1536
1800
|
async (args) => {
|
|
1537
1801
|
const locationId2 = client.resolveLocationId(args.locationId);
|
|
@@ -1559,7 +1823,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1559
1823
|
"get_opportunity",
|
|
1560
1824
|
"Get a single opportunity by ID from GoHighLevel",
|
|
1561
1825
|
{
|
|
1562
|
-
opportunityId:
|
|
1826
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to retrieve")
|
|
1563
1827
|
},
|
|
1564
1828
|
async (args) => {
|
|
1565
1829
|
return await client.get(`/opportunities/${args.opportunityId}`);
|
|
@@ -1570,17 +1834,17 @@ function registerOpportunityTools(server2, client) {
|
|
|
1570
1834
|
"create_opportunity",
|
|
1571
1835
|
"Create a new opportunity in GoHighLevel",
|
|
1572
1836
|
{
|
|
1573
|
-
locationId:
|
|
1837
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1574
1838
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1575
1839
|
),
|
|
1576
|
-
pipelineId:
|
|
1577
|
-
pipelineStageId:
|
|
1578
|
-
contactId:
|
|
1579
|
-
name:
|
|
1840
|
+
pipelineId: import_zod7.z.string().describe("Pipeline ID (required)"),
|
|
1841
|
+
pipelineStageId: import_zod7.z.string().describe("Pipeline stage ID (required)"),
|
|
1842
|
+
contactId: import_zod7.z.string().describe("Contact ID (required)"),
|
|
1843
|
+
name: import_zod7.z.string().describe("Opportunity name (required)"),
|
|
1580
1844
|
status: statusEnum.optional().describe("Opportunity status"),
|
|
1581
|
-
monetaryValue:
|
|
1582
|
-
assignedTo:
|
|
1583
|
-
source:
|
|
1845
|
+
monetaryValue: import_zod7.z.number().optional().describe("Monetary value of the opportunity"),
|
|
1846
|
+
assignedTo: import_zod7.z.string().optional().describe("User ID to assign the opportunity to"),
|
|
1847
|
+
source: import_zod7.z.string().optional().describe("Lead source")
|
|
1584
1848
|
},
|
|
1585
1849
|
async (args) => {
|
|
1586
1850
|
const locationId2 = client.resolveLocationId(args.locationId);
|
|
@@ -1604,14 +1868,14 @@ function registerOpportunityTools(server2, client) {
|
|
|
1604
1868
|
"update_opportunity",
|
|
1605
1869
|
"Update an existing opportunity in GoHighLevel",
|
|
1606
1870
|
{
|
|
1607
|
-
opportunityId:
|
|
1608
|
-
pipelineId:
|
|
1609
|
-
pipelineStageId:
|
|
1610
|
-
name:
|
|
1871
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to update"),
|
|
1872
|
+
pipelineId: import_zod7.z.string().optional().describe("Pipeline ID"),
|
|
1873
|
+
pipelineStageId: import_zod7.z.string().optional().describe("Pipeline stage ID"),
|
|
1874
|
+
name: import_zod7.z.string().optional().describe("Opportunity name"),
|
|
1611
1875
|
status: statusEnum.optional().describe("Opportunity status"),
|
|
1612
|
-
monetaryValue:
|
|
1613
|
-
assignedTo:
|
|
1614
|
-
source:
|
|
1876
|
+
monetaryValue: import_zod7.z.number().optional().describe("Monetary value of the opportunity"),
|
|
1877
|
+
assignedTo: import_zod7.z.string().optional().describe("User ID to assign the opportunity to"),
|
|
1878
|
+
source: import_zod7.z.string().optional().describe("Lead source")
|
|
1615
1879
|
},
|
|
1616
1880
|
async (args) => {
|
|
1617
1881
|
const body = {};
|
|
@@ -1634,8 +1898,8 @@ function registerOpportunityTools(server2, client) {
|
|
|
1634
1898
|
"delete_opportunity",
|
|
1635
1899
|
"Permanently delete an opportunity. IRREVERSIBLE.",
|
|
1636
1900
|
{
|
|
1637
|
-
opportunityId:
|
|
1638
|
-
confirm:
|
|
1901
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to delete"),
|
|
1902
|
+
confirm: import_zod7.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1639
1903
|
},
|
|
1640
1904
|
async (args) => {
|
|
1641
1905
|
return await client.delete(`/opportunities/${args.opportunityId}`);
|
|
@@ -1646,7 +1910,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1646
1910
|
"update_opportunity_status",
|
|
1647
1911
|
"Update only the status of an opportunity in GoHighLevel",
|
|
1648
1912
|
{
|
|
1649
|
-
opportunityId:
|
|
1913
|
+
opportunityId: import_zod7.z.string().describe("The ID of the opportunity to update"),
|
|
1650
1914
|
status: statusEnum.describe("New status for the opportunity")
|
|
1651
1915
|
},
|
|
1652
1916
|
async (args) => {
|
|
@@ -1661,7 +1925,7 @@ function registerOpportunityTools(server2, client) {
|
|
|
1661
1925
|
"get_pipelines",
|
|
1662
1926
|
"List all pipelines for a location in GoHighLevel",
|
|
1663
1927
|
{
|
|
1664
|
-
locationId:
|
|
1928
|
+
locationId: import_zod7.z.string().optional().describe(
|
|
1665
1929
|
"Location ID. Falls back to GHL_LOCATION_ID env var if omitted."
|
|
1666
1930
|
)
|
|
1667
1931
|
},
|
|
@@ -1676,14 +1940,14 @@ function registerOpportunityTools(server2, client) {
|
|
|
1676
1940
|
}
|
|
1677
1941
|
|
|
1678
1942
|
// src/tools/calendars.ts
|
|
1679
|
-
var
|
|
1943
|
+
var import_zod8 = require("zod");
|
|
1680
1944
|
function registerCalendarTools(server2, client) {
|
|
1681
1945
|
safeTool(
|
|
1682
1946
|
server2,
|
|
1683
1947
|
"get_calendars",
|
|
1684
1948
|
"List all calendars for a location",
|
|
1685
1949
|
{
|
|
1686
|
-
locationId:
|
|
1950
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)")
|
|
1687
1951
|
},
|
|
1688
1952
|
async ({ locationId: locationId2 }) => {
|
|
1689
1953
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1698,7 +1962,7 @@ function registerCalendarTools(server2, client) {
|
|
|
1698
1962
|
"get_calendar",
|
|
1699
1963
|
"Get a single calendar by ID",
|
|
1700
1964
|
{
|
|
1701
|
-
calendarId:
|
|
1965
|
+
calendarId: import_zod8.z.string().describe("The calendar ID")
|
|
1702
1966
|
},
|
|
1703
1967
|
async ({ calendarId }) => {
|
|
1704
1968
|
return await client.get(`/calendars/${calendarId}`);
|
|
@@ -1709,19 +1973,19 @@ function registerCalendarTools(server2, client) {
|
|
|
1709
1973
|
"create_calendar",
|
|
1710
1974
|
"Create a new calendar",
|
|
1711
1975
|
{
|
|
1712
|
-
locationId:
|
|
1713
|
-
name:
|
|
1714
|
-
description:
|
|
1715
|
-
slug:
|
|
1716
|
-
widgetSlug:
|
|
1717
|
-
calendarType:
|
|
1718
|
-
teamMembers:
|
|
1719
|
-
eventTitle:
|
|
1720
|
-
eventColor:
|
|
1721
|
-
slotDuration:
|
|
1722
|
-
slotBuffer:
|
|
1723
|
-
slotInterval:
|
|
1724
|
-
appointmentPerSlot:
|
|
1976
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
1977
|
+
name: import_zod8.z.string().describe("Calendar name"),
|
|
1978
|
+
description: import_zod8.z.string().optional().describe("Calendar description"),
|
|
1979
|
+
slug: import_zod8.z.string().optional().describe("Calendar slug"),
|
|
1980
|
+
widgetSlug: import_zod8.z.string().optional().describe("Widget slug for embedding"),
|
|
1981
|
+
calendarType: import_zod8.z.string().optional().describe("Calendar type"),
|
|
1982
|
+
teamMembers: import_zod8.z.array(import_zod8.z.record(import_zod8.z.unknown())).optional().describe("Array of team member objects"),
|
|
1983
|
+
eventTitle: import_zod8.z.string().optional().describe("Default event title"),
|
|
1984
|
+
eventColor: import_zod8.z.string().optional().describe("Event color hex code"),
|
|
1985
|
+
slotDuration: import_zod8.z.number().optional().describe("Slot duration in minutes"),
|
|
1986
|
+
slotBuffer: import_zod8.z.number().optional().describe("Buffer time between slots in minutes"),
|
|
1987
|
+
slotInterval: import_zod8.z.number().optional().describe("Slot interval in minutes"),
|
|
1988
|
+
appointmentPerSlot: import_zod8.z.number().optional().describe("Max appointments per slot")
|
|
1725
1989
|
},
|
|
1726
1990
|
async ({ locationId: locationId2, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
|
|
1727
1991
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1748,19 +2012,19 @@ function registerCalendarTools(server2, client) {
|
|
|
1748
2012
|
"update_calendar",
|
|
1749
2013
|
"Update an existing calendar",
|
|
1750
2014
|
{
|
|
1751
|
-
calendarId:
|
|
1752
|
-
name:
|
|
1753
|
-
description:
|
|
1754
|
-
slug:
|
|
1755
|
-
widgetSlug:
|
|
1756
|
-
calendarType:
|
|
1757
|
-
teamMembers:
|
|
1758
|
-
eventTitle:
|
|
1759
|
-
eventColor:
|
|
1760
|
-
slotDuration:
|
|
1761
|
-
slotBuffer:
|
|
1762
|
-
slotInterval:
|
|
1763
|
-
appointmentPerSlot:
|
|
2015
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to update"),
|
|
2016
|
+
name: import_zod8.z.string().optional().describe("Calendar name"),
|
|
2017
|
+
description: import_zod8.z.string().optional().describe("Calendar description"),
|
|
2018
|
+
slug: import_zod8.z.string().optional().describe("Calendar slug"),
|
|
2019
|
+
widgetSlug: import_zod8.z.string().optional().describe("Widget slug for embedding"),
|
|
2020
|
+
calendarType: import_zod8.z.string().optional().describe("Calendar type"),
|
|
2021
|
+
teamMembers: import_zod8.z.array(import_zod8.z.record(import_zod8.z.unknown())).optional().describe("Array of team member objects"),
|
|
2022
|
+
eventTitle: import_zod8.z.string().optional().describe("Default event title"),
|
|
2023
|
+
eventColor: import_zod8.z.string().optional().describe("Event color hex code"),
|
|
2024
|
+
slotDuration: import_zod8.z.number().optional().describe("Slot duration in minutes"),
|
|
2025
|
+
slotBuffer: import_zod8.z.number().optional().describe("Buffer time between slots in minutes"),
|
|
2026
|
+
slotInterval: import_zod8.z.number().optional().describe("Slot interval in minutes"),
|
|
2027
|
+
appointmentPerSlot: import_zod8.z.number().optional().describe("Max appointments per slot")
|
|
1764
2028
|
},
|
|
1765
2029
|
async ({ calendarId, name, description, slug, widgetSlug, calendarType, teamMembers, eventTitle, eventColor, slotDuration, slotBuffer, slotInterval, appointmentPerSlot }) => {
|
|
1766
2030
|
const body = {};
|
|
@@ -1784,8 +2048,8 @@ function registerCalendarTools(server2, client) {
|
|
|
1784
2048
|
"delete_calendar",
|
|
1785
2049
|
"Permanently delete a calendar. IRREVERSIBLE.",
|
|
1786
2050
|
{
|
|
1787
|
-
calendarId:
|
|
1788
|
-
confirm:
|
|
2051
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to delete"),
|
|
2052
|
+
confirm: import_zod8.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1789
2053
|
},
|
|
1790
2054
|
async ({ calendarId }) => {
|
|
1791
2055
|
return await client.delete(`/calendars/${calendarId}`);
|
|
@@ -1796,11 +2060,11 @@ function registerCalendarTools(server2, client) {
|
|
|
1796
2060
|
"get_free_slots",
|
|
1797
2061
|
"Get available free slots for a calendar",
|
|
1798
2062
|
{
|
|
1799
|
-
calendarId:
|
|
1800
|
-
startDate:
|
|
1801
|
-
endDate:
|
|
1802
|
-
timezone:
|
|
1803
|
-
userId:
|
|
2063
|
+
calendarId: import_zod8.z.string().describe("The calendar ID"),
|
|
2064
|
+
startDate: import_zod8.z.string().describe("Start date in ISO format (YYYY-MM-DD)"),
|
|
2065
|
+
endDate: import_zod8.z.string().describe("End date in ISO format (YYYY-MM-DD)"),
|
|
2066
|
+
timezone: import_zod8.z.string().optional().describe("Timezone (e.g. America/New_York)"),
|
|
2067
|
+
userId: import_zod8.z.string().optional().describe("Filter by user ID")
|
|
1804
2068
|
},
|
|
1805
2069
|
async ({ calendarId, startDate, endDate, timezone, userId }) => {
|
|
1806
2070
|
const params = { startDate, endDate };
|
|
@@ -1816,11 +2080,11 @@ function registerCalendarTools(server2, client) {
|
|
|
1816
2080
|
"get_calendar_events",
|
|
1817
2081
|
"List calendar events for a location within a time range",
|
|
1818
2082
|
{
|
|
1819
|
-
locationId:
|
|
1820
|
-
startTime:
|
|
1821
|
-
endTime:
|
|
1822
|
-
calendarId:
|
|
1823
|
-
userId:
|
|
2083
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
2084
|
+
startTime: import_zod8.z.string().describe("Start time in ISO format"),
|
|
2085
|
+
endTime: import_zod8.z.string().describe("End time in ISO format"),
|
|
2086
|
+
calendarId: import_zod8.z.string().optional().describe("Filter by calendar ID"),
|
|
2087
|
+
userId: import_zod8.z.string().optional().describe("Filter by user ID")
|
|
1824
2088
|
},
|
|
1825
2089
|
async ({ locationId: locationId2, startTime, endTime, calendarId, userId }) => {
|
|
1826
2090
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1839,7 +2103,7 @@ function registerCalendarTools(server2, client) {
|
|
|
1839
2103
|
"get_appointment",
|
|
1840
2104
|
"Get a single appointment by event ID",
|
|
1841
2105
|
{
|
|
1842
|
-
eventId:
|
|
2106
|
+
eventId: import_zod8.z.string().describe("The appointment event ID")
|
|
1843
2107
|
},
|
|
1844
2108
|
async ({ eventId }) => {
|
|
1845
2109
|
return await client.get(
|
|
@@ -1852,17 +2116,17 @@ function registerCalendarTools(server2, client) {
|
|
|
1852
2116
|
"create_appointment",
|
|
1853
2117
|
"Create a new appointment",
|
|
1854
2118
|
{
|
|
1855
|
-
calendarId:
|
|
1856
|
-
locationId:
|
|
1857
|
-
contactId:
|
|
1858
|
-
startTime:
|
|
1859
|
-
endTime:
|
|
1860
|
-
title:
|
|
1861
|
-
appointmentStatus:
|
|
1862
|
-
assignedUserId:
|
|
1863
|
-
address:
|
|
1864
|
-
notes:
|
|
1865
|
-
toNotify:
|
|
2119
|
+
calendarId: import_zod8.z.string().describe("The calendar ID to book into"),
|
|
2120
|
+
locationId: import_zod8.z.string().optional().describe("Location ID (falls back to GHL_LOCATION_ID env var)"),
|
|
2121
|
+
contactId: import_zod8.z.string().describe("The contact ID for the appointment"),
|
|
2122
|
+
startTime: import_zod8.z.string().describe("Start time in ISO format"),
|
|
2123
|
+
endTime: import_zod8.z.string().describe("End time in ISO format"),
|
|
2124
|
+
title: import_zod8.z.string().optional().describe("Appointment title"),
|
|
2125
|
+
appointmentStatus: import_zod8.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
|
|
2126
|
+
assignedUserId: import_zod8.z.string().optional().describe("Assigned user ID"),
|
|
2127
|
+
address: import_zod8.z.string().optional().describe("Appointment address"),
|
|
2128
|
+
notes: import_zod8.z.string().optional().describe("Appointment notes"),
|
|
2129
|
+
toNotify: import_zod8.z.boolean().optional().describe("Whether to send notifications")
|
|
1866
2130
|
},
|
|
1867
2131
|
async ({ calendarId, locationId: locationId2, contactId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
|
|
1868
2132
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -1889,16 +2153,16 @@ function registerCalendarTools(server2, client) {
|
|
|
1889
2153
|
"update_appointment",
|
|
1890
2154
|
"Update an existing appointment",
|
|
1891
2155
|
{
|
|
1892
|
-
eventId:
|
|
1893
|
-
calendarId:
|
|
1894
|
-
startTime:
|
|
1895
|
-
endTime:
|
|
1896
|
-
title:
|
|
1897
|
-
appointmentStatus:
|
|
1898
|
-
assignedUserId:
|
|
1899
|
-
address:
|
|
1900
|
-
notes:
|
|
1901
|
-
toNotify:
|
|
2156
|
+
eventId: import_zod8.z.string().describe("The appointment event ID to update"),
|
|
2157
|
+
calendarId: import_zod8.z.string().optional().describe("Calendar ID"),
|
|
2158
|
+
startTime: import_zod8.z.string().optional().describe("Start time in ISO format"),
|
|
2159
|
+
endTime: import_zod8.z.string().optional().describe("End time in ISO format"),
|
|
2160
|
+
title: import_zod8.z.string().optional().describe("Appointment title"),
|
|
2161
|
+
appointmentStatus: import_zod8.z.enum(["confirmed", "new", "cancelled", "showed", "noshow"]).optional().describe("Appointment status"),
|
|
2162
|
+
assignedUserId: import_zod8.z.string().optional().describe("Assigned user ID"),
|
|
2163
|
+
address: import_zod8.z.string().optional().describe("Appointment address"),
|
|
2164
|
+
notes: import_zod8.z.string().optional().describe("Appointment notes"),
|
|
2165
|
+
toNotify: import_zod8.z.boolean().optional().describe("Whether to send notifications")
|
|
1902
2166
|
},
|
|
1903
2167
|
async ({ eventId, calendarId, startTime, endTime, title, appointmentStatus, assignedUserId, address, notes, toNotify }) => {
|
|
1904
2168
|
const body = {};
|
|
@@ -1922,8 +2186,8 @@ function registerCalendarTools(server2, client) {
|
|
|
1922
2186
|
"delete_appointment",
|
|
1923
2187
|
"Permanently delete an appointment. IRREVERSIBLE.",
|
|
1924
2188
|
{
|
|
1925
|
-
eventId:
|
|
1926
|
-
confirm:
|
|
2189
|
+
eventId: import_zod8.z.string().describe("The appointment event ID to delete"),
|
|
2190
|
+
confirm: import_zod8.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
1927
2191
|
},
|
|
1928
2192
|
async ({ eventId }) => {
|
|
1929
2193
|
return await client.delete(
|
|
@@ -1934,14 +2198,14 @@ function registerCalendarTools(server2, client) {
|
|
|
1934
2198
|
}
|
|
1935
2199
|
|
|
1936
2200
|
// src/tools/locations.ts
|
|
1937
|
-
var
|
|
2201
|
+
var import_zod9 = require("zod");
|
|
1938
2202
|
function registerLocationTools(server2, client) {
|
|
1939
2203
|
safeTool(
|
|
1940
2204
|
server2,
|
|
1941
2205
|
"get_location",
|
|
1942
2206
|
"Retrieve a single location (sub-account) by its ID from GoHighLevel.",
|
|
1943
2207
|
{
|
|
1944
|
-
locationId:
|
|
2208
|
+
locationId: import_zod9.z.string().describe("The ID of the location to retrieve.")
|
|
1945
2209
|
},
|
|
1946
2210
|
async ({ locationId: locationId2 }) => {
|
|
1947
2211
|
return await client.get(`/locations/${locationId2}`);
|
|
@@ -1952,18 +2216,18 @@ function registerLocationTools(server2, client) {
|
|
|
1952
2216
|
"update_location",
|
|
1953
2217
|
"Update a location (sub-account) in GoHighLevel. Only provided fields will be updated.",
|
|
1954
2218
|
{
|
|
1955
|
-
locationId:
|
|
1956
|
-
name:
|
|
1957
|
-
address:
|
|
1958
|
-
city:
|
|
1959
|
-
state:
|
|
1960
|
-
postalCode:
|
|
1961
|
-
country:
|
|
1962
|
-
website:
|
|
1963
|
-
timezone:
|
|
1964
|
-
phone:
|
|
1965
|
-
email:
|
|
1966
|
-
settings:
|
|
2219
|
+
locationId: import_zod9.z.string().describe("The ID of the location to update."),
|
|
2220
|
+
name: import_zod9.z.string().optional().describe("Business name."),
|
|
2221
|
+
address: import_zod9.z.string().optional().describe("Street address."),
|
|
2222
|
+
city: import_zod9.z.string().optional().describe("City."),
|
|
2223
|
+
state: import_zod9.z.string().optional().describe("State or province."),
|
|
2224
|
+
postalCode: import_zod9.z.string().optional().describe("Postal / ZIP code."),
|
|
2225
|
+
country: import_zod9.z.string().optional().describe("Country (e.g., 'US')."),
|
|
2226
|
+
website: import_zod9.z.string().optional().describe("Website URL."),
|
|
2227
|
+
timezone: import_zod9.z.string().optional().describe("IANA timezone (e.g., 'America/New_York')."),
|
|
2228
|
+
phone: import_zod9.z.string().optional().describe("Phone number."),
|
|
2229
|
+
email: import_zod9.z.string().optional().describe("Email address."),
|
|
2230
|
+
settings: import_zod9.z.record(import_zod9.z.unknown()).optional().describe("Location settings object with key-value pairs.")
|
|
1967
2231
|
},
|
|
1968
2232
|
async ({ locationId: locationId2, name, address, city, state, postalCode, country, website, timezone, phone, email, settings }) => {
|
|
1969
2233
|
const body = {};
|
|
@@ -1986,11 +2250,11 @@ function registerLocationTools(server2, client) {
|
|
|
1986
2250
|
"search_locations",
|
|
1987
2251
|
"Search locations (sub-accounts) under an agency in GoHighLevel. Requires companyId (agency-level).",
|
|
1988
2252
|
{
|
|
1989
|
-
companyId:
|
|
1990
|
-
limit:
|
|
1991
|
-
skip:
|
|
1992
|
-
order:
|
|
1993
|
-
isActive:
|
|
2253
|
+
companyId: import_zod9.z.string().describe("The agency / company ID (required for agency-level search)."),
|
|
2254
|
+
limit: import_zod9.z.number().optional().describe("Maximum number of locations to return."),
|
|
2255
|
+
skip: import_zod9.z.number().optional().describe("Number of locations to skip for pagination."),
|
|
2256
|
+
order: import_zod9.z.string().optional().describe("Sort order (e.g., 'asc' or 'desc')."),
|
|
2257
|
+
isActive: import_zod9.z.boolean().optional().describe("Filter by active status.")
|
|
1994
2258
|
},
|
|
1995
2259
|
async ({ companyId, limit, skip, order, isActive }) => {
|
|
1996
2260
|
return await client.get("/locations/search", {
|
|
@@ -2003,9 +2267,9 @@ function registerLocationTools(server2, client) {
|
|
|
2003
2267
|
"get_location_tags",
|
|
2004
2268
|
"Retrieve tags for a location in GoHighLevel.",
|
|
2005
2269
|
{
|
|
2006
|
-
locationId:
|
|
2007
|
-
limit:
|
|
2008
|
-
skip:
|
|
2270
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2271
|
+
limit: import_zod9.z.number().optional().describe("Maximum number of tags to return."),
|
|
2272
|
+
skip: import_zod9.z.number().optional().describe("Number of tags to skip for pagination.")
|
|
2009
2273
|
},
|
|
2010
2274
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2011
2275
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2019,8 +2283,8 @@ function registerLocationTools(server2, client) {
|
|
|
2019
2283
|
"create_location_tag",
|
|
2020
2284
|
"Create a new tag for a location in GoHighLevel.",
|
|
2021
2285
|
{
|
|
2022
|
-
locationId:
|
|
2023
|
-
name:
|
|
2286
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2287
|
+
name: import_zod9.z.string().describe("The name of the tag to create.")
|
|
2024
2288
|
},
|
|
2025
2289
|
async ({ locationId: locationId2, name }) => {
|
|
2026
2290
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2034,9 +2298,9 @@ function registerLocationTools(server2, client) {
|
|
|
2034
2298
|
"update_location_tag",
|
|
2035
2299
|
"Update an existing tag for a location in GoHighLevel.",
|
|
2036
2300
|
{
|
|
2037
|
-
locationId:
|
|
2038
|
-
tagId:
|
|
2039
|
-
name:
|
|
2301
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2302
|
+
tagId: import_zod9.z.string().describe("The ID of the tag to update."),
|
|
2303
|
+
name: import_zod9.z.string().describe("The new name for the tag.")
|
|
2040
2304
|
},
|
|
2041
2305
|
async ({ locationId: locationId2, tagId, name }) => {
|
|
2042
2306
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2050,8 +2314,8 @@ function registerLocationTools(server2, client) {
|
|
|
2050
2314
|
"delete_location_tag",
|
|
2051
2315
|
"Delete a tag from a location in GoHighLevel.",
|
|
2052
2316
|
{
|
|
2053
|
-
locationId:
|
|
2054
|
-
tagId:
|
|
2317
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2318
|
+
tagId: import_zod9.z.string().describe("The ID of the tag to delete.")
|
|
2055
2319
|
},
|
|
2056
2320
|
async ({ locationId: locationId2, tagId }) => {
|
|
2057
2321
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2063,7 +2327,7 @@ function registerLocationTools(server2, client) {
|
|
|
2063
2327
|
"get_custom_fields",
|
|
2064
2328
|
"Retrieve custom fields for a location in GoHighLevel.",
|
|
2065
2329
|
{
|
|
2066
|
-
locationId:
|
|
2330
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2067
2331
|
},
|
|
2068
2332
|
async ({ locationId: locationId2 }) => {
|
|
2069
2333
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2075,9 +2339,9 @@ function registerLocationTools(server2, client) {
|
|
|
2075
2339
|
"create_custom_field",
|
|
2076
2340
|
"Create a new custom field for a location in GoHighLevel.",
|
|
2077
2341
|
{
|
|
2078
|
-
locationId:
|
|
2079
|
-
name:
|
|
2080
|
-
dataType:
|
|
2342
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2343
|
+
name: import_zod9.z.string().describe("The name of the custom field."),
|
|
2344
|
+
dataType: import_zod9.z.enum([
|
|
2081
2345
|
"TEXT",
|
|
2082
2346
|
"LARGE_TEXT",
|
|
2083
2347
|
"NUMERICAL",
|
|
@@ -2092,10 +2356,10 @@ function registerLocationTools(server2, client) {
|
|
|
2092
2356
|
"FILE_UPLOAD",
|
|
2093
2357
|
"SIGNATURE"
|
|
2094
2358
|
]).describe("The data type of the custom field."),
|
|
2095
|
-
placeholder:
|
|
2096
|
-
position:
|
|
2097
|
-
options:
|
|
2098
|
-
model:
|
|
2359
|
+
placeholder: import_zod9.z.string().optional().describe("Placeholder text for the field."),
|
|
2360
|
+
position: import_zod9.z.number().optional().describe("Display position / sort order of the field."),
|
|
2361
|
+
options: import_zod9.z.array(import_zod9.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
|
|
2362
|
+
model: import_zod9.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to. Defaults to contact.")
|
|
2099
2363
|
},
|
|
2100
2364
|
async ({ locationId: locationId2, name, dataType, placeholder, position, options, model }) => {
|
|
2101
2365
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2112,10 +2376,10 @@ function registerLocationTools(server2, client) {
|
|
|
2112
2376
|
"update_custom_field",
|
|
2113
2377
|
"Update an existing custom field for a location in GoHighLevel.",
|
|
2114
2378
|
{
|
|
2115
|
-
locationId:
|
|
2116
|
-
fieldId:
|
|
2117
|
-
name:
|
|
2118
|
-
dataType:
|
|
2379
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2380
|
+
fieldId: import_zod9.z.string().describe("The ID of the custom field to update."),
|
|
2381
|
+
name: import_zod9.z.string().optional().describe("The name of the custom field."),
|
|
2382
|
+
dataType: import_zod9.z.enum([
|
|
2119
2383
|
"TEXT",
|
|
2120
2384
|
"LARGE_TEXT",
|
|
2121
2385
|
"NUMERICAL",
|
|
@@ -2130,10 +2394,10 @@ function registerLocationTools(server2, client) {
|
|
|
2130
2394
|
"FILE_UPLOAD",
|
|
2131
2395
|
"SIGNATURE"
|
|
2132
2396
|
]).optional().describe("The data type of the custom field."),
|
|
2133
|
-
placeholder:
|
|
2134
|
-
position:
|
|
2135
|
-
options:
|
|
2136
|
-
model:
|
|
2397
|
+
placeholder: import_zod9.z.string().optional().describe("Placeholder text for the field."),
|
|
2398
|
+
position: import_zod9.z.number().optional().describe("Display position / sort order of the field."),
|
|
2399
|
+
options: import_zod9.z.array(import_zod9.z.string()).optional().describe("Options for dropdown types (SINGLE_OPTIONS, MULTIPLE_OPTIONS)."),
|
|
2400
|
+
model: import_zod9.z.enum(["contact", "opportunity"]).optional().describe("The model this custom field belongs to.")
|
|
2137
2401
|
},
|
|
2138
2402
|
async ({ locationId: locationId2, fieldId, name, dataType, placeholder, position, options, model }) => {
|
|
2139
2403
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2152,8 +2416,8 @@ function registerLocationTools(server2, client) {
|
|
|
2152
2416
|
"delete_custom_field",
|
|
2153
2417
|
"Delete a custom field from a location in GoHighLevel.",
|
|
2154
2418
|
{
|
|
2155
|
-
locationId:
|
|
2156
|
-
fieldId:
|
|
2419
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2420
|
+
fieldId: import_zod9.z.string().describe("The ID of the custom field to delete.")
|
|
2157
2421
|
},
|
|
2158
2422
|
async ({ locationId: locationId2, fieldId }) => {
|
|
2159
2423
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2165,7 +2429,7 @@ function registerLocationTools(server2, client) {
|
|
|
2165
2429
|
"get_custom_values",
|
|
2166
2430
|
"Retrieve custom values for a location in GoHighLevel.",
|
|
2167
2431
|
{
|
|
2168
|
-
locationId:
|
|
2432
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2169
2433
|
},
|
|
2170
2434
|
async ({ locationId: locationId2 }) => {
|
|
2171
2435
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2177,9 +2441,9 @@ function registerLocationTools(server2, client) {
|
|
|
2177
2441
|
"create_custom_value",
|
|
2178
2442
|
"Create a new custom value for a location in GoHighLevel.",
|
|
2179
2443
|
{
|
|
2180
|
-
locationId:
|
|
2181
|
-
name:
|
|
2182
|
-
value:
|
|
2444
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2445
|
+
name: import_zod9.z.string().describe("The name / key of the custom value."),
|
|
2446
|
+
value: import_zod9.z.string().describe("The value to set.")
|
|
2183
2447
|
},
|
|
2184
2448
|
async ({ locationId: locationId2, name, value }) => {
|
|
2185
2449
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2193,10 +2457,10 @@ function registerLocationTools(server2, client) {
|
|
|
2193
2457
|
"update_custom_value",
|
|
2194
2458
|
"Update an existing custom value for a location in GoHighLevel.",
|
|
2195
2459
|
{
|
|
2196
|
-
locationId:
|
|
2197
|
-
valueId:
|
|
2198
|
-
name:
|
|
2199
|
-
value:
|
|
2460
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2461
|
+
valueId: import_zod9.z.string().describe("The ID of the custom value to update."),
|
|
2462
|
+
name: import_zod9.z.string().optional().describe("The new name / key of the custom value."),
|
|
2463
|
+
value: import_zod9.z.string().optional().describe("The new value to set.")
|
|
2200
2464
|
},
|
|
2201
2465
|
async ({ locationId: locationId2, valueId, name, value }) => {
|
|
2202
2466
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2211,8 +2475,8 @@ function registerLocationTools(server2, client) {
|
|
|
2211
2475
|
"delete_custom_value",
|
|
2212
2476
|
"Delete a custom value from a location in GoHighLevel.",
|
|
2213
2477
|
{
|
|
2214
|
-
locationId:
|
|
2215
|
-
valueId:
|
|
2478
|
+
locationId: import_zod9.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted."),
|
|
2479
|
+
valueId: import_zod9.z.string().describe("The ID of the custom value to delete.")
|
|
2216
2480
|
},
|
|
2217
2481
|
async ({ locationId: locationId2, valueId }) => {
|
|
2218
2482
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2222,14 +2486,14 @@ function registerLocationTools(server2, client) {
|
|
|
2222
2486
|
}
|
|
2223
2487
|
|
|
2224
2488
|
// src/tools/workflows.ts
|
|
2225
|
-
var
|
|
2489
|
+
var import_zod10 = require("zod");
|
|
2226
2490
|
function registerWorkflowTools(server2, client) {
|
|
2227
2491
|
safeTool(
|
|
2228
2492
|
server2,
|
|
2229
2493
|
"get_workflows",
|
|
2230
2494
|
"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
2495
|
{
|
|
2232
|
-
locationId:
|
|
2496
|
+
locationId: import_zod10.z.string().optional().describe("Location ID. Falls back to the environment default (GHL_LOCATION_ID) if omitted.")
|
|
2233
2497
|
},
|
|
2234
2498
|
async ({ locationId: locationId2 }) => {
|
|
2235
2499
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2241,16 +2505,16 @@ function registerWorkflowTools(server2, client) {
|
|
|
2241
2505
|
}
|
|
2242
2506
|
|
|
2243
2507
|
// src/tools/funnels.ts
|
|
2244
|
-
var
|
|
2508
|
+
var import_zod11 = require("zod");
|
|
2245
2509
|
function registerFunnelTools(server2, client) {
|
|
2246
2510
|
safeTool(
|
|
2247
2511
|
server2,
|
|
2248
2512
|
"get_funnels",
|
|
2249
2513
|
"List funnels for a location. Offset-based pagination via limit/offset.",
|
|
2250
2514
|
{
|
|
2251
|
-
locationId:
|
|
2252
|
-
limit:
|
|
2253
|
-
offset:
|
|
2515
|
+
locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2516
|
+
limit: import_zod11.z.number().optional().describe("Max number of funnels to return"),
|
|
2517
|
+
offset: import_zod11.z.number().optional().describe("Offset for pagination")
|
|
2254
2518
|
},
|
|
2255
2519
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
2256
2520
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2265,10 +2529,10 @@ function registerFunnelTools(server2, client) {
|
|
|
2265
2529
|
"get_funnel_pages",
|
|
2266
2530
|
"List pages for a specific funnel. Offset-based pagination via limit/offset.",
|
|
2267
2531
|
{
|
|
2268
|
-
locationId:
|
|
2269
|
-
funnelId:
|
|
2270
|
-
limit:
|
|
2271
|
-
offset:
|
|
2532
|
+
locationId: import_zod11.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2533
|
+
funnelId: import_zod11.z.string().describe("The funnel ID"),
|
|
2534
|
+
limit: import_zod11.z.number().optional().describe("Max number of pages to return"),
|
|
2535
|
+
offset: import_zod11.z.number().optional().describe("Offset for pagination")
|
|
2272
2536
|
},
|
|
2273
2537
|
async ({ locationId: locationId2, funnelId, limit, offset }) => {
|
|
2274
2538
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2284,17 +2548,17 @@ function registerFunnelTools(server2, client) {
|
|
|
2284
2548
|
}
|
|
2285
2549
|
|
|
2286
2550
|
// src/tools/forms.ts
|
|
2287
|
-
var
|
|
2551
|
+
var import_zod12 = require("zod");
|
|
2288
2552
|
function registerFormTools(server2, client) {
|
|
2289
2553
|
safeTool(
|
|
2290
2554
|
server2,
|
|
2291
2555
|
"get_forms",
|
|
2292
2556
|
"List forms for a location",
|
|
2293
2557
|
{
|
|
2294
|
-
locationId:
|
|
2295
|
-
limit:
|
|
2296
|
-
skip:
|
|
2297
|
-
type:
|
|
2558
|
+
locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2559
|
+
limit: import_zod12.z.number().optional().describe("Max number of forms to return"),
|
|
2560
|
+
skip: import_zod12.z.number().optional().describe("Number of forms to skip"),
|
|
2561
|
+
type: import_zod12.z.string().optional().describe("Filter by form type")
|
|
2298
2562
|
},
|
|
2299
2563
|
async ({ locationId: locationId2, limit, skip, type }) => {
|
|
2300
2564
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2310,13 +2574,13 @@ function registerFormTools(server2, client) {
|
|
|
2310
2574
|
"get_form_submissions",
|
|
2311
2575
|
"List form submissions for a location. Page-based pagination via page/limit (page starts at 1).",
|
|
2312
2576
|
{
|
|
2313
|
-
locationId:
|
|
2314
|
-
page:
|
|
2315
|
-
limit:
|
|
2316
|
-
formId:
|
|
2317
|
-
q:
|
|
2318
|
-
startAt:
|
|
2319
|
-
endAt:
|
|
2577
|
+
locationId: import_zod12.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2578
|
+
page: import_zod12.z.number().optional().describe("Page number for pagination"),
|
|
2579
|
+
limit: import_zod12.z.number().optional().describe("Max number of submissions to return"),
|
|
2580
|
+
formId: import_zod12.z.string().optional().describe("Filter by specific form ID"),
|
|
2581
|
+
q: import_zod12.z.string().optional().describe("Search query"),
|
|
2582
|
+
startAt: import_zod12.z.string().optional().describe("Start date filter (ISO string)"),
|
|
2583
|
+
endAt: import_zod12.z.string().optional().describe("End date filter (ISO string)")
|
|
2320
2584
|
},
|
|
2321
2585
|
async ({ locationId: locationId2, page, limit, formId, q, startAt, endAt }) => {
|
|
2322
2586
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2333,16 +2597,16 @@ function registerFormTools(server2, client) {
|
|
|
2333
2597
|
}
|
|
2334
2598
|
|
|
2335
2599
|
// src/tools/surveys.ts
|
|
2336
|
-
var
|
|
2600
|
+
var import_zod13 = require("zod");
|
|
2337
2601
|
function registerSurveyTools(server2, client) {
|
|
2338
2602
|
safeTool(
|
|
2339
2603
|
server2,
|
|
2340
2604
|
"get_surveys",
|
|
2341
2605
|
"List surveys for a location",
|
|
2342
2606
|
{
|
|
2343
|
-
locationId:
|
|
2344
|
-
limit:
|
|
2345
|
-
skip:
|
|
2607
|
+
locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2608
|
+
limit: import_zod13.z.number().optional().describe("Max number of surveys to return"),
|
|
2609
|
+
skip: import_zod13.z.number().optional().describe("Number of surveys to skip")
|
|
2346
2610
|
},
|
|
2347
2611
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2348
2612
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2357,13 +2621,13 @@ function registerSurveyTools(server2, client) {
|
|
|
2357
2621
|
"get_survey_submissions",
|
|
2358
2622
|
"List survey submissions for a location. Page-based pagination via page/limit (page starts at 1).",
|
|
2359
2623
|
{
|
|
2360
|
-
locationId:
|
|
2361
|
-
page:
|
|
2362
|
-
limit:
|
|
2363
|
-
surveyId:
|
|
2364
|
-
q:
|
|
2365
|
-
startAt:
|
|
2366
|
-
endAt:
|
|
2624
|
+
locationId: import_zod13.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2625
|
+
page: import_zod13.z.number().optional().describe("Page number for pagination"),
|
|
2626
|
+
limit: import_zod13.z.number().optional().describe("Max number of submissions to return"),
|
|
2627
|
+
surveyId: import_zod13.z.string().optional().describe("Filter by specific survey ID"),
|
|
2628
|
+
q: import_zod13.z.string().optional().describe("Search query"),
|
|
2629
|
+
startAt: import_zod13.z.string().optional().describe("Start date filter (ISO string)"),
|
|
2630
|
+
endAt: import_zod13.z.string().optional().describe("End date filter (ISO string)")
|
|
2367
2631
|
},
|
|
2368
2632
|
async ({ locationId: locationId2, page, limit, surveyId, q, startAt, endAt }) => {
|
|
2369
2633
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2380,22 +2644,22 @@ function registerSurveyTools(server2, client) {
|
|
|
2380
2644
|
}
|
|
2381
2645
|
|
|
2382
2646
|
// src/tools/payments.ts
|
|
2383
|
-
var
|
|
2647
|
+
var import_zod14 = require("zod");
|
|
2384
2648
|
function registerPaymentTools(server2, client) {
|
|
2385
2649
|
safeTool(
|
|
2386
2650
|
server2,
|
|
2387
2651
|
"get_orders",
|
|
2388
2652
|
"List orders for a location. Offset-based pagination via limit/offset.",
|
|
2389
2653
|
{
|
|
2390
|
-
locationId:
|
|
2391
|
-
limit:
|
|
2392
|
-
offset:
|
|
2393
|
-
startAt:
|
|
2394
|
-
endAt:
|
|
2395
|
-
search:
|
|
2396
|
-
contactId:
|
|
2397
|
-
paymentMode:
|
|
2398
|
-
status:
|
|
2654
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2655
|
+
limit: import_zod14.z.number().optional().describe("Max number of orders to return"),
|
|
2656
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2657
|
+
startAt: import_zod14.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2658
|
+
endAt: import_zod14.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2659
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2660
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2661
|
+
paymentMode: import_zod14.z.string().optional().describe("Filter by payment mode"),
|
|
2662
|
+
status: import_zod14.z.string().optional().describe("Filter by order status")
|
|
2399
2663
|
},
|
|
2400
2664
|
async ({ locationId: locationId2, limit, offset, startAt, endAt, search, contactId, paymentMode, status }) => {
|
|
2401
2665
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2420,8 +2684,8 @@ function registerPaymentTools(server2, client) {
|
|
|
2420
2684
|
"get_order",
|
|
2421
2685
|
"Get a specific order by ID",
|
|
2422
2686
|
{
|
|
2423
|
-
locationId:
|
|
2424
|
-
orderId:
|
|
2687
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2688
|
+
orderId: import_zod14.z.string().describe("The order ID")
|
|
2425
2689
|
},
|
|
2426
2690
|
async ({ locationId: locationId2, orderId }) => {
|
|
2427
2691
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2437,12 +2701,12 @@ function registerPaymentTools(server2, client) {
|
|
|
2437
2701
|
"get_subscriptions",
|
|
2438
2702
|
"List subscriptions for a location. Offset-based pagination via limit/offset.",
|
|
2439
2703
|
{
|
|
2440
|
-
locationId:
|
|
2441
|
-
limit:
|
|
2442
|
-
offset:
|
|
2443
|
-
search:
|
|
2444
|
-
contactId:
|
|
2445
|
-
entityId:
|
|
2704
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2705
|
+
limit: import_zod14.z.number().optional().describe("Max number of subscriptions to return"),
|
|
2706
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2707
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2708
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2709
|
+
entityId: import_zod14.z.string().optional().describe("Filter by entity ID")
|
|
2446
2710
|
},
|
|
2447
2711
|
async ({ locationId: locationId2, limit, offset, search, contactId, entityId }) => {
|
|
2448
2712
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2463,16 +2727,16 @@ function registerPaymentTools(server2, client) {
|
|
|
2463
2727
|
"get_transactions",
|
|
2464
2728
|
"List transactions for a location. Offset-based pagination via limit/offset.",
|
|
2465
2729
|
{
|
|
2466
|
-
locationId:
|
|
2467
|
-
limit:
|
|
2468
|
-
offset:
|
|
2469
|
-
startAt:
|
|
2470
|
-
endAt:
|
|
2471
|
-
search:
|
|
2472
|
-
entityId:
|
|
2473
|
-
paymentMode:
|
|
2474
|
-
contactId:
|
|
2475
|
-
subscriptionId:
|
|
2730
|
+
locationId: import_zod14.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2731
|
+
limit: import_zod14.z.number().optional().describe("Max number of transactions to return"),
|
|
2732
|
+
offset: import_zod14.z.number().optional().describe("Offset for pagination"),
|
|
2733
|
+
startAt: import_zod14.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2734
|
+
endAt: import_zod14.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2735
|
+
search: import_zod14.z.string().optional().describe("Search term"),
|
|
2736
|
+
entityId: import_zod14.z.string().optional().describe("Filter by entity ID"),
|
|
2737
|
+
paymentMode: import_zod14.z.string().optional().describe("Filter by payment mode"),
|
|
2738
|
+
contactId: import_zod14.z.string().optional().describe("Filter by contact ID"),
|
|
2739
|
+
subscriptionId: import_zod14.z.string().optional().describe("Filter by subscription ID")
|
|
2476
2740
|
},
|
|
2477
2741
|
async ({ locationId: locationId2, limit, offset, startAt, endAt, search, entityId, paymentMode, contactId, subscriptionId }) => {
|
|
2478
2742
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2495,21 +2759,21 @@ function registerPaymentTools(server2, client) {
|
|
|
2495
2759
|
}
|
|
2496
2760
|
|
|
2497
2761
|
// src/tools/invoices.ts
|
|
2498
|
-
var
|
|
2762
|
+
var import_zod15 = require("zod");
|
|
2499
2763
|
function registerInvoiceTools(server2, client) {
|
|
2500
2764
|
safeTool(
|
|
2501
2765
|
server2,
|
|
2502
2766
|
"list_invoices",
|
|
2503
2767
|
"List invoices for a location. Offset-based pagination via limit/offset.",
|
|
2504
2768
|
{
|
|
2505
|
-
locationId:
|
|
2506
|
-
limit:
|
|
2507
|
-
offset:
|
|
2508
|
-
status:
|
|
2509
|
-
contactId:
|
|
2510
|
-
startAt:
|
|
2511
|
-
endAt:
|
|
2512
|
-
search:
|
|
2769
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2770
|
+
limit: import_zod15.z.number().optional().describe("Max number of invoices to return"),
|
|
2771
|
+
offset: import_zod15.z.number().optional().describe("Offset for pagination"),
|
|
2772
|
+
status: import_zod15.z.enum(["draft", "sent", "paid", "void", "partially_paid"]).optional().describe("Filter by invoice status"),
|
|
2773
|
+
contactId: import_zod15.z.string().optional().describe("Filter by contact ID"),
|
|
2774
|
+
startAt: import_zod15.z.string().optional().describe("Start date filter (ISO 8601)"),
|
|
2775
|
+
endAt: import_zod15.z.string().optional().describe("End date filter (ISO 8601)"),
|
|
2776
|
+
search: import_zod15.z.string().optional().describe("Search term")
|
|
2513
2777
|
},
|
|
2514
2778
|
async ({ locationId: locationId2, limit, offset, status, contactId, startAt, endAt, search }) => {
|
|
2515
2779
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2533,8 +2797,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2533
2797
|
"get_invoice",
|
|
2534
2798
|
"Get a specific invoice by ID",
|
|
2535
2799
|
{
|
|
2536
|
-
locationId:
|
|
2537
|
-
invoiceId:
|
|
2800
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2801
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID")
|
|
2538
2802
|
},
|
|
2539
2803
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2540
2804
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2550,22 +2814,22 @@ function registerInvoiceTools(server2, client) {
|
|
|
2550
2814
|
"create_invoice",
|
|
2551
2815
|
"Create a new invoice",
|
|
2552
2816
|
{
|
|
2553
|
-
locationId:
|
|
2554
|
-
name:
|
|
2555
|
-
contactId:
|
|
2556
|
-
items:
|
|
2557
|
-
name:
|
|
2558
|
-
description:
|
|
2559
|
-
quantity:
|
|
2560
|
-
price:
|
|
2561
|
-
currency:
|
|
2817
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2818
|
+
name: import_zod15.z.string().describe("Invoice name"),
|
|
2819
|
+
contactId: import_zod15.z.string().describe("Contact ID for the invoice"),
|
|
2820
|
+
items: import_zod15.z.array(import_zod15.z.object({
|
|
2821
|
+
name: import_zod15.z.string().describe("Item name"),
|
|
2822
|
+
description: import_zod15.z.string().describe("Item description"),
|
|
2823
|
+
quantity: import_zod15.z.number().describe("Item quantity"),
|
|
2824
|
+
price: import_zod15.z.number().describe("Item price"),
|
|
2825
|
+
currency: import_zod15.z.string().describe("Currency code (e.g. USD)")
|
|
2562
2826
|
})).describe("Invoice line items"),
|
|
2563
|
-
discount:
|
|
2564
|
-
type:
|
|
2565
|
-
value:
|
|
2827
|
+
discount: import_zod15.z.object({
|
|
2828
|
+
type: import_zod15.z.string().optional(),
|
|
2829
|
+
value: import_zod15.z.number().optional()
|
|
2566
2830
|
}).optional().describe("Discount to apply"),
|
|
2567
|
-
termsNotes:
|
|
2568
|
-
title:
|
|
2831
|
+
termsNotes: import_zod15.z.string().optional().describe("Terms and notes for the invoice"),
|
|
2832
|
+
title: import_zod15.z.string().optional().describe("Invoice title")
|
|
2569
2833
|
},
|
|
2570
2834
|
async ({ locationId: locationId2, name, contactId, items, discount, termsNotes, title }) => {
|
|
2571
2835
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2587,22 +2851,22 @@ function registerInvoiceTools(server2, client) {
|
|
|
2587
2851
|
"update_invoice",
|
|
2588
2852
|
"Update an existing invoice",
|
|
2589
2853
|
{
|
|
2590
|
-
locationId:
|
|
2591
|
-
invoiceId:
|
|
2592
|
-
name:
|
|
2593
|
-
items:
|
|
2594
|
-
name:
|
|
2595
|
-
description:
|
|
2596
|
-
quantity:
|
|
2597
|
-
price:
|
|
2598
|
-
currency:
|
|
2854
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2855
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to update"),
|
|
2856
|
+
name: import_zod15.z.string().optional().describe("Invoice name"),
|
|
2857
|
+
items: import_zod15.z.array(import_zod15.z.object({
|
|
2858
|
+
name: import_zod15.z.string().describe("Item name"),
|
|
2859
|
+
description: import_zod15.z.string().describe("Item description"),
|
|
2860
|
+
quantity: import_zod15.z.number().describe("Item quantity"),
|
|
2861
|
+
price: import_zod15.z.number().describe("Item price"),
|
|
2862
|
+
currency: import_zod15.z.string().describe("Currency code (e.g. USD)")
|
|
2599
2863
|
})).optional().describe("Invoice line items"),
|
|
2600
|
-
discount:
|
|
2601
|
-
type:
|
|
2602
|
-
value:
|
|
2864
|
+
discount: import_zod15.z.object({
|
|
2865
|
+
type: import_zod15.z.string().optional(),
|
|
2866
|
+
value: import_zod15.z.number().optional()
|
|
2603
2867
|
}).optional().describe("Discount to apply"),
|
|
2604
|
-
termsNotes:
|
|
2605
|
-
title:
|
|
2868
|
+
termsNotes: import_zod15.z.string().optional().describe("Terms and notes for the invoice"),
|
|
2869
|
+
title: import_zod15.z.string().optional().describe("Invoice title")
|
|
2606
2870
|
},
|
|
2607
2871
|
async ({ locationId: locationId2, invoiceId, name, items, discount, termsNotes, title }) => {
|
|
2608
2872
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2623,8 +2887,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2623
2887
|
"delete_invoice",
|
|
2624
2888
|
"Delete an invoice",
|
|
2625
2889
|
{
|
|
2626
|
-
locationId:
|
|
2627
|
-
invoiceId:
|
|
2890
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2891
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to delete")
|
|
2628
2892
|
},
|
|
2629
2893
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2630
2894
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2640,8 +2904,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2640
2904
|
"send_invoice",
|
|
2641
2905
|
"Send an invoice to the contact",
|
|
2642
2906
|
{
|
|
2643
|
-
locationId:
|
|
2644
|
-
invoiceId:
|
|
2907
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2908
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to send")
|
|
2645
2909
|
},
|
|
2646
2910
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2647
2911
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2657,8 +2921,8 @@ function registerInvoiceTools(server2, client) {
|
|
|
2657
2921
|
"void_invoice",
|
|
2658
2922
|
"Void an invoice",
|
|
2659
2923
|
{
|
|
2660
|
-
locationId:
|
|
2661
|
-
invoiceId:
|
|
2924
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2925
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID to void")
|
|
2662
2926
|
},
|
|
2663
2927
|
async ({ locationId: locationId2, invoiceId }) => {
|
|
2664
2928
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2674,11 +2938,11 @@ function registerInvoiceTools(server2, client) {
|
|
|
2674
2938
|
"record_invoice_payment",
|
|
2675
2939
|
"Record a manual payment for an invoice",
|
|
2676
2940
|
{
|
|
2677
|
-
locationId:
|
|
2678
|
-
invoiceId:
|
|
2679
|
-
amount:
|
|
2680
|
-
mode:
|
|
2681
|
-
notes:
|
|
2941
|
+
locationId: import_zod15.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2942
|
+
invoiceId: import_zod15.z.string().describe("The invoice ID"),
|
|
2943
|
+
amount: import_zod15.z.number().describe("Payment amount"),
|
|
2944
|
+
mode: import_zod15.z.enum(["cash", "cheque", "bank_transfer", "other"]).describe("Payment mode"),
|
|
2945
|
+
notes: import_zod15.z.string().optional().describe("Payment notes")
|
|
2682
2946
|
},
|
|
2683
2947
|
async ({ locationId: locationId2, invoiceId, amount, mode, notes }) => {
|
|
2684
2948
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2695,15 +2959,15 @@ function registerInvoiceTools(server2, client) {
|
|
|
2695
2959
|
}
|
|
2696
2960
|
|
|
2697
2961
|
// src/tools/campaigns.ts
|
|
2698
|
-
var
|
|
2962
|
+
var import_zod16 = require("zod");
|
|
2699
2963
|
function registerCampaignTools(server2, client) {
|
|
2700
2964
|
safeTool(
|
|
2701
2965
|
server2,
|
|
2702
2966
|
"get_campaigns",
|
|
2703
2967
|
"List campaigns for a location",
|
|
2704
2968
|
{
|
|
2705
|
-
locationId:
|
|
2706
|
-
status:
|
|
2969
|
+
locationId: import_zod16.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2970
|
+
status: import_zod16.z.string().optional().describe("Filter by campaign status")
|
|
2707
2971
|
},
|
|
2708
2972
|
async ({ locationId: locationId2, status }) => {
|
|
2709
2973
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2715,16 +2979,16 @@ function registerCampaignTools(server2, client) {
|
|
|
2715
2979
|
}
|
|
2716
2980
|
|
|
2717
2981
|
// src/tools/users.ts
|
|
2718
|
-
var
|
|
2982
|
+
var import_zod17 = require("zod");
|
|
2719
2983
|
function registerUserTools(server2, client) {
|
|
2720
2984
|
safeTool(
|
|
2721
2985
|
server2,
|
|
2722
2986
|
"get_users",
|
|
2723
2987
|
"List users for a location",
|
|
2724
2988
|
{
|
|
2725
|
-
locationId:
|
|
2726
|
-
limit:
|
|
2727
|
-
skip:
|
|
2989
|
+
locationId: import_zod17.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
2990
|
+
limit: import_zod17.z.number().optional().describe("Max number of users to return"),
|
|
2991
|
+
skip: import_zod17.z.number().optional().describe("Number of users to skip")
|
|
2728
2992
|
},
|
|
2729
2993
|
async ({ locationId: locationId2, limit, skip }) => {
|
|
2730
2994
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2739,7 +3003,7 @@ function registerUserTools(server2, client) {
|
|
|
2739
3003
|
"get_user",
|
|
2740
3004
|
"Get a single user by ID",
|
|
2741
3005
|
{
|
|
2742
|
-
userId:
|
|
3006
|
+
userId: import_zod17.z.string().describe("The user ID")
|
|
2743
3007
|
},
|
|
2744
3008
|
async ({ userId }) => {
|
|
2745
3009
|
return client.get(`/users/${userId}`);
|
|
@@ -2748,19 +3012,19 @@ function registerUserTools(server2, client) {
|
|
|
2748
3012
|
}
|
|
2749
3013
|
|
|
2750
3014
|
// src/tools/media.ts
|
|
2751
|
-
var
|
|
3015
|
+
var import_zod18 = require("zod");
|
|
2752
3016
|
function registerMediaTools(server2, client) {
|
|
2753
3017
|
safeTool(
|
|
2754
3018
|
server2,
|
|
2755
3019
|
"get_media_files",
|
|
2756
3020
|
"List media files for a location",
|
|
2757
3021
|
{
|
|
2758
|
-
locationId:
|
|
2759
|
-
sortBy:
|
|
2760
|
-
sortOrder:
|
|
2761
|
-
limit:
|
|
2762
|
-
offset:
|
|
2763
|
-
query:
|
|
3022
|
+
locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3023
|
+
sortBy: import_zod18.z.string().optional().describe("Field to sort by"),
|
|
3024
|
+
sortOrder: import_zod18.z.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
3025
|
+
limit: import_zod18.z.number().optional().describe("Max number of files to return"),
|
|
3026
|
+
offset: import_zod18.z.number().optional().describe("Number of files to skip"),
|
|
3027
|
+
query: import_zod18.z.string().optional().describe("Search query to filter files")
|
|
2764
3028
|
},
|
|
2765
3029
|
async ({ locationId: locationId2, sortBy, sortOrder, limit, offset, query }) => {
|
|
2766
3030
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2778,8 +3042,8 @@ function registerMediaTools(server2, client) {
|
|
|
2778
3042
|
"delete_media_file",
|
|
2779
3043
|
"Delete a media file",
|
|
2780
3044
|
{
|
|
2781
|
-
mediaId:
|
|
2782
|
-
locationId:
|
|
3045
|
+
mediaId: import_zod18.z.string().describe("The media file ID to delete"),
|
|
3046
|
+
locationId: import_zod18.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2783
3047
|
},
|
|
2784
3048
|
async ({ mediaId, locationId: locationId2 }) => {
|
|
2785
3049
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2791,20 +3055,20 @@ function registerMediaTools(server2, client) {
|
|
|
2791
3055
|
}
|
|
2792
3056
|
|
|
2793
3057
|
// src/tools/social-planner.ts
|
|
2794
|
-
var
|
|
3058
|
+
var import_zod19 = require("zod");
|
|
2795
3059
|
function registerSocialPlannerTools(server2, client) {
|
|
2796
3060
|
safeTool(
|
|
2797
3061
|
server2,
|
|
2798
3062
|
"get_social_posts",
|
|
2799
3063
|
"List social media posts for a location",
|
|
2800
3064
|
{
|
|
2801
|
-
locationId:
|
|
2802
|
-
type:
|
|
2803
|
-
accounts:
|
|
2804
|
-
fromDate:
|
|
2805
|
-
toDate:
|
|
2806
|
-
includeUsers:
|
|
2807
|
-
status:
|
|
3065
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3066
|
+
type: import_zod19.z.enum(["post", "story", "reel"]).optional().describe("Post type filter"),
|
|
3067
|
+
accounts: import_zod19.z.string().optional().describe("Comma-separated account IDs to filter by"),
|
|
3068
|
+
fromDate: import_zod19.z.string().optional().describe("Start date filter (ISO string)"),
|
|
3069
|
+
toDate: import_zod19.z.string().optional().describe("End date filter (ISO string)"),
|
|
3070
|
+
includeUsers: import_zod19.z.boolean().optional().describe("Whether to include user details"),
|
|
3071
|
+
status: import_zod19.z.enum(["in_review", "scheduled", "published", "failed", "in_progress"]).optional().describe("Post status filter")
|
|
2808
3072
|
},
|
|
2809
3073
|
async ({ locationId: locationId2, type, accounts, fromDate, toDate, includeUsers, status }) => {
|
|
2810
3074
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2823,7 +3087,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2823
3087
|
"get_social_post",
|
|
2824
3088
|
"Get a single social media post by ID",
|
|
2825
3089
|
{
|
|
2826
|
-
postId:
|
|
3090
|
+
postId: import_zod19.z.string().describe("The social media post ID")
|
|
2827
3091
|
},
|
|
2828
3092
|
async ({ postId }) => {
|
|
2829
3093
|
return client.get(`/social-media-posting/${postId}`);
|
|
@@ -2834,7 +3098,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2834
3098
|
"delete_social_post",
|
|
2835
3099
|
"Delete a social media post",
|
|
2836
3100
|
{
|
|
2837
|
-
postId:
|
|
3101
|
+
postId: import_zod19.z.string().describe("The social media post ID to delete")
|
|
2838
3102
|
},
|
|
2839
3103
|
async ({ postId }) => {
|
|
2840
3104
|
return client.delete(`/social-media-posting/${postId}`);
|
|
@@ -2844,7 +3108,7 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2844
3108
|
"get_social_media_accounts",
|
|
2845
3109
|
"Get connected social media accounts for a location",
|
|
2846
3110
|
{
|
|
2847
|
-
locationId:
|
|
3111
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2848
3112
|
},
|
|
2849
3113
|
async ({ locationId: locationId2 }) => {
|
|
2850
3114
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2870,17 +3134,17 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2870
3134
|
"create_social_post",
|
|
2871
3135
|
"Create a new social media post",
|
|
2872
3136
|
{
|
|
2873
|
-
locationId:
|
|
2874
|
-
accountIds:
|
|
2875
|
-
summary:
|
|
2876
|
-
media:
|
|
2877
|
-
status:
|
|
2878
|
-
scheduledAt:
|
|
2879
|
-
tags:
|
|
2880
|
-
ogData:
|
|
2881
|
-
title:
|
|
2882
|
-
description:
|
|
2883
|
-
image:
|
|
3137
|
+
locationId: import_zod19.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3138
|
+
accountIds: import_zod19.z.array(import_zod19.z.string()).describe("Array of social account IDs to post to"),
|
|
3139
|
+
summary: import_zod19.z.string().optional().describe("The post text/caption"),
|
|
3140
|
+
media: import_zod19.z.array(import_zod19.z.string()).optional().describe("Array of media URLs to attach"),
|
|
3141
|
+
status: import_zod19.z.enum(["in_review", "scheduled", "draft"]).optional().describe("Post status"),
|
|
3142
|
+
scheduledAt: import_zod19.z.string().optional().describe("Scheduled publish time (ISO string)"),
|
|
3143
|
+
tags: import_zod19.z.array(import_zod19.z.string()).optional().describe("Tags for the post"),
|
|
3144
|
+
ogData: import_zod19.z.object({
|
|
3145
|
+
title: import_zod19.z.string().optional(),
|
|
3146
|
+
description: import_zod19.z.string().optional(),
|
|
3147
|
+
image: import_zod19.z.string().optional()
|
|
2884
3148
|
}).optional().describe("Open Graph data for link previews")
|
|
2885
3149
|
},
|
|
2886
3150
|
async ({ locationId: locationId2, accountIds, summary, media, status, scheduledAt, tags, ogData }) => {
|
|
@@ -2898,16 +3162,16 @@ function registerSocialPlannerTools(server2, client) {
|
|
|
2898
3162
|
}
|
|
2899
3163
|
|
|
2900
3164
|
// src/tools/courses.ts
|
|
2901
|
-
var
|
|
3165
|
+
var import_zod20 = require("zod");
|
|
2902
3166
|
function registerCourseTools(server2, client) {
|
|
2903
3167
|
safeTool(
|
|
2904
3168
|
server2,
|
|
2905
3169
|
"get_courses",
|
|
2906
3170
|
"List courses for a location",
|
|
2907
3171
|
{
|
|
2908
|
-
locationId:
|
|
2909
|
-
limit:
|
|
2910
|
-
offset:
|
|
3172
|
+
locationId: import_zod20.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3173
|
+
limit: import_zod20.z.number().optional().describe("Max number of courses to return"),
|
|
3174
|
+
offset: import_zod20.z.number().optional().describe("Number of courses to skip")
|
|
2911
3175
|
},
|
|
2912
3176
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
2913
3177
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2920,14 +3184,14 @@ function registerCourseTools(server2, client) {
|
|
|
2920
3184
|
}
|
|
2921
3185
|
|
|
2922
3186
|
// src/tools/businesses.ts
|
|
2923
|
-
var
|
|
3187
|
+
var import_zod21 = require("zod");
|
|
2924
3188
|
function registerBusinessTools(server2, client) {
|
|
2925
3189
|
safeTool(
|
|
2926
3190
|
server2,
|
|
2927
3191
|
"get_businesses",
|
|
2928
3192
|
"List businesses for a location",
|
|
2929
3193
|
{
|
|
2930
|
-
locationId:
|
|
3194
|
+
locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
2931
3195
|
},
|
|
2932
3196
|
async ({ locationId: locationId2 }) => {
|
|
2933
3197
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2939,7 +3203,7 @@ function registerBusinessTools(server2, client) {
|
|
|
2939
3203
|
"get_business",
|
|
2940
3204
|
"Get a single business by ID",
|
|
2941
3205
|
{
|
|
2942
|
-
businessId:
|
|
3206
|
+
businessId: import_zod21.z.string().describe("The business ID")
|
|
2943
3207
|
},
|
|
2944
3208
|
async ({ businessId }) => {
|
|
2945
3209
|
return client.get(`/businesses/${businessId}`);
|
|
@@ -2950,17 +3214,17 @@ function registerBusinessTools(server2, client) {
|
|
|
2950
3214
|
"create_business",
|
|
2951
3215
|
"Create a new business",
|
|
2952
3216
|
{
|
|
2953
|
-
locationId:
|
|
2954
|
-
name:
|
|
2955
|
-
phone:
|
|
2956
|
-
email:
|
|
2957
|
-
website:
|
|
2958
|
-
address:
|
|
2959
|
-
city:
|
|
2960
|
-
state:
|
|
2961
|
-
postalCode:
|
|
2962
|
-
country:
|
|
2963
|
-
description:
|
|
3217
|
+
locationId: import_zod21.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3218
|
+
name: import_zod21.z.string().describe("Business name"),
|
|
3219
|
+
phone: import_zod21.z.string().optional().describe("Phone number"),
|
|
3220
|
+
email: import_zod21.z.string().optional().describe("Email address"),
|
|
3221
|
+
website: import_zod21.z.string().optional().describe("Website URL"),
|
|
3222
|
+
address: import_zod21.z.string().optional().describe("Street address"),
|
|
3223
|
+
city: import_zod21.z.string().optional().describe("City"),
|
|
3224
|
+
state: import_zod21.z.string().optional().describe("State"),
|
|
3225
|
+
postalCode: import_zod21.z.string().optional().describe("Postal/ZIP code"),
|
|
3226
|
+
country: import_zod21.z.string().optional().describe("Country"),
|
|
3227
|
+
description: import_zod21.z.string().optional().describe("Business description")
|
|
2964
3228
|
},
|
|
2965
3229
|
async ({ locationId: locationId2, name, phone, email, website, address, city, state, postalCode, country, description }) => {
|
|
2966
3230
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -2982,17 +3246,17 @@ function registerBusinessTools(server2, client) {
|
|
|
2982
3246
|
"update_business",
|
|
2983
3247
|
"Update an existing business",
|
|
2984
3248
|
{
|
|
2985
|
-
businessId:
|
|
2986
|
-
name:
|
|
2987
|
-
phone:
|
|
2988
|
-
email:
|
|
2989
|
-
website:
|
|
2990
|
-
address:
|
|
2991
|
-
city:
|
|
2992
|
-
state:
|
|
2993
|
-
postalCode:
|
|
2994
|
-
country:
|
|
2995
|
-
description:
|
|
3249
|
+
businessId: import_zod21.z.string().describe("The business ID to update"),
|
|
3250
|
+
name: import_zod21.z.string().optional().describe("Business name"),
|
|
3251
|
+
phone: import_zod21.z.string().optional().describe("Phone number"),
|
|
3252
|
+
email: import_zod21.z.string().optional().describe("Email address"),
|
|
3253
|
+
website: import_zod21.z.string().optional().describe("Website URL"),
|
|
3254
|
+
address: import_zod21.z.string().optional().describe("Street address"),
|
|
3255
|
+
city: import_zod21.z.string().optional().describe("City"),
|
|
3256
|
+
state: import_zod21.z.string().optional().describe("State"),
|
|
3257
|
+
postalCode: import_zod21.z.string().optional().describe("Postal/ZIP code"),
|
|
3258
|
+
country: import_zod21.z.string().optional().describe("Country"),
|
|
3259
|
+
description: import_zod21.z.string().optional().describe("Business description")
|
|
2996
3260
|
},
|
|
2997
3261
|
async ({ businessId, name, phone, email, website, address, city, state, postalCode, country, description }) => {
|
|
2998
3262
|
const body = {};
|
|
@@ -3014,8 +3278,8 @@ function registerBusinessTools(server2, client) {
|
|
|
3014
3278
|
"delete_business",
|
|
3015
3279
|
"Permanently delete a business. IRREVERSIBLE.",
|
|
3016
3280
|
{
|
|
3017
|
-
businessId:
|
|
3018
|
-
confirm:
|
|
3281
|
+
businessId: import_zod21.z.string().describe("The business ID to delete"),
|
|
3282
|
+
confirm: import_zod21.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
3019
3283
|
},
|
|
3020
3284
|
async ({ businessId }) => {
|
|
3021
3285
|
return client.delete(`/businesses/${businessId}`);
|
|
@@ -3024,17 +3288,17 @@ function registerBusinessTools(server2, client) {
|
|
|
3024
3288
|
}
|
|
3025
3289
|
|
|
3026
3290
|
// src/tools/blogs.ts
|
|
3027
|
-
var
|
|
3291
|
+
var import_zod22 = require("zod");
|
|
3028
3292
|
function registerBlogTools(server2, client) {
|
|
3029
3293
|
safeTool(
|
|
3030
3294
|
server2,
|
|
3031
3295
|
"get_blog_posts",
|
|
3032
3296
|
"List blog posts for a location. Offset-based pagination via limit/offset.",
|
|
3033
3297
|
{
|
|
3034
|
-
locationId:
|
|
3035
|
-
limit:
|
|
3036
|
-
offset:
|
|
3037
|
-
status:
|
|
3298
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3299
|
+
limit: import_zod22.z.number().optional().describe("Number of posts to return"),
|
|
3300
|
+
offset: import_zod22.z.number().optional().describe("Offset for pagination"),
|
|
3301
|
+
status: import_zod22.z.enum(["published", "draft", "archived"]).optional().describe("Filter by post status")
|
|
3038
3302
|
},
|
|
3039
3303
|
async ({ locationId: locationId2, limit, offset, status }) => {
|
|
3040
3304
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3052,8 +3316,8 @@ function registerBlogTools(server2, client) {
|
|
|
3052
3316
|
"get_blog_post",
|
|
3053
3317
|
"Get a specific blog post by ID",
|
|
3054
3318
|
{
|
|
3055
|
-
blogId:
|
|
3056
|
-
postId:
|
|
3319
|
+
blogId: import_zod22.z.string().describe("Blog ID"),
|
|
3320
|
+
postId: import_zod22.z.string().describe("Post ID")
|
|
3057
3321
|
},
|
|
3058
3322
|
async ({ blogId, postId }) => {
|
|
3059
3323
|
return client.get(`/blogs/${blogId}/posts/${postId}`, {});
|
|
@@ -3064,7 +3328,7 @@ function registerBlogTools(server2, client) {
|
|
|
3064
3328
|
"get_blog_authors",
|
|
3065
3329
|
"List blog authors for a location",
|
|
3066
3330
|
{
|
|
3067
|
-
locationId:
|
|
3331
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3068
3332
|
},
|
|
3069
3333
|
async ({ locationId: locationId2 }) => {
|
|
3070
3334
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3078,7 +3342,7 @@ function registerBlogTools(server2, client) {
|
|
|
3078
3342
|
"get_blog_categories",
|
|
3079
3343
|
"List blog categories for a location",
|
|
3080
3344
|
{
|
|
3081
|
-
locationId:
|
|
3345
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3082
3346
|
},
|
|
3083
3347
|
async ({ locationId: locationId2 }) => {
|
|
3084
3348
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3092,8 +3356,8 @@ function registerBlogTools(server2, client) {
|
|
|
3092
3356
|
"check_blog_slug",
|
|
3093
3357
|
"Check if a blog post URL slug already exists",
|
|
3094
3358
|
{
|
|
3095
|
-
locationId:
|
|
3096
|
-
urlSlug:
|
|
3359
|
+
locationId: import_zod22.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)"),
|
|
3360
|
+
urlSlug: import_zod22.z.string().describe("URL slug to check")
|
|
3097
3361
|
},
|
|
3098
3362
|
async ({ locationId: locationId2, urlSlug }) => {
|
|
3099
3363
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3105,14 +3369,14 @@ function registerBlogTools(server2, client) {
|
|
|
3105
3369
|
}
|
|
3106
3370
|
|
|
3107
3371
|
// src/tools/emails.ts
|
|
3108
|
-
var
|
|
3372
|
+
var import_zod23 = require("zod");
|
|
3109
3373
|
function registerEmailTools(server2, client) {
|
|
3110
3374
|
safeTool(
|
|
3111
3375
|
server2,
|
|
3112
3376
|
"get_email_campaigns",
|
|
3113
3377
|
"List email campaigns for a location",
|
|
3114
3378
|
{
|
|
3115
|
-
locationId:
|
|
3379
|
+
locationId: import_zod23.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3116
3380
|
},
|
|
3117
3381
|
async ({ locationId: locationId2 }) => {
|
|
3118
3382
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3124,14 +3388,14 @@ function registerEmailTools(server2, client) {
|
|
|
3124
3388
|
}
|
|
3125
3389
|
|
|
3126
3390
|
// src/tools/trigger-links.ts
|
|
3127
|
-
var
|
|
3391
|
+
var import_zod24 = require("zod");
|
|
3128
3392
|
function registerTriggerLinkTools(server2, client) {
|
|
3129
3393
|
safeTool(
|
|
3130
3394
|
server2,
|
|
3131
3395
|
"get_trigger_links",
|
|
3132
3396
|
"List trigger links for a location",
|
|
3133
3397
|
{
|
|
3134
|
-
locationId:
|
|
3398
|
+
locationId: import_zod24.z.string().optional().describe("GHL Location ID (optional if GHL_LOCATION_ID is set)")
|
|
3135
3399
|
},
|
|
3136
3400
|
async ({ locationId: locationId2 }) => {
|
|
3137
3401
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3143,14 +3407,14 @@ function registerTriggerLinkTools(server2, client) {
|
|
|
3143
3407
|
}
|
|
3144
3408
|
|
|
3145
3409
|
// src/tools/custom-objects.ts
|
|
3146
|
-
var
|
|
3410
|
+
var import_zod25 = require("zod");
|
|
3147
3411
|
function registerCustomObjectTools(server2, client) {
|
|
3148
3412
|
safeTool(
|
|
3149
3413
|
server2,
|
|
3150
3414
|
"list_custom_objects",
|
|
3151
3415
|
"List all custom object schemas defined in a GHL location.",
|
|
3152
3416
|
{
|
|
3153
|
-
locationId:
|
|
3417
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3154
3418
|
},
|
|
3155
3419
|
async ({ locationId: locationId2 }) => {
|
|
3156
3420
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3164,8 +3428,8 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3164
3428
|
"get_custom_object",
|
|
3165
3429
|
"Retrieve a single custom object schema by its key.",
|
|
3166
3430
|
{
|
|
3167
|
-
schemaKey:
|
|
3168
|
-
locationId:
|
|
3431
|
+
schemaKey: import_zod25.z.string().describe("The key of the custom object schema to retrieve."),
|
|
3432
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3169
3433
|
},
|
|
3170
3434
|
async ({ schemaKey, locationId: locationId2 }) => {
|
|
3171
3435
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3179,11 +3443,11 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3179
3443
|
"search_custom_object_records",
|
|
3180
3444
|
"Search records of a custom object by schema key. Supports filtering and pagination.",
|
|
3181
3445
|
{
|
|
3182
|
-
schemaKey:
|
|
3183
|
-
locationId:
|
|
3184
|
-
query:
|
|
3185
|
-
limit:
|
|
3186
|
-
offset:
|
|
3446
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3447
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3448
|
+
query: import_zod25.z.string().optional().describe("Search query to filter records."),
|
|
3449
|
+
limit: import_zod25.z.number().optional().describe("Maximum records to return. Defaults to 20."),
|
|
3450
|
+
offset: import_zod25.z.number().optional().describe("Number of records to skip for pagination.")
|
|
3187
3451
|
},
|
|
3188
3452
|
async ({ schemaKey, locationId: locationId2, query, limit, offset }) => {
|
|
3189
3453
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3202,9 +3466,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3202
3466
|
"get_custom_object_record",
|
|
3203
3467
|
"Retrieve a single custom object record by schema key and record ID.",
|
|
3204
3468
|
{
|
|
3205
|
-
schemaKey:
|
|
3206
|
-
recordId:
|
|
3207
|
-
locationId:
|
|
3469
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3470
|
+
recordId: import_zod25.z.string().describe("The record ID to retrieve."),
|
|
3471
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3208
3472
|
},
|
|
3209
3473
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3210
3474
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3218,9 +3482,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3218
3482
|
"create_custom_object_record",
|
|
3219
3483
|
"Create a new record for a custom object.",
|
|
3220
3484
|
{
|
|
3221
|
-
schemaKey:
|
|
3222
|
-
locationId:
|
|
3223
|
-
properties:
|
|
3485
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3486
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3487
|
+
properties: import_zod25.z.record(import_zod25.z.unknown()).describe("Key-value pairs of field values for the new record.")
|
|
3224
3488
|
},
|
|
3225
3489
|
async ({ schemaKey, locationId: locationId2, properties }) => {
|
|
3226
3490
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3234,10 +3498,10 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3234
3498
|
"update_custom_object_record",
|
|
3235
3499
|
"Update an existing custom object record.",
|
|
3236
3500
|
{
|
|
3237
|
-
schemaKey:
|
|
3238
|
-
recordId:
|
|
3239
|
-
locationId:
|
|
3240
|
-
properties:
|
|
3501
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3502
|
+
recordId: import_zod25.z.string().describe("The record ID to update."),
|
|
3503
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3504
|
+
properties: import_zod25.z.record(import_zod25.z.unknown()).describe("Key-value pairs of field values to update.")
|
|
3241
3505
|
},
|
|
3242
3506
|
async ({ schemaKey, recordId, locationId: locationId2, properties }) => {
|
|
3243
3507
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3251,9 +3515,9 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3251
3515
|
"delete_custom_object_record",
|
|
3252
3516
|
"Delete a custom object record by schema key and record ID.",
|
|
3253
3517
|
{
|
|
3254
|
-
schemaKey:
|
|
3255
|
-
recordId:
|
|
3256
|
-
locationId:
|
|
3518
|
+
schemaKey: import_zod25.z.string().describe("The custom object schema key."),
|
|
3519
|
+
recordId: import_zod25.z.string().describe("The record ID to delete."),
|
|
3520
|
+
locationId: import_zod25.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3257
3521
|
},
|
|
3258
3522
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3259
3523
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3265,16 +3529,16 @@ function registerCustomObjectTools(server2, client) {
|
|
|
3265
3529
|
}
|
|
3266
3530
|
|
|
3267
3531
|
// src/tools/associations.ts
|
|
3268
|
-
var
|
|
3532
|
+
var import_zod26 = require("zod");
|
|
3269
3533
|
function registerAssociationTools(server2, client) {
|
|
3270
3534
|
safeTool(
|
|
3271
3535
|
server2,
|
|
3272
3536
|
"list_associations",
|
|
3273
3537
|
"List associations for a custom object record \u2014 shows related contacts, opportunities, or other records.",
|
|
3274
3538
|
{
|
|
3275
|
-
schemaKey:
|
|
3276
|
-
recordId:
|
|
3277
|
-
locationId:
|
|
3539
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key."),
|
|
3540
|
+
recordId: import_zod26.z.string().describe("The record ID to list associations for."),
|
|
3541
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3278
3542
|
},
|
|
3279
3543
|
async ({ schemaKey, recordId, locationId: locationId2 }) => {
|
|
3280
3544
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3289,11 +3553,11 @@ function registerAssociationTools(server2, client) {
|
|
|
3289
3553
|
"create_association",
|
|
3290
3554
|
"Create an association between a custom object record and another entity (contact, opportunity, or another custom object record).",
|
|
3291
3555
|
{
|
|
3292
|
-
schemaKey:
|
|
3293
|
-
recordId:
|
|
3294
|
-
locationId:
|
|
3295
|
-
targetEntityType:
|
|
3296
|
-
targetEntityId:
|
|
3556
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key of the source record."),
|
|
3557
|
+
recordId: import_zod26.z.string().describe("The source record ID."),
|
|
3558
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3559
|
+
targetEntityType: import_zod26.z.string().describe("The target entity type (e.g. 'contact', 'opportunity', or a custom object schema key)."),
|
|
3560
|
+
targetEntityId: import_zod26.z.string().describe("The ID of the target entity to associate with.")
|
|
3297
3561
|
},
|
|
3298
3562
|
async ({ schemaKey, recordId, locationId: locationId2, targetEntityType, targetEntityId }) => {
|
|
3299
3563
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3314,10 +3578,10 @@ function registerAssociationTools(server2, client) {
|
|
|
3314
3578
|
"delete_association",
|
|
3315
3579
|
"Remove an association between a custom object record and another entity.",
|
|
3316
3580
|
{
|
|
3317
|
-
schemaKey:
|
|
3318
|
-
recordId:
|
|
3319
|
-
associationId:
|
|
3320
|
-
locationId:
|
|
3581
|
+
schemaKey: import_zod26.z.string().describe("The custom object schema key of the source record."),
|
|
3582
|
+
recordId: import_zod26.z.string().describe("The source record ID."),
|
|
3583
|
+
associationId: import_zod26.z.string().describe("The association ID to remove."),
|
|
3584
|
+
locationId: import_zod26.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3321
3585
|
},
|
|
3322
3586
|
async ({ schemaKey, recordId, associationId, locationId: locationId2 }) => {
|
|
3323
3587
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3330,18 +3594,18 @@ function registerAssociationTools(server2, client) {
|
|
|
3330
3594
|
}
|
|
3331
3595
|
|
|
3332
3596
|
// src/tools/estimates.ts
|
|
3333
|
-
var
|
|
3597
|
+
var import_zod27 = require("zod");
|
|
3334
3598
|
function registerEstimateTools(server2, client) {
|
|
3335
3599
|
safeTool(
|
|
3336
3600
|
server2,
|
|
3337
3601
|
"list_estimates",
|
|
3338
3602
|
"List estimates/quotes in a GHL location. Supports pagination and filtering by status.",
|
|
3339
3603
|
{
|
|
3340
|
-
locationId:
|
|
3341
|
-
status:
|
|
3342
|
-
limit:
|
|
3343
|
-
offset:
|
|
3344
|
-
contactId:
|
|
3604
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3605
|
+
status: import_zod27.z.string().optional().describe("Filter by status (e.g. 'draft', 'sent', 'accepted', 'declined')."),
|
|
3606
|
+
limit: import_zod27.z.number().optional().describe("Maximum estimates to return. Defaults to 20."),
|
|
3607
|
+
offset: import_zod27.z.number().optional().describe("Number of records to skip for pagination."),
|
|
3608
|
+
contactId: import_zod27.z.string().optional().describe("Filter estimates by contact ID.")
|
|
3345
3609
|
},
|
|
3346
3610
|
async ({ locationId: locationId2, status, limit, offset, contactId }) => {
|
|
3347
3611
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3362,8 +3626,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3362
3626
|
"get_estimate",
|
|
3363
3627
|
"Retrieve a single estimate/quote by its ID.",
|
|
3364
3628
|
{
|
|
3365
|
-
estimateId:
|
|
3366
|
-
locationId:
|
|
3629
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to retrieve."),
|
|
3630
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3367
3631
|
},
|
|
3368
3632
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3369
3633
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3377,12 +3641,12 @@ function registerEstimateTools(server2, client) {
|
|
|
3377
3641
|
"create_estimate",
|
|
3378
3642
|
"Create a new estimate/quote for a contact.",
|
|
3379
3643
|
{
|
|
3380
|
-
locationId:
|
|
3381
|
-
contactId:
|
|
3382
|
-
name:
|
|
3383
|
-
title:
|
|
3384
|
-
items:
|
|
3385
|
-
discount:
|
|
3644
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3645
|
+
contactId: import_zod27.z.string().describe("The contact ID this estimate is for."),
|
|
3646
|
+
name: import_zod27.z.string().describe("Estimate name/title."),
|
|
3647
|
+
title: import_zod27.z.string().optional().describe("Display title for the estimate."),
|
|
3648
|
+
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."),
|
|
3649
|
+
discount: import_zod27.z.record(import_zod27.z.unknown()).optional().describe("Discount object (type, value).")
|
|
3386
3650
|
},
|
|
3387
3651
|
async ({ locationId: locationId2, contactId, name, title, items, discount }) => {
|
|
3388
3652
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3404,12 +3668,12 @@ function registerEstimateTools(server2, client) {
|
|
|
3404
3668
|
"update_estimate",
|
|
3405
3669
|
"Update an existing estimate/quote.",
|
|
3406
3670
|
{
|
|
3407
|
-
estimateId:
|
|
3408
|
-
locationId:
|
|
3409
|
-
name:
|
|
3410
|
-
title:
|
|
3411
|
-
items:
|
|
3412
|
-
discount:
|
|
3671
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to update."),
|
|
3672
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3673
|
+
name: import_zod27.z.string().optional().describe("Updated estimate name."),
|
|
3674
|
+
title: import_zod27.z.string().optional().describe("Updated display title."),
|
|
3675
|
+
items: import_zod27.z.array(import_zod27.z.record(import_zod27.z.unknown())).optional().describe("Updated line items array."),
|
|
3676
|
+
discount: import_zod27.z.record(import_zod27.z.unknown()).optional().describe("Updated discount object.")
|
|
3413
3677
|
},
|
|
3414
3678
|
async ({ estimateId, locationId: locationId2, name, title, items, discount }) => {
|
|
3415
3679
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3429,8 +3693,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3429
3693
|
"delete_estimate",
|
|
3430
3694
|
"Delete an estimate/quote by ID.",
|
|
3431
3695
|
{
|
|
3432
|
-
estimateId:
|
|
3433
|
-
locationId:
|
|
3696
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to delete."),
|
|
3697
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3434
3698
|
},
|
|
3435
3699
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3436
3700
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3444,8 +3708,8 @@ function registerEstimateTools(server2, client) {
|
|
|
3444
3708
|
"send_estimate",
|
|
3445
3709
|
"Send an estimate to the contact via email.",
|
|
3446
3710
|
{
|
|
3447
|
-
estimateId:
|
|
3448
|
-
locationId:
|
|
3711
|
+
estimateId: import_zod27.z.string().describe("The estimate ID to send."),
|
|
3712
|
+
locationId: import_zod27.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3449
3713
|
},
|
|
3450
3714
|
async ({ estimateId, locationId: locationId2 }) => {
|
|
3451
3715
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3457,14 +3721,14 @@ function registerEstimateTools(server2, client) {
|
|
|
3457
3721
|
}
|
|
3458
3722
|
|
|
3459
3723
|
// src/tools/coupons.ts
|
|
3460
|
-
var
|
|
3724
|
+
var import_zod28 = require("zod");
|
|
3461
3725
|
function registerCouponTools(server2, client) {
|
|
3462
3726
|
safeTool(
|
|
3463
3727
|
server2,
|
|
3464
3728
|
"list_coupons",
|
|
3465
3729
|
"List coupons/promo codes in a GHL location.",
|
|
3466
3730
|
{
|
|
3467
|
-
locationId:
|
|
3731
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3468
3732
|
},
|
|
3469
3733
|
async ({ locationId: locationId2 }) => {
|
|
3470
3734
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3478,8 +3742,8 @@ function registerCouponTools(server2, client) {
|
|
|
3478
3742
|
"get_coupon",
|
|
3479
3743
|
"Retrieve a single coupon by its ID.",
|
|
3480
3744
|
{
|
|
3481
|
-
couponId:
|
|
3482
|
-
locationId:
|
|
3745
|
+
couponId: import_zod28.z.string().describe("The coupon ID to retrieve."),
|
|
3746
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3483
3747
|
},
|
|
3484
3748
|
async ({ couponId, locationId: locationId2 }) => {
|
|
3485
3749
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3493,14 +3757,14 @@ function registerCouponTools(server2, client) {
|
|
|
3493
3757
|
"create_coupon",
|
|
3494
3758
|
"Create a new coupon/promo code.",
|
|
3495
3759
|
{
|
|
3496
|
-
locationId:
|
|
3497
|
-
name:
|
|
3498
|
-
code:
|
|
3499
|
-
type:
|
|
3500
|
-
amount:
|
|
3501
|
-
duration:
|
|
3502
|
-
durationInMonths:
|
|
3503
|
-
productIds:
|
|
3760
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3761
|
+
name: import_zod28.z.string().describe("Coupon name."),
|
|
3762
|
+
code: import_zod28.z.string().describe("Promo code string customers enter."),
|
|
3763
|
+
type: import_zod28.z.string().describe("Discount type: 'percentage' or 'fixed'."),
|
|
3764
|
+
amount: import_zod28.z.number().describe("Discount amount (percentage value or fixed dollar amount)."),
|
|
3765
|
+
duration: import_zod28.z.string().optional().describe("Duration: 'once', 'repeating', or 'forever'. Defaults to 'once'."),
|
|
3766
|
+
durationInMonths: import_zod28.z.number().optional().describe("Number of months if duration is 'repeating'."),
|
|
3767
|
+
productIds: import_zod28.z.array(import_zod28.z.string()).optional().describe("Product IDs this coupon applies to. If empty, applies to all.")
|
|
3504
3768
|
},
|
|
3505
3769
|
async ({ locationId: locationId2, name, code, type, amount, duration, durationInMonths, productIds }) => {
|
|
3506
3770
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3524,10 +3788,10 @@ function registerCouponTools(server2, client) {
|
|
|
3524
3788
|
"update_coupon",
|
|
3525
3789
|
"Update an existing coupon.",
|
|
3526
3790
|
{
|
|
3527
|
-
couponId:
|
|
3528
|
-
locationId:
|
|
3529
|
-
name:
|
|
3530
|
-
productIds:
|
|
3791
|
+
couponId: import_zod28.z.string().describe("The coupon ID to update."),
|
|
3792
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3793
|
+
name: import_zod28.z.string().optional().describe("Updated coupon name."),
|
|
3794
|
+
productIds: import_zod28.z.array(import_zod28.z.string()).optional().describe("Updated product IDs this coupon applies to.")
|
|
3531
3795
|
},
|
|
3532
3796
|
async ({ couponId, locationId: locationId2, name, productIds }) => {
|
|
3533
3797
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3545,8 +3809,8 @@ function registerCouponTools(server2, client) {
|
|
|
3545
3809
|
"delete_coupon",
|
|
3546
3810
|
"Delete a coupon by ID.",
|
|
3547
3811
|
{
|
|
3548
|
-
couponId:
|
|
3549
|
-
locationId:
|
|
3812
|
+
couponId: import_zod28.z.string().describe("The coupon ID to delete."),
|
|
3813
|
+
locationId: import_zod28.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3550
3814
|
},
|
|
3551
3815
|
async ({ couponId, locationId: locationId2 }) => {
|
|
3552
3816
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3558,14 +3822,14 @@ function registerCouponTools(server2, client) {
|
|
|
3558
3822
|
}
|
|
3559
3823
|
|
|
3560
3824
|
// src/tools/webhooks.ts
|
|
3561
|
-
var
|
|
3825
|
+
var import_zod29 = require("zod");
|
|
3562
3826
|
function registerWebhookTools(server2, client) {
|
|
3563
3827
|
safeTool(
|
|
3564
3828
|
server2,
|
|
3565
3829
|
"list_webhooks",
|
|
3566
3830
|
"List all webhooks configured in a GHL location.",
|
|
3567
3831
|
{
|
|
3568
|
-
locationId:
|
|
3832
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3569
3833
|
},
|
|
3570
3834
|
async ({ locationId: locationId2 }) => {
|
|
3571
3835
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3579,8 +3843,8 @@ function registerWebhookTools(server2, client) {
|
|
|
3579
3843
|
"get_webhook",
|
|
3580
3844
|
"Retrieve a single webhook by its ID.",
|
|
3581
3845
|
{
|
|
3582
|
-
webhookId:
|
|
3583
|
-
locationId:
|
|
3846
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to retrieve."),
|
|
3847
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3584
3848
|
},
|
|
3585
3849
|
async ({ webhookId, locationId: locationId2 }) => {
|
|
3586
3850
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3594,10 +3858,10 @@ function registerWebhookTools(server2, client) {
|
|
|
3594
3858
|
"create_webhook",
|
|
3595
3859
|
"Create a new webhook subscription for GHL events.",
|
|
3596
3860
|
{
|
|
3597
|
-
locationId:
|
|
3598
|
-
name:
|
|
3599
|
-
url:
|
|
3600
|
-
events:
|
|
3861
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3862
|
+
name: import_zod29.z.string().describe("Webhook name."),
|
|
3863
|
+
url: import_zod29.z.string().describe("The URL to POST events to."),
|
|
3864
|
+
events: import_zod29.z.array(import_zod29.z.string()).describe(
|
|
3601
3865
|
"List of event types to subscribe to (e.g. 'ContactCreate', 'AppointmentCreate', 'OpportunityStatusUpdate')."
|
|
3602
3866
|
)
|
|
3603
3867
|
},
|
|
@@ -3618,11 +3882,11 @@ function registerWebhookTools(server2, client) {
|
|
|
3618
3882
|
"update_webhook",
|
|
3619
3883
|
"Update an existing webhook (name, URL, or subscribed events).",
|
|
3620
3884
|
{
|
|
3621
|
-
webhookId:
|
|
3622
|
-
locationId:
|
|
3623
|
-
name:
|
|
3624
|
-
url:
|
|
3625
|
-
events:
|
|
3885
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to update."),
|
|
3886
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3887
|
+
name: import_zod29.z.string().optional().describe("Updated webhook name."),
|
|
3888
|
+
url: import_zod29.z.string().optional().describe("Updated webhook URL."),
|
|
3889
|
+
events: import_zod29.z.array(import_zod29.z.string()).optional().describe("Updated list of event types.")
|
|
3626
3890
|
},
|
|
3627
3891
|
async ({ webhookId, locationId: locationId2, name, url, events }) => {
|
|
3628
3892
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3638,8 +3902,8 @@ function registerWebhookTools(server2, client) {
|
|
|
3638
3902
|
"delete_webhook",
|
|
3639
3903
|
"Delete a webhook subscription by ID.",
|
|
3640
3904
|
{
|
|
3641
|
-
webhookId:
|
|
3642
|
-
locationId:
|
|
3905
|
+
webhookId: import_zod29.z.string().describe("The webhook ID to delete."),
|
|
3906
|
+
locationId: import_zod29.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3643
3907
|
},
|
|
3644
3908
|
async ({ webhookId, locationId: locationId2 }) => {
|
|
3645
3909
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3651,16 +3915,16 @@ function registerWebhookTools(server2, client) {
|
|
|
3651
3915
|
}
|
|
3652
3916
|
|
|
3653
3917
|
// src/tools/documents.ts
|
|
3654
|
-
var
|
|
3918
|
+
var import_zod30 = require("zod");
|
|
3655
3919
|
function registerDocumentTools(server2, client) {
|
|
3656
3920
|
safeTool(
|
|
3657
3921
|
server2,
|
|
3658
3922
|
"list_documents",
|
|
3659
3923
|
"List documents and contracts in a GHL location. Supports pagination.",
|
|
3660
3924
|
{
|
|
3661
|
-
locationId:
|
|
3662
|
-
limit:
|
|
3663
|
-
offset:
|
|
3925
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env."),
|
|
3926
|
+
limit: import_zod30.z.number().optional().describe("Maximum documents to return. Defaults to 20."),
|
|
3927
|
+
offset: import_zod30.z.number().optional().describe("Number of records to skip for pagination.")
|
|
3664
3928
|
},
|
|
3665
3929
|
async ({ locationId: locationId2, limit, offset }) => {
|
|
3666
3930
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3678,8 +3942,8 @@ function registerDocumentTools(server2, client) {
|
|
|
3678
3942
|
"get_document",
|
|
3679
3943
|
"Retrieve a single document or contract by its ID, including signature status.",
|
|
3680
3944
|
{
|
|
3681
|
-
documentId:
|
|
3682
|
-
locationId:
|
|
3945
|
+
documentId: import_zod30.z.string().describe("The document ID to retrieve."),
|
|
3946
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3683
3947
|
},
|
|
3684
3948
|
async ({ documentId, locationId: locationId2 }) => {
|
|
3685
3949
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3693,8 +3957,8 @@ function registerDocumentTools(server2, client) {
|
|
|
3693
3957
|
"delete_document",
|
|
3694
3958
|
"Delete a document or contract by ID.",
|
|
3695
3959
|
{
|
|
3696
|
-
documentId:
|
|
3697
|
-
locationId:
|
|
3960
|
+
documentId: import_zod30.z.string().describe("The document ID to delete."),
|
|
3961
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3698
3962
|
},
|
|
3699
3963
|
async ({ documentId, locationId: locationId2 }) => {
|
|
3700
3964
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3708,9 +3972,9 @@ function registerDocumentTools(server2, client) {
|
|
|
3708
3972
|
"send_document",
|
|
3709
3973
|
"Send a document/contract to a contact for electronic signature.",
|
|
3710
3974
|
{
|
|
3711
|
-
documentId:
|
|
3712
|
-
contactId:
|
|
3713
|
-
locationId:
|
|
3975
|
+
documentId: import_zod30.z.string().describe("The document ID to send."),
|
|
3976
|
+
contactId: import_zod30.z.string().describe("The contact ID to send the document to."),
|
|
3977
|
+
locationId: import_zod30.z.string().optional().describe("GHL Location ID. Optional if GHL_LOCATION_ID is set in env.")
|
|
3714
3978
|
},
|
|
3715
3979
|
async ({ documentId, contactId, locationId: locationId2 }) => {
|
|
3716
3980
|
const resolvedLocationId = client.resolveLocationId(locationId2);
|
|
@@ -3722,94 +3986,20 @@ function registerDocumentTools(server2, client) {
|
|
|
3722
3986
|
}
|
|
3723
3987
|
|
|
3724
3988
|
// src/tools/workflow-builder.ts
|
|
3725
|
-
var
|
|
3726
|
-
var ActionSchema =
|
|
3727
|
-
id:
|
|
3728
|
-
name:
|
|
3729
|
-
type:
|
|
3730
|
-
attributes:
|
|
3731
|
-
next:
|
|
3732
|
-
parent:
|
|
3733
|
-
parentKey:
|
|
3734
|
-
order:
|
|
3735
|
-
cat:
|
|
3736
|
-
nodeType:
|
|
3737
|
-
sibling:
|
|
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()
|
|
3989
|
+
var import_zod31 = require("zod");
|
|
3990
|
+
var ActionSchema = import_zod31.z.object({
|
|
3991
|
+
id: import_zod31.z.string().optional().describe("Action ID (auto-generated if omitted)."),
|
|
3992
|
+
name: import_zod31.z.string().describe("Display name for this action step."),
|
|
3993
|
+
type: import_zod31.z.string().describe("Action type."),
|
|
3994
|
+
attributes: import_zod31.z.record(import_zod31.z.unknown()).optional().describe("Action-specific configuration."),
|
|
3995
|
+
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."),
|
|
3996
|
+
parent: import_zod31.z.string().optional().describe("Branch parent node id."),
|
|
3997
|
+
parentKey: import_zod31.z.string().optional().describe("Previous action id or branch parent id."),
|
|
3998
|
+
order: import_zod31.z.number().optional().describe("Order within this chain or branch."),
|
|
3999
|
+
cat: import_zod31.z.string().optional().describe("Category for condition, transition, or multi-path nodes."),
|
|
4000
|
+
nodeType: import_zod31.z.string().optional().describe("Node type for if/else nodes."),
|
|
4001
|
+
sibling: import_zod31.z.array(import_zod31.z.string()).optional().describe("Sibling branch node IDs.")
|
|
3757
4002
|
}).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
4003
|
function linkBranchActions(actions, branchId, nextAfterMerge) {
|
|
3814
4004
|
const prepared = actions.map((action) => ({
|
|
3815
4005
|
...action,
|
|
@@ -3855,8 +4045,8 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3855
4045
|
"list_workflows_full",
|
|
3856
4046
|
"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
4047
|
{
|
|
3858
|
-
limit:
|
|
3859
|
-
skip:
|
|
4048
|
+
limit: import_zod31.z.number().optional().describe("Max workflows to return. Defaults to 50."),
|
|
4049
|
+
skip: import_zod31.z.number().optional().describe("Number of workflows to skip for pagination.")
|
|
3860
4050
|
},
|
|
3861
4051
|
async ({ limit, skip }) => {
|
|
3862
4052
|
try {
|
|
@@ -3871,7 +4061,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3871
4061
|
"get_workflow_full",
|
|
3872
4062
|
"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
4063
|
{
|
|
3874
|
-
workflowId:
|
|
4064
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to retrieve.")
|
|
3875
4065
|
},
|
|
3876
4066
|
async ({ workflowId }) => {
|
|
3877
4067
|
try {
|
|
@@ -3886,9 +4076,9 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3886
4076
|
"get_trigger_registry",
|
|
3887
4077
|
"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
4078
|
{
|
|
3889
|
-
companyId:
|
|
3890
|
-
limit:
|
|
3891
|
-
installedOnly:
|
|
4079
|
+
companyId: import_zod31.z.string().describe("Company ID for the location. Find it in any get_workflow_full response under the 'companyId' field."),
|
|
4080
|
+
limit: import_zod31.z.number().optional().describe("Max marketplace apps to return. Defaults to 200."),
|
|
4081
|
+
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
4082
|
},
|
|
3893
4083
|
async ({ companyId, limit, installedOnly }) => {
|
|
3894
4084
|
try {
|
|
@@ -3920,7 +4110,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3920
4110
|
"create_workflow",
|
|
3921
4111
|
"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
4112
|
{
|
|
3923
|
-
name:
|
|
4113
|
+
name: import_zod31.z.string().describe("Name for the new workflow.")
|
|
3924
4114
|
},
|
|
3925
4115
|
async ({ name }) => {
|
|
3926
4116
|
try {
|
|
@@ -3935,11 +4125,11 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3935
4125
|
"update_workflow_actions",
|
|
3936
4126
|
"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
4127
|
{
|
|
3938
|
-
workflowId:
|
|
3939
|
-
name:
|
|
3940
|
-
status:
|
|
3941
|
-
actions:
|
|
3942
|
-
triggers:
|
|
4128
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to update."),
|
|
4129
|
+
name: import_zod31.z.string().optional().describe("New workflow name."),
|
|
4130
|
+
status: import_zod31.z.string().optional().describe("New status: 'draft' or 'published'."),
|
|
4131
|
+
actions: import_zod31.z.array(ActionSchema).optional().describe("Array of workflow actions/steps. For linear flows, provide in order \u2014 chaining is automatic."),
|
|
4132
|
+
triggers: import_zod31.z.array(WorkflowTriggerSchema).optional().describe("Array of workflow triggers.")
|
|
3943
4133
|
},
|
|
3944
4134
|
async ({ workflowId, name, status, actions, triggers }) => {
|
|
3945
4135
|
try {
|
|
@@ -3983,12 +4173,12 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
3983
4173
|
"build_if_else_branch",
|
|
3984
4174
|
"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
4175
|
{
|
|
3986
|
-
field:
|
|
3987
|
-
operator:
|
|
3988
|
-
value:
|
|
3989
|
-
yes_actions:
|
|
3990
|
-
no_actions:
|
|
3991
|
-
next_after_merge:
|
|
4176
|
+
field: import_zod31.z.string().describe("Condition subtype, currently 'tags' for tag-based conditions."),
|
|
4177
|
+
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."),
|
|
4178
|
+
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."),
|
|
4179
|
+
yes_actions: import_zod31.z.array(ActionSchema).describe("Actions to run in the Yes branch."),
|
|
4180
|
+
no_actions: import_zod31.z.array(ActionSchema).describe("Actions to run in the No branch."),
|
|
4181
|
+
next_after_merge: import_zod31.z.string().optional().describe("Optional node id to link from each non-empty branch's final child.")
|
|
3992
4182
|
},
|
|
3993
4183
|
async ({ field, operator, value, yes_actions, no_actions, next_after_merge }) => {
|
|
3994
4184
|
try {
|
|
@@ -4098,8 +4288,8 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4098
4288
|
"delete_workflow_full",
|
|
4099
4289
|
"Permanently delete a workflow. IRREVERSIBLE.",
|
|
4100
4290
|
{
|
|
4101
|
-
workflowId:
|
|
4102
|
-
confirm:
|
|
4291
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to delete."),
|
|
4292
|
+
confirm: import_zod31.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4103
4293
|
},
|
|
4104
4294
|
async ({ workflowId }) => {
|
|
4105
4295
|
try {
|
|
@@ -4114,7 +4304,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4114
4304
|
"publish_workflow",
|
|
4115
4305
|
"Publish a draft workflow, making it active and processing contacts.",
|
|
4116
4306
|
{
|
|
4117
|
-
workflowId:
|
|
4307
|
+
workflowId: import_zod31.z.string().describe("The workflow ID to publish.")
|
|
4118
4308
|
},
|
|
4119
4309
|
async ({ workflowId }) => {
|
|
4120
4310
|
try {
|
|
@@ -4128,7 +4318,7 @@ function registerWorkflowBuilderTools(server2, client) {
|
|
|
4128
4318
|
}
|
|
4129
4319
|
|
|
4130
4320
|
// src/tools/funnel-builder.ts
|
|
4131
|
-
var
|
|
4321
|
+
var import_zod32 = require("zod");
|
|
4132
4322
|
function registerFunnelBuilderTools(server2, builderClient) {
|
|
4133
4323
|
const client = builderClient;
|
|
4134
4324
|
if (!client) return;
|
|
@@ -4169,7 +4359,7 @@ ${text2}`);
|
|
|
4169
4359
|
"list_funnels_full",
|
|
4170
4360
|
"List all funnels/websites with full details including steps, pages, and metadata. Uses the internal API for richer data than the public API.",
|
|
4171
4361
|
{
|
|
4172
|
-
limit:
|
|
4362
|
+
limit: import_zod32.z.number().optional().describe("Max funnels to return. Defaults to 50.")
|
|
4173
4363
|
},
|
|
4174
4364
|
async ({ limit }) => {
|
|
4175
4365
|
try {
|
|
@@ -4189,7 +4379,7 @@ ${text2}`);
|
|
|
4189
4379
|
"get_page_full",
|
|
4190
4380
|
"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
4381
|
{
|
|
4192
|
-
pageId:
|
|
4382
|
+
pageId: import_zod32.z.string().describe("The page ID to retrieve.")
|
|
4193
4383
|
},
|
|
4194
4384
|
async ({ pageId }) => {
|
|
4195
4385
|
try {
|
|
@@ -4209,7 +4399,7 @@ ${text2}`);
|
|
|
4209
4399
|
"get_page_content",
|
|
4210
4400
|
"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
4401
|
{
|
|
4212
|
-
pageDataDownloadUrl:
|
|
4402
|
+
pageDataDownloadUrl: import_zod32.z.string().describe("The pageDataDownloadUrl from get_page_full response.")
|
|
4213
4403
|
},
|
|
4214
4404
|
async ({ pageDataDownloadUrl }) => {
|
|
4215
4405
|
try {
|
|
@@ -4231,7 +4421,7 @@ ${text2}`);
|
|
|
4231
4421
|
"create_funnel",
|
|
4232
4422
|
"Create a new funnel/website. Starts empty \u2014 add steps and pages after creation.",
|
|
4233
4423
|
{
|
|
4234
|
-
name:
|
|
4424
|
+
name: import_zod32.z.string().describe("Name for the new funnel.")
|
|
4235
4425
|
},
|
|
4236
4426
|
async ({ name }) => {
|
|
4237
4427
|
try {
|
|
@@ -4253,9 +4443,9 @@ ${text2}`);
|
|
|
4253
4443
|
"update_funnel",
|
|
4254
4444
|
"Update a funnel's name, domain, or steps configuration.",
|
|
4255
4445
|
{
|
|
4256
|
-
funnelId:
|
|
4257
|
-
name:
|
|
4258
|
-
steps:
|
|
4446
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to update."),
|
|
4447
|
+
name: import_zod32.z.string().optional().describe("New funnel name."),
|
|
4448
|
+
steps: import_zod32.z.array(import_zod32.z.record(import_zod32.z.unknown())).optional().describe("Updated steps array with page references.")
|
|
4259
4449
|
},
|
|
4260
4450
|
async ({ funnelId, name, steps }) => {
|
|
4261
4451
|
try {
|
|
@@ -4275,8 +4465,8 @@ ${text2}`);
|
|
|
4275
4465
|
"delete_funnel",
|
|
4276
4466
|
"Permanently delete a funnel and all its pages. IRREVERSIBLE.",
|
|
4277
4467
|
{
|
|
4278
|
-
funnelId:
|
|
4279
|
-
confirm:
|
|
4468
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to delete."),
|
|
4469
|
+
confirm: import_zod32.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4280
4470
|
},
|
|
4281
4471
|
async ({ funnelId }) => {
|
|
4282
4472
|
try {
|
|
@@ -4293,9 +4483,9 @@ ${text2}`);
|
|
|
4293
4483
|
"create_funnel_page",
|
|
4294
4484
|
"Create a new page in a funnel. Returns the page ID which you can then update with content.",
|
|
4295
4485
|
{
|
|
4296
|
-
funnelId:
|
|
4297
|
-
name:
|
|
4298
|
-
url:
|
|
4486
|
+
funnelId: import_zod32.z.string().describe("The funnel ID to add the page to."),
|
|
4487
|
+
name: import_zod32.z.string().describe("Page name."),
|
|
4488
|
+
url: import_zod32.z.string().optional().describe("URL slug for the page (e.g. '/thank-you').")
|
|
4299
4489
|
},
|
|
4300
4490
|
async ({ funnelId, name, url }) => {
|
|
4301
4491
|
try {
|
|
@@ -4317,8 +4507,8 @@ ${text2}`);
|
|
|
4317
4507
|
"update_page_content",
|
|
4318
4508
|
"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
4509
|
{
|
|
4320
|
-
pageId:
|
|
4321
|
-
content:
|
|
4510
|
+
pageId: import_zod32.z.string().describe("The page ID to update."),
|
|
4511
|
+
content: import_zod32.z.record(import_zod32.z.unknown()).describe("The full page content JSON (sections, settings, general, pageStyles, trackingCode, popups, popupsList).")
|
|
4322
4512
|
},
|
|
4323
4513
|
async ({ pageId, content }) => {
|
|
4324
4514
|
try {
|
|
@@ -4338,8 +4528,8 @@ ${text2}`);
|
|
|
4338
4528
|
"delete_funnel_page",
|
|
4339
4529
|
"Permanently delete a page from a funnel. IRREVERSIBLE.",
|
|
4340
4530
|
{
|
|
4341
|
-
pageId:
|
|
4342
|
-
confirm:
|
|
4531
|
+
pageId: import_zod32.z.string().describe("The page ID to delete."),
|
|
4532
|
+
confirm: import_zod32.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4343
4533
|
},
|
|
4344
4534
|
async ({ pageId }) => {
|
|
4345
4535
|
try {
|
|
@@ -4355,7 +4545,7 @@ ${text2}`);
|
|
|
4355
4545
|
}
|
|
4356
4546
|
|
|
4357
4547
|
// src/tools/form-builder.ts
|
|
4358
|
-
var
|
|
4548
|
+
var import_zod33 = require("zod");
|
|
4359
4549
|
function registerFormBuilderTools(server2, builderClient) {
|
|
4360
4550
|
const client = builderClient;
|
|
4361
4551
|
if (!client) return;
|
|
@@ -4384,7 +4574,7 @@ ${text2}`);
|
|
|
4384
4574
|
"get_form_full",
|
|
4385
4575
|
"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
4576
|
{
|
|
4387
|
-
formId:
|
|
4577
|
+
formId: import_zod33.z.string().describe("The form ID to retrieve.")
|
|
4388
4578
|
},
|
|
4389
4579
|
async ({ formId }) => {
|
|
4390
4580
|
try {
|
|
@@ -4401,9 +4591,9 @@ ${text2}`);
|
|
|
4401
4591
|
"update_form",
|
|
4402
4592
|
"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
4593
|
{
|
|
4404
|
-
formId:
|
|
4405
|
-
formData:
|
|
4406
|
-
name:
|
|
4594
|
+
formId: import_zod33.z.string().describe("The form ID to update."),
|
|
4595
|
+
formData: import_zod33.z.record(import_zod33.z.unknown()).describe("The updated formData object containing form fields, settings, autoResponder config, etc."),
|
|
4596
|
+
name: import_zod33.z.string().optional().describe("Updated form name.")
|
|
4407
4597
|
},
|
|
4408
4598
|
async ({ formId, formData, name }) => {
|
|
4409
4599
|
try {
|
|
@@ -4422,7 +4612,7 @@ ${text2}`);
|
|
|
4422
4612
|
"create_form",
|
|
4423
4613
|
"Create a new form. Starts with a basic structure \u2014 use update_form to add fields and configure settings.",
|
|
4424
4614
|
{
|
|
4425
|
-
name:
|
|
4615
|
+
name: import_zod33.z.string().describe("Name for the new form.")
|
|
4426
4616
|
},
|
|
4427
4617
|
async ({ name }) => {
|
|
4428
4618
|
try {
|
|
@@ -4448,8 +4638,8 @@ ${text2}`);
|
|
|
4448
4638
|
"delete_form",
|
|
4449
4639
|
"Permanently delete a form. IRREVERSIBLE.",
|
|
4450
4640
|
{
|
|
4451
|
-
formId:
|
|
4452
|
-
confirm:
|
|
4641
|
+
formId: import_zod33.z.string().describe("The form ID to delete."),
|
|
4642
|
+
confirm: import_zod33.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4453
4643
|
},
|
|
4454
4644
|
async ({ formId }) => {
|
|
4455
4645
|
try {
|
|
@@ -4466,9 +4656,9 @@ ${text2}`);
|
|
|
4466
4656
|
"get_form_submissions_full",
|
|
4467
4657
|
"Get form submissions with full field data, contact info, and submission timestamps via the internal API. Offset-based pagination via skip/limit.",
|
|
4468
4658
|
{
|
|
4469
|
-
formId:
|
|
4470
|
-
limit:
|
|
4471
|
-
skip:
|
|
4659
|
+
formId: import_zod33.z.string().optional().describe("Filter by form ID. If omitted, returns all submissions."),
|
|
4660
|
+
limit: import_zod33.z.number().optional().describe("Max submissions to return. Defaults to 20."),
|
|
4661
|
+
skip: import_zod33.z.number().optional().describe("Number to skip for pagination.")
|
|
4472
4662
|
},
|
|
4473
4663
|
async ({ formId, limit, skip }) => {
|
|
4474
4664
|
try {
|
|
@@ -4487,7 +4677,7 @@ ${text2}`);
|
|
|
4487
4677
|
}
|
|
4488
4678
|
|
|
4489
4679
|
// src/tools/pipeline-builder.ts
|
|
4490
|
-
var
|
|
4680
|
+
var import_zod34 = require("zod");
|
|
4491
4681
|
function registerPipelineBuilderTools(server2, builderClient) {
|
|
4492
4682
|
const client = builderClient;
|
|
4493
4683
|
if (!client) return;
|
|
@@ -4532,7 +4722,7 @@ ${text2}`);
|
|
|
4532
4722
|
"get_pipeline_full",
|
|
4533
4723
|
"Get a single pipeline with complete stage configuration: IDs, names, positions, display settings.",
|
|
4534
4724
|
{
|
|
4535
|
-
pipelineId:
|
|
4725
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to retrieve.")
|
|
4536
4726
|
},
|
|
4537
4727
|
async ({ pipelineId }) => {
|
|
4538
4728
|
try {
|
|
@@ -4550,17 +4740,17 @@ ${text2}`);
|
|
|
4550
4740
|
"create_pipeline",
|
|
4551
4741
|
"Create a new pipeline with stages. Each stage needs a name and position (0-based).",
|
|
4552
4742
|
{
|
|
4553
|
-
name:
|
|
4554
|
-
stages:
|
|
4555
|
-
|
|
4556
|
-
name:
|
|
4557
|
-
position:
|
|
4558
|
-
showInFunnel:
|
|
4559
|
-
showInPieChart:
|
|
4743
|
+
name: import_zod34.z.string().describe("Pipeline name."),
|
|
4744
|
+
stages: import_zod34.z.array(
|
|
4745
|
+
import_zod34.z.object({
|
|
4746
|
+
name: import_zod34.z.string().describe("Stage name."),
|
|
4747
|
+
position: import_zod34.z.number().describe("Stage position (0-based)."),
|
|
4748
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show in funnel view. Defaults to true."),
|
|
4749
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show in pie chart. Defaults to true.")
|
|
4560
4750
|
})
|
|
4561
4751
|
).describe("Array of stages in order."),
|
|
4562
|
-
showInFunnel:
|
|
4563
|
-
showInPieChart:
|
|
4752
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show pipeline in funnel view. Defaults to true."),
|
|
4753
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show pipeline in pie chart. Defaults to true.")
|
|
4564
4754
|
},
|
|
4565
4755
|
async ({ name, stages, showInFunnel, showInPieChart }) => {
|
|
4566
4756
|
try {
|
|
@@ -4590,19 +4780,19 @@ ${text2}`);
|
|
|
4590
4780
|
"update_pipeline",
|
|
4591
4781
|
"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
4782
|
{
|
|
4593
|
-
pipelineId:
|
|
4594
|
-
name:
|
|
4595
|
-
stages:
|
|
4596
|
-
|
|
4597
|
-
id:
|
|
4598
|
-
name:
|
|
4599
|
-
position:
|
|
4600
|
-
showInFunnel:
|
|
4601
|
-
showInPieChart:
|
|
4783
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to update."),
|
|
4784
|
+
name: import_zod34.z.string().optional().describe("New pipeline name."),
|
|
4785
|
+
stages: import_zod34.z.array(
|
|
4786
|
+
import_zod34.z.object({
|
|
4787
|
+
id: import_zod34.z.string().optional().describe("Existing stage ID (omit for new stages)."),
|
|
4788
|
+
name: import_zod34.z.string().describe("Stage name."),
|
|
4789
|
+
position: import_zod34.z.number().describe("Stage position (0-based)."),
|
|
4790
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show in funnel view."),
|
|
4791
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show in pie chart.")
|
|
4602
4792
|
})
|
|
4603
4793
|
).optional().describe("Complete stages array. Stages not included will be removed."),
|
|
4604
|
-
showInFunnel:
|
|
4605
|
-
showInPieChart:
|
|
4794
|
+
showInFunnel: import_zod34.z.boolean().optional().describe("Show pipeline in funnel view."),
|
|
4795
|
+
showInPieChart: import_zod34.z.boolean().optional().describe("Show pipeline in pie chart.")
|
|
4606
4796
|
},
|
|
4607
4797
|
async ({ pipelineId, name, stages, showInFunnel, showInPieChart }) => {
|
|
4608
4798
|
try {
|
|
@@ -4625,8 +4815,8 @@ ${text2}`);
|
|
|
4625
4815
|
"delete_pipeline",
|
|
4626
4816
|
"Permanently delete a pipeline and all its stages. Opportunities become unassigned. IRREVERSIBLE.",
|
|
4627
4817
|
{
|
|
4628
|
-
pipelineId:
|
|
4629
|
-
confirm:
|
|
4818
|
+
pipelineId: import_zod34.z.string().describe("The pipeline ID to delete."),
|
|
4819
|
+
confirm: import_zod34.z.literal("DELETE").describe("Must pass 'DELETE' to confirm this destructive action.")
|
|
4630
4820
|
},
|
|
4631
4821
|
async ({ pipelineId }) => {
|
|
4632
4822
|
try {
|
|
@@ -4643,7 +4833,7 @@ ${text2}`);
|
|
|
4643
4833
|
}
|
|
4644
4834
|
|
|
4645
4835
|
// src/tools/location-switcher.ts
|
|
4646
|
-
var
|
|
4836
|
+
var import_zod35 = require("zod");
|
|
4647
4837
|
var switchChain = Promise.resolve();
|
|
4648
4838
|
function withSwitchLock(fn) {
|
|
4649
4839
|
const next = switchChain.then(fn, fn);
|
|
@@ -4692,7 +4882,7 @@ Token registry: ${registeredCount} location(s) registered${versionLine}`
|
|
|
4692
4882
|
"switch_location",
|
|
4693
4883
|
"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
4884
|
{
|
|
4695
|
-
locationId:
|
|
4885
|
+
locationId: import_zod35.z.string().describe("The Location ID to switch to.")
|
|
4696
4886
|
},
|
|
4697
4887
|
async ({ locationId: locationId2 }) => withSwitchLock(async () => {
|
|
4698
4888
|
const previousId = client.defaultLocationId;
|
|
@@ -4757,9 +4947,9 @@ Still on: ${previousId || "none"}${hint}` }],
|
|
|
4757
4947
|
"register_location",
|
|
4758
4948
|
"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
4949
|
{
|
|
4760
|
-
locationId:
|
|
4761
|
-
name:
|
|
4762
|
-
apiKey:
|
|
4950
|
+
locationId: import_zod35.z.string().describe("The GHL Location ID (from Settings > Business Profile)."),
|
|
4951
|
+
name: import_zod35.z.string().describe("A friendly name for this sub-account (e.g. 'PNTracker', 'Med Spa Template')."),
|
|
4952
|
+
apiKey: import_zod35.z.string().describe("The Private Integration API key for this sub-account (starts with 'pit-').")
|
|
4763
4953
|
},
|
|
4764
4954
|
async ({ locationId: locationId2, name, apiKey: apiKey2 }) => {
|
|
4765
4955
|
if (!registry2) {
|
|
@@ -4809,7 +4999,7 @@ The API key could not access location ${locationId2}. Make sure:
|
|
|
4809
4999
|
"unregister_location",
|
|
4810
5000
|
"Remove a GHL sub-account from the token registry.",
|
|
4811
5001
|
{
|
|
4812
|
-
locationId:
|
|
5002
|
+
locationId: import_zod35.z.string().describe("The Location ID to remove.")
|
|
4813
5003
|
},
|
|
4814
5004
|
async ({ locationId: locationId2 }) => {
|
|
4815
5005
|
if (!registry2) {
|
|
@@ -4868,8 +5058,8 @@ ${lines.join("\n")}
|
|
|
4868
5058
|
"list_available_locations",
|
|
4869
5059
|
"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
5060
|
{
|
|
4871
|
-
limit:
|
|
4872
|
-
skip:
|
|
5061
|
+
limit: import_zod35.z.number().optional().describe("Max locations to return. Defaults to 20."),
|
|
5062
|
+
skip: import_zod35.z.number().optional().describe("Number to skip for pagination.")
|
|
4873
5063
|
},
|
|
4874
5064
|
async ({ limit, skip }) => {
|
|
4875
5065
|
try {
|
|
@@ -4912,7 +5102,7 @@ ${lines.join("\n")}
|
|
|
4912
5102
|
}
|
|
4913
5103
|
|
|
4914
5104
|
// src/tools/bulk-operations.ts
|
|
4915
|
-
var
|
|
5105
|
+
var import_zod36 = require("zod");
|
|
4916
5106
|
function delay(ms) {
|
|
4917
5107
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
4918
5108
|
}
|
|
@@ -4924,8 +5114,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4924
5114
|
"bulk_add_tags",
|
|
4925
5115
|
"Add tags to multiple contacts at once. Rate-limited to avoid API throttling. Returns a summary of successes and failures.",
|
|
4926
5116
|
{
|
|
4927
|
-
contactIds:
|
|
4928
|
-
tags:
|
|
5117
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to tag."),
|
|
5118
|
+
tags: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one tag required.").describe("Tags to add to each contact.")
|
|
4929
5119
|
},
|
|
4930
5120
|
async ({ contactIds, tags }) => {
|
|
4931
5121
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4947,8 +5137,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4947
5137
|
"bulk_remove_tags",
|
|
4948
5138
|
"Remove tags from multiple contacts at once. Rate-limited.",
|
|
4949
5139
|
{
|
|
4950
|
-
contactIds:
|
|
4951
|
-
tags:
|
|
5140
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs."),
|
|
5141
|
+
tags: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one tag required.").describe("Tags to remove from each contact.")
|
|
4952
5142
|
},
|
|
4953
5143
|
async ({ contactIds, tags }) => {
|
|
4954
5144
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4969,8 +5159,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4969
5159
|
"bulk_update_contacts",
|
|
4970
5160
|
"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
5161
|
{
|
|
4972
|
-
contactIds:
|
|
4973
|
-
fields:
|
|
5162
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to update."),
|
|
5163
|
+
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
5164
|
},
|
|
4975
5165
|
async ({ contactIds, fields }) => {
|
|
4976
5166
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -4991,8 +5181,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
4991
5181
|
"bulk_add_to_workflow",
|
|
4992
5182
|
"Enroll multiple contacts into a workflow at once. Rate-limited.",
|
|
4993
5183
|
{
|
|
4994
|
-
contactIds:
|
|
4995
|
-
workflowId:
|
|
5184
|
+
contactIds: import_zod36.z.array(import_zod36.z.string()).min(1, "At least one contact ID required.").describe("Array of contact IDs to enroll."),
|
|
5185
|
+
workflowId: import_zod36.z.string().describe("The workflow ID to enroll contacts into.")
|
|
4996
5186
|
},
|
|
4997
5187
|
async ({ contactIds, workflowId }) => {
|
|
4998
5188
|
const results = { success: 0, failed: 0, errors: [] };
|
|
@@ -5013,8 +5203,8 @@ function registerBulkOperationTools(server2, client) {
|
|
|
5013
5203
|
"bulk_delete_contacts",
|
|
5014
5204
|
"Delete multiple contacts at once. IRREVERSIBLE. Rate-limited. Use with extreme caution.",
|
|
5015
5205
|
{
|
|
5016
|
-
contactIds:
|
|
5017
|
-
confirm:
|
|
5206
|
+
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."),
|
|
5207
|
+
confirm: import_zod36.z.literal("DELETE").describe("Must pass the string 'DELETE' to confirm. This is a safety check.")
|
|
5018
5208
|
},
|
|
5019
5209
|
async ({ contactIds, confirm }) => {
|
|
5020
5210
|
if (confirm !== "DELETE") {
|
|
@@ -5037,7 +5227,7 @@ function registerBulkOperationTools(server2, client) {
|
|
|
5037
5227
|
}
|
|
5038
5228
|
|
|
5039
5229
|
// src/tools/account-export.ts
|
|
5040
|
-
var
|
|
5230
|
+
var import_zod37 = require("zod");
|
|
5041
5231
|
function delay2(ms) {
|
|
5042
5232
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
5043
5233
|
}
|
|
@@ -5047,8 +5237,8 @@ function registerAccountExportTools(server2, client) {
|
|
|
5047
5237
|
"export_account",
|
|
5048
5238
|
"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
5239
|
{
|
|
5050
|
-
locationId:
|
|
5051
|
-
includeContacts:
|
|
5240
|
+
locationId: import_zod37.z.string().optional().describe("Location ID to export. Uses default if not specified."),
|
|
5241
|
+
includeContacts: import_zod37.z.boolean().optional().describe("Include contact list (first 100). Defaults to false for speed.")
|
|
5052
5242
|
},
|
|
5053
5243
|
async ({ locationId: locationId2, includeContacts }) => {
|
|
5054
5244
|
try {
|
|
@@ -5176,8 +5366,8 @@ function registerAccountExportTools(server2, client) {
|
|
|
5176
5366
|
"compare_locations",
|
|
5177
5367
|
"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
5368
|
{
|
|
5179
|
-
locationA:
|
|
5180
|
-
locationB:
|
|
5369
|
+
locationA: import_zod37.z.string().describe("First Location ID."),
|
|
5370
|
+
locationB: import_zod37.z.string().describe("Second Location ID.")
|
|
5181
5371
|
},
|
|
5182
5372
|
async ({ locationA, locationB }) => {
|
|
5183
5373
|
try {
|
|
@@ -5255,7 +5445,7 @@ function registerAccountExportTools(server2, client) {
|
|
|
5255
5445
|
}
|
|
5256
5446
|
|
|
5257
5447
|
// src/tools/workflow-cloner.ts
|
|
5258
|
-
var
|
|
5448
|
+
var import_zod38 = require("zod");
|
|
5259
5449
|
var crypto2 = __toESM(require("crypto"));
|
|
5260
5450
|
function registerWorkflowClonerTools(server2, builderClient) {
|
|
5261
5451
|
const client = builderClient;
|
|
@@ -5264,8 +5454,8 @@ function registerWorkflowClonerTools(server2, builderClient) {
|
|
|
5264
5454
|
"clone_workflow",
|
|
5265
5455
|
"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
5456
|
{
|
|
5267
|
-
sourceWorkflowId:
|
|
5268
|
-
newName:
|
|
5457
|
+
sourceWorkflowId: import_zod38.z.string().describe("The workflow ID to clone."),
|
|
5458
|
+
newName: import_zod38.z.string().describe("Name for the cloned workflow.")
|
|
5269
5459
|
},
|
|
5270
5460
|
async ({ sourceWorkflowId, newName }) => {
|
|
5271
5461
|
try {
|
|
@@ -5354,41 +5544,41 @@ function registerWorkflowClonerTools(server2, builderClient) {
|
|
|
5354
5544
|
}
|
|
5355
5545
|
|
|
5356
5546
|
// src/tools/template-deployer.ts
|
|
5357
|
-
var
|
|
5547
|
+
var import_zod39 = require("zod");
|
|
5358
5548
|
var fs3 = __toESM(require("fs"));
|
|
5359
5549
|
var path3 = __toESM(require("path"));
|
|
5360
5550
|
function delay3(ms) {
|
|
5361
5551
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
5362
5552
|
}
|
|
5363
|
-
var TemplateSchema =
|
|
5364
|
-
templateName:
|
|
5365
|
-
templateVersion:
|
|
5366
|
-
description:
|
|
5367
|
-
questionnaire:
|
|
5368
|
-
id:
|
|
5369
|
-
question:
|
|
5370
|
-
type:
|
|
5371
|
-
required:
|
|
5372
|
-
placeholder:
|
|
5553
|
+
var TemplateSchema = import_zod39.z.object({
|
|
5554
|
+
templateName: import_zod39.z.string(),
|
|
5555
|
+
templateVersion: import_zod39.z.string().optional(),
|
|
5556
|
+
description: import_zod39.z.string().optional().default(""),
|
|
5557
|
+
questionnaire: import_zod39.z.array(import_zod39.z.object({
|
|
5558
|
+
id: import_zod39.z.string(),
|
|
5559
|
+
question: import_zod39.z.string(),
|
|
5560
|
+
type: import_zod39.z.string(),
|
|
5561
|
+
required: import_zod39.z.boolean().optional(),
|
|
5562
|
+
placeholder: import_zod39.z.string().optional()
|
|
5373
5563
|
})).optional().default([]),
|
|
5374
|
-
location:
|
|
5375
|
-
tags:
|
|
5376
|
-
customFields:
|
|
5377
|
-
name:
|
|
5378
|
-
dataType:
|
|
5564
|
+
location: import_zod39.z.record(import_zod39.z.unknown()).optional(),
|
|
5565
|
+
tags: import_zod39.z.array(import_zod39.z.string()).optional(),
|
|
5566
|
+
customFields: import_zod39.z.array(import_zod39.z.object({
|
|
5567
|
+
name: import_zod39.z.string(),
|
|
5568
|
+
dataType: import_zod39.z.string()
|
|
5379
5569
|
})).optional(),
|
|
5380
|
-
pipelines:
|
|
5381
|
-
name:
|
|
5382
|
-
stages:
|
|
5570
|
+
pipelines: import_zod39.z.array(import_zod39.z.object({
|
|
5571
|
+
name: import_zod39.z.string(),
|
|
5572
|
+
stages: import_zod39.z.array(import_zod39.z.object({ position: import_zod39.z.number(), name: import_zod39.z.string() }))
|
|
5383
5573
|
})).optional(),
|
|
5384
|
-
workflows:
|
|
5385
|
-
name:
|
|
5386
|
-
condition:
|
|
5387
|
-
actions:
|
|
5574
|
+
workflows: import_zod39.z.array(import_zod39.z.object({
|
|
5575
|
+
name: import_zod39.z.string(),
|
|
5576
|
+
condition: import_zod39.z.string().optional(),
|
|
5577
|
+
actions: import_zod39.z.array(import_zod39.z.record(import_zod39.z.unknown())).optional().default([])
|
|
5388
5578
|
})).optional(),
|
|
5389
|
-
calendars:
|
|
5390
|
-
name:
|
|
5391
|
-
description:
|
|
5579
|
+
calendars: import_zod39.z.array(import_zod39.z.object({
|
|
5580
|
+
name: import_zod39.z.string(),
|
|
5581
|
+
description: import_zod39.z.string().optional()
|
|
5392
5582
|
})).optional()
|
|
5393
5583
|
});
|
|
5394
5584
|
function registerTemplateDeployerTools(server2, client) {
|
|
@@ -5459,7 +5649,7 @@ function registerTemplateDeployerTools(server2, client) {
|
|
|
5459
5649
|
"get_template_questionnaire",
|
|
5460
5650
|
"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
5651
|
{
|
|
5462
|
-
templateFile:
|
|
5652
|
+
templateFile: import_zod39.z.string().describe("Path to the template JSON file (from list_templates).")
|
|
5463
5653
|
},
|
|
5464
5654
|
async ({ templateFile }) => {
|
|
5465
5655
|
try {
|
|
@@ -5492,10 +5682,10 @@ function registerTemplateDeployerTools(server2, client) {
|
|
|
5492
5682
|
"deploy_template",
|
|
5493
5683
|
"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
5684
|
{
|
|
5495
|
-
templateFile:
|
|
5496
|
-
answers:
|
|
5497
|
-
locationId:
|
|
5498
|
-
dryRun:
|
|
5685
|
+
templateFile: import_zod39.z.string().describe("Path to the template JSON file."),
|
|
5686
|
+
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', ...})."),
|
|
5687
|
+
locationId: import_zod39.z.string().optional().describe("Location ID to deploy to. Uses default if not specified."),
|
|
5688
|
+
dryRun: import_zod39.z.boolean().optional().describe("If true, shows what would be created without actually creating anything. Defaults to false.")
|
|
5499
5689
|
},
|
|
5500
5690
|
async ({ templateFile, answers, locationId: locationId2, dryRun }) => {
|
|
5501
5691
|
try {
|
|
@@ -5789,18 +5979,18 @@ function registerAllTools(server2, client, registry2, mcpVersion) {
|
|
|
5789
5979
|
var fs4 = __toESM(require("fs"));
|
|
5790
5980
|
var path4 = __toESM(require("path"));
|
|
5791
5981
|
var os = __toESM(require("os"));
|
|
5792
|
-
var
|
|
5982
|
+
var import_zod40 = require("zod");
|
|
5793
5983
|
var APP_NAME = "elitedcs-ghl-mcp";
|
|
5794
|
-
var CredentialsSchema =
|
|
5795
|
-
license_key:
|
|
5796
|
-
email:
|
|
5797
|
-
verified_at:
|
|
5798
|
-
ghl_api_key:
|
|
5799
|
-
ghl_location_id:
|
|
5800
|
-
ghl_company_id:
|
|
5801
|
-
ghl_user_id:
|
|
5802
|
-
ghl_firebase_api_key:
|
|
5803
|
-
ghl_firebase_refresh_token:
|
|
5984
|
+
var CredentialsSchema = import_zod40.z.object({
|
|
5985
|
+
license_key: import_zod40.z.string().min(1),
|
|
5986
|
+
email: import_zod40.z.string().email(),
|
|
5987
|
+
verified_at: import_zod40.z.string().min(1),
|
|
5988
|
+
ghl_api_key: import_zod40.z.string().min(1),
|
|
5989
|
+
ghl_location_id: import_zod40.z.string().min(1),
|
|
5990
|
+
ghl_company_id: import_zod40.z.string().optional(),
|
|
5991
|
+
ghl_user_id: import_zod40.z.string().optional(),
|
|
5992
|
+
ghl_firebase_api_key: import_zod40.z.string().optional(),
|
|
5993
|
+
ghl_firebase_refresh_token: import_zod40.z.string().optional()
|
|
5804
5994
|
});
|
|
5805
5995
|
function appDataDir() {
|
|
5806
5996
|
const home = os.homedir();
|
|
@@ -5850,7 +6040,7 @@ function writeCredentials(creds) {
|
|
|
5850
6040
|
// src/setup-tool.ts
|
|
5851
6041
|
var os2 = __toESM(require("os"));
|
|
5852
6042
|
var crypto3 = __toESM(require("crypto"));
|
|
5853
|
-
var
|
|
6043
|
+
var import_zod41 = require("zod");
|
|
5854
6044
|
var LICENSE_API = "https://elitedcs.com/api/validate-license";
|
|
5855
6045
|
var GHL_API = "https://services.leadconnectorhq.com";
|
|
5856
6046
|
var FIREBASE_TOKEN_API = "https://securetoken.googleapis.com/v1/token";
|
|
@@ -5921,14 +6111,14 @@ function registerSetupTool(server2) {
|
|
|
5921
6111
|
"setup_ghl_mcp",
|
|
5922
6112
|
"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
6113
|
{
|
|
5924
|
-
email:
|
|
5925
|
-
license_key:
|
|
5926
|
-
ghl_api_key:
|
|
5927
|
-
ghl_location_id:
|
|
5928
|
-
ghl_company_id:
|
|
5929
|
-
ghl_user_id:
|
|
5930
|
-
ghl_firebase_api_key:
|
|
5931
|
-
ghl_firebase_refresh_token:
|
|
6114
|
+
email: import_zod41.z.string().email().describe("Email used at purchase."),
|
|
6115
|
+
license_key: import_zod41.z.string().min(20).describe("License key from your purchase email."),
|
|
6116
|
+
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."),
|
|
6117
|
+
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."),
|
|
6118
|
+
ghl_company_id: import_zod41.z.string().optional().describe("(Agency only) Company ID for multi-location access."),
|
|
6119
|
+
ghl_user_id: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase User ID. See README for browser capture instructions."),
|
|
6120
|
+
ghl_firebase_api_key: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase API Key starting with 'AIza'."),
|
|
6121
|
+
ghl_firebase_refresh_token: import_zod41.z.string().optional().describe("(Workflow Builder, optional) Firebase refresh token starting with 'AMf-'.")
|
|
5932
6122
|
},
|
|
5933
6123
|
async (args) => {
|
|
5934
6124
|
const lic = await validateLicense(args.email, args.license_key);
|