@vapi-ai/mcp-server 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -77,6 +77,40 @@ I'd like to speak with my ShopHelper assistant to talk about my recent order. Ca
77
77
  I need to schedule a call with Mary assistant for next Tuesday at 3:00 PM. My phone number is +1555123456.
78
78
  ```
79
79
 
80
+ **Example 3:** Make a call with dynamic variables
81
+
82
+ ```md
83
+ I want to call +1234567890 with my appointment reminder assistant. Use these details:
84
+ - Customer name: Sarah Johnson
85
+ - Appointment date: March 25th
86
+ - Appointment time: 2:30 PM
87
+ - Doctor name: Dr. Smith
88
+ ```
89
+
90
+ ## Using Variable Values in Assistant Prompts
91
+
92
+ The `create_call` action supports passing dynamic variables through `assistantOverrides.variableValues`. These variables can be used in your assistant's prompts using double curly braces: `{{variableName}}`.
93
+
94
+ ### Example Assistant Prompt with Variables
95
+
96
+ ```
97
+ Hello {{customerName}}, this is a reminder about your appointment on {{appointmentDate}} at {{appointmentTime}} with {{doctorName}}.
98
+ ```
99
+
100
+ ### Default Variables
101
+
102
+ The following variables are automatically available (no need to pass in variableValues):
103
+
104
+ - `{{now}}` - Current date and time (UTC)
105
+ - `{{date}}` - Current date (UTC)
106
+ - `{{time}}` - Current time (UTC)
107
+ - `{{month}}` - Current month (UTC)
108
+ - `{{day}}` - Current day of month (UTC)
109
+ - `{{year}}` - Current year (UTC)
110
+ - `{{customer.number}}` - Customer's phone number
111
+
112
+ For more details on default variables and advanced date/time formatting, see the [official Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables#default-variables).
113
+
80
114
  ## Remote MCP
81
115
 
82
116
  To connect to Vapi's MCP server remotely:
@@ -187,10 +221,12 @@ The Vapi MCP Server provides the following tools for integration:
187
221
  ### Call Tools
188
222
 
189
223
  - `list_calls`: Lists all Vapi calls
190
- - `create_call`: Creates an outbound call
224
+ - `create_call`: Creates an outbound call with support for:
225
+ - Immediate or scheduled calls
226
+ - Dynamic variable values through `assistantOverrides`
191
227
  - `get_call`: Gets details of a specific call
192
228
 
193
- > **Note:** The `create_call` action supports scheduling calls for immediate execution or for a future time.
229
+ > **Note:** The `create_call` action supports scheduling calls for immediate execution or for a future time. You can also pass dynamic variables using `assistantOverrides.variableValues` to personalize assistant messages.
194
230
 
195
231
  ### Phone Number Tools
196
232
 
@@ -371,27 +371,40 @@ export declare const CallInputSchema: z.ZodObject<{
371
371
  assistantId: z.ZodOptional<z.ZodString>;
372
372
  phoneNumberId: z.ZodOptional<z.ZodString>;
373
373
  customer: z.ZodOptional<z.ZodObject<{
374
- phoneNumber: z.ZodString;
374
+ number: z.ZodString;
375
375
  }, "strip", z.ZodTypeAny, {
376
- phoneNumber: string;
376
+ number: string;
377
377
  }, {
378
- phoneNumber: string;
378
+ number: string;
379
379
  }>>;
380
380
  scheduledAt: z.ZodOptional<z.ZodString>;
381
+ assistantOverrides: z.ZodOptional<z.ZodObject<{
382
+ variableValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
383
+ }, "strip", z.ZodTypeAny, {
384
+ variableValues?: Record<string, any> | undefined;
385
+ }, {
386
+ variableValues?: Record<string, any> | undefined;
387
+ }>>;
381
388
  }, "strip", z.ZodTypeAny, {
382
389
  assistantId?: string | undefined;
383
390
  phoneNumberId?: string | undefined;
384
391
  customer?: {
385
- phoneNumber: string;
392
+ number: string;
386
393
  } | undefined;
387
394
  scheduledAt?: string | undefined;
395
+ assistantOverrides?: {
396
+ variableValues?: Record<string, any> | undefined;
397
+ } | undefined;
388
398
  }, {
389
399
  assistantId?: string | undefined;
390
400
  phoneNumberId?: string | undefined;
391
401
  customer?: {
392
- phoneNumber: string;
402
+ number: string;
393
403
  } | undefined;
394
404
  scheduledAt?: string | undefined;
405
+ assistantOverrides?: {
406
+ variableValues?: Record<string, any> | undefined;
407
+ } | undefined;
395
408
  }>;
396
409
  export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
397
410
  id: z.ZodString;
@@ -403,11 +416,11 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
403
416
  assistantId: z.ZodOptional<z.ZodString>;
404
417
  phoneNumberId: z.ZodOptional<z.ZodString>;
405
418
  customer: z.ZodOptional<z.ZodObject<{
406
- phoneNumber: z.ZodString;
419
+ number: z.ZodString;
407
420
  }, "strip", z.ZodTypeAny, {
408
- phoneNumber: string;
421
+ number: string;
409
422
  }, {
410
- phoneNumber: string;
423
+ number: string;
411
424
  }>>;
412
425
  scheduledAt: z.ZodOptional<z.ZodString>;
413
426
  }>, "strip", z.ZodTypeAny, {
@@ -418,7 +431,7 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
418
431
  assistantId?: string | undefined;
419
432
  phoneNumberId?: string | undefined;
420
433
  customer?: {
421
- phoneNumber: string;
434
+ number: string;
422
435
  } | undefined;
423
436
  scheduledAt?: string | undefined;
424
437
  endedReason?: string | undefined;
@@ -430,7 +443,7 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
430
443
  assistantId?: string | undefined;
431
444
  phoneNumberId?: string | undefined;
432
445
  customer?: {
433
- phoneNumber: string;
446
+ number: string;
434
447
  } | undefined;
435
448
  scheduledAt?: string | undefined;
436
449
  endedReason?: string | undefined;
@@ -497,6 +510,772 @@ export declare const GetToolInputSchema: z.ZodObject<{
497
510
  }, {
498
511
  toolId: string;
499
512
  }>;
513
+ export declare const CreateToolInputSchema: z.ZodObject<z.objectUtil.extendShape<{
514
+ name: z.ZodOptional<z.ZodString>;
515
+ description: z.ZodOptional<z.ZodString>;
516
+ sms: z.ZodOptional<z.ZodObject<{
517
+ metadata: z.ZodObject<{
518
+ from: z.ZodString;
519
+ }, "strip", z.ZodTypeAny, {
520
+ from: string;
521
+ }, {
522
+ from: string;
523
+ }>;
524
+ }, "strip", z.ZodTypeAny, {
525
+ metadata: {
526
+ from: string;
527
+ };
528
+ }, {
529
+ metadata: {
530
+ from: string;
531
+ };
532
+ }>>;
533
+ transferCall: z.ZodOptional<z.ZodObject<{
534
+ destinations: z.ZodArray<z.ZodObject<{
535
+ type: z.ZodLiteral<"number">;
536
+ number: z.ZodString;
537
+ extension: z.ZodOptional<z.ZodString>;
538
+ callerId: z.ZodOptional<z.ZodString>;
539
+ description: z.ZodOptional<z.ZodString>;
540
+ }, "strip", z.ZodTypeAny, {
541
+ number: string;
542
+ type: "number";
543
+ extension?: string | undefined;
544
+ callerId?: string | undefined;
545
+ description?: string | undefined;
546
+ }, {
547
+ number: string;
548
+ type: "number";
549
+ extension?: string | undefined;
550
+ callerId?: string | undefined;
551
+ description?: string | undefined;
552
+ }>, "many">;
553
+ }, "strip", z.ZodTypeAny, {
554
+ destinations: {
555
+ number: string;
556
+ type: "number";
557
+ extension?: string | undefined;
558
+ callerId?: string | undefined;
559
+ description?: string | undefined;
560
+ }[];
561
+ }, {
562
+ destinations: {
563
+ number: string;
564
+ type: "number";
565
+ extension?: string | undefined;
566
+ callerId?: string | undefined;
567
+ description?: string | undefined;
568
+ }[];
569
+ }>>;
570
+ function: z.ZodOptional<z.ZodObject<{
571
+ parameters: z.ZodObject<{
572
+ type: z.ZodLiteral<"object">;
573
+ properties: z.ZodRecord<z.ZodString, z.ZodObject<{
574
+ type: z.ZodString;
575
+ description: z.ZodOptional<z.ZodString>;
576
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
577
+ items: z.ZodOptional<z.ZodAny>;
578
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
579
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ type: string;
582
+ description?: string | undefined;
583
+ enum?: string[] | undefined;
584
+ items?: any;
585
+ properties?: Record<string, any> | undefined;
586
+ required?: string[] | undefined;
587
+ }, {
588
+ type: string;
589
+ description?: string | undefined;
590
+ enum?: string[] | undefined;
591
+ items?: any;
592
+ properties?: Record<string, any> | undefined;
593
+ required?: string[] | undefined;
594
+ }>>;
595
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
596
+ }, "strip", z.ZodTypeAny, {
597
+ type: "object";
598
+ properties: Record<string, {
599
+ type: string;
600
+ description?: string | undefined;
601
+ enum?: string[] | undefined;
602
+ items?: any;
603
+ properties?: Record<string, any> | undefined;
604
+ required?: string[] | undefined;
605
+ }>;
606
+ required?: string[] | undefined;
607
+ }, {
608
+ type: "object";
609
+ properties: Record<string, {
610
+ type: string;
611
+ description?: string | undefined;
612
+ enum?: string[] | undefined;
613
+ items?: any;
614
+ properties?: Record<string, any> | undefined;
615
+ required?: string[] | undefined;
616
+ }>;
617
+ required?: string[] | undefined;
618
+ }>;
619
+ server: z.ZodObject<{
620
+ url: z.ZodString;
621
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
622
+ }, "strip", z.ZodTypeAny, {
623
+ url: string;
624
+ headers?: Record<string, string> | undefined;
625
+ }, {
626
+ url: string;
627
+ headers?: Record<string, string> | undefined;
628
+ }>;
629
+ }, "strip", z.ZodTypeAny, {
630
+ parameters: {
631
+ type: "object";
632
+ properties: Record<string, {
633
+ type: string;
634
+ description?: string | undefined;
635
+ enum?: string[] | undefined;
636
+ items?: any;
637
+ properties?: Record<string, any> | undefined;
638
+ required?: string[] | undefined;
639
+ }>;
640
+ required?: string[] | undefined;
641
+ };
642
+ server: {
643
+ url: string;
644
+ headers?: Record<string, string> | undefined;
645
+ };
646
+ }, {
647
+ parameters: {
648
+ type: "object";
649
+ properties: Record<string, {
650
+ type: string;
651
+ description?: string | undefined;
652
+ enum?: string[] | undefined;
653
+ items?: any;
654
+ properties?: Record<string, any> | undefined;
655
+ required?: string[] | undefined;
656
+ }>;
657
+ required?: string[] | undefined;
658
+ };
659
+ server: {
660
+ url: string;
661
+ headers?: Record<string, string> | undefined;
662
+ };
663
+ }>>;
664
+ apiRequest: z.ZodOptional<z.ZodObject<{
665
+ url: z.ZodString;
666
+ method: z.ZodDefault<z.ZodEnum<["GET", "POST"]>>;
667
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
668
+ body: z.ZodOptional<z.ZodObject<{
669
+ type: z.ZodLiteral<"object">;
670
+ properties: z.ZodRecord<z.ZodString, z.ZodObject<{
671
+ type: z.ZodString;
672
+ description: z.ZodOptional<z.ZodString>;
673
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
674
+ items: z.ZodOptional<z.ZodAny>;
675
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
676
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
677
+ }, "strip", z.ZodTypeAny, {
678
+ type: string;
679
+ description?: string | undefined;
680
+ enum?: string[] | undefined;
681
+ items?: any;
682
+ properties?: Record<string, any> | undefined;
683
+ required?: string[] | undefined;
684
+ }, {
685
+ type: string;
686
+ description?: string | undefined;
687
+ enum?: string[] | undefined;
688
+ items?: any;
689
+ properties?: Record<string, any> | undefined;
690
+ required?: string[] | undefined;
691
+ }>>;
692
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ type: "object";
695
+ properties: Record<string, {
696
+ type: string;
697
+ description?: string | undefined;
698
+ enum?: string[] | undefined;
699
+ items?: any;
700
+ properties?: Record<string, any> | undefined;
701
+ required?: string[] | undefined;
702
+ }>;
703
+ required?: string[] | undefined;
704
+ }, {
705
+ type: "object";
706
+ properties: Record<string, {
707
+ type: string;
708
+ description?: string | undefined;
709
+ enum?: string[] | undefined;
710
+ items?: any;
711
+ properties?: Record<string, any> | undefined;
712
+ required?: string[] | undefined;
713
+ }>;
714
+ required?: string[] | undefined;
715
+ }>>;
716
+ backoffPlan: z.ZodOptional<z.ZodObject<{
717
+ type: z.ZodDefault<z.ZodEnum<["fixed", "exponential"]>>;
718
+ maxRetries: z.ZodDefault<z.ZodNumber>;
719
+ baseDelaySeconds: z.ZodDefault<z.ZodNumber>;
720
+ }, "strip", z.ZodTypeAny, {
721
+ type: "fixed" | "exponential";
722
+ maxRetries: number;
723
+ baseDelaySeconds: number;
724
+ }, {
725
+ type?: "fixed" | "exponential" | undefined;
726
+ maxRetries?: number | undefined;
727
+ baseDelaySeconds?: number | undefined;
728
+ }>>;
729
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
730
+ }, "strip", z.ZodTypeAny, {
731
+ url: string;
732
+ method: "GET" | "POST";
733
+ timeoutSeconds: number;
734
+ headers?: Record<string, string> | undefined;
735
+ body?: {
736
+ type: "object";
737
+ properties: Record<string, {
738
+ type: string;
739
+ description?: string | undefined;
740
+ enum?: string[] | undefined;
741
+ items?: any;
742
+ properties?: Record<string, any> | undefined;
743
+ required?: string[] | undefined;
744
+ }>;
745
+ required?: string[] | undefined;
746
+ } | undefined;
747
+ backoffPlan?: {
748
+ type: "fixed" | "exponential";
749
+ maxRetries: number;
750
+ baseDelaySeconds: number;
751
+ } | undefined;
752
+ }, {
753
+ url: string;
754
+ headers?: Record<string, string> | undefined;
755
+ method?: "GET" | "POST" | undefined;
756
+ body?: {
757
+ type: "object";
758
+ properties: Record<string, {
759
+ type: string;
760
+ description?: string | undefined;
761
+ enum?: string[] | undefined;
762
+ items?: any;
763
+ properties?: Record<string, any> | undefined;
764
+ required?: string[] | undefined;
765
+ }>;
766
+ required?: string[] | undefined;
767
+ } | undefined;
768
+ backoffPlan?: {
769
+ type?: "fixed" | "exponential" | undefined;
770
+ maxRetries?: number | undefined;
771
+ baseDelaySeconds?: number | undefined;
772
+ } | undefined;
773
+ timeoutSeconds?: number | undefined;
774
+ }>>;
775
+ }, {
776
+ type: z.ZodEnum<["sms", "transferCall", "function", "apiRequest"]>;
777
+ }>, "strip", z.ZodTypeAny, {
778
+ type: "function" | "sms" | "transferCall" | "apiRequest";
779
+ function?: {
780
+ parameters: {
781
+ type: "object";
782
+ properties: Record<string, {
783
+ type: string;
784
+ description?: string | undefined;
785
+ enum?: string[] | undefined;
786
+ items?: any;
787
+ properties?: Record<string, any> | undefined;
788
+ required?: string[] | undefined;
789
+ }>;
790
+ required?: string[] | undefined;
791
+ };
792
+ server: {
793
+ url: string;
794
+ headers?: Record<string, string> | undefined;
795
+ };
796
+ } | undefined;
797
+ name?: string | undefined;
798
+ sms?: {
799
+ metadata: {
800
+ from: string;
801
+ };
802
+ } | undefined;
803
+ description?: string | undefined;
804
+ transferCall?: {
805
+ destinations: {
806
+ number: string;
807
+ type: "number";
808
+ extension?: string | undefined;
809
+ callerId?: string | undefined;
810
+ description?: string | undefined;
811
+ }[];
812
+ } | undefined;
813
+ apiRequest?: {
814
+ url: string;
815
+ method: "GET" | "POST";
816
+ timeoutSeconds: number;
817
+ headers?: Record<string, string> | undefined;
818
+ body?: {
819
+ type: "object";
820
+ properties: Record<string, {
821
+ type: string;
822
+ description?: string | undefined;
823
+ enum?: string[] | undefined;
824
+ items?: any;
825
+ properties?: Record<string, any> | undefined;
826
+ required?: string[] | undefined;
827
+ }>;
828
+ required?: string[] | undefined;
829
+ } | undefined;
830
+ backoffPlan?: {
831
+ type: "fixed" | "exponential";
832
+ maxRetries: number;
833
+ baseDelaySeconds: number;
834
+ } | undefined;
835
+ } | undefined;
836
+ }, {
837
+ type: "function" | "sms" | "transferCall" | "apiRequest";
838
+ function?: {
839
+ parameters: {
840
+ type: "object";
841
+ properties: Record<string, {
842
+ type: string;
843
+ description?: string | undefined;
844
+ enum?: string[] | undefined;
845
+ items?: any;
846
+ properties?: Record<string, any> | undefined;
847
+ required?: string[] | undefined;
848
+ }>;
849
+ required?: string[] | undefined;
850
+ };
851
+ server: {
852
+ url: string;
853
+ headers?: Record<string, string> | undefined;
854
+ };
855
+ } | undefined;
856
+ name?: string | undefined;
857
+ sms?: {
858
+ metadata: {
859
+ from: string;
860
+ };
861
+ } | undefined;
862
+ description?: string | undefined;
863
+ transferCall?: {
864
+ destinations: {
865
+ number: string;
866
+ type: "number";
867
+ extension?: string | undefined;
868
+ callerId?: string | undefined;
869
+ description?: string | undefined;
870
+ }[];
871
+ } | undefined;
872
+ apiRequest?: {
873
+ url: string;
874
+ headers?: Record<string, string> | undefined;
875
+ method?: "GET" | "POST" | undefined;
876
+ body?: {
877
+ type: "object";
878
+ properties: Record<string, {
879
+ type: string;
880
+ description?: string | undefined;
881
+ enum?: string[] | undefined;
882
+ items?: any;
883
+ properties?: Record<string, any> | undefined;
884
+ required?: string[] | undefined;
885
+ }>;
886
+ required?: string[] | undefined;
887
+ } | undefined;
888
+ backoffPlan?: {
889
+ type?: "fixed" | "exponential" | undefined;
890
+ maxRetries?: number | undefined;
891
+ baseDelaySeconds?: number | undefined;
892
+ } | undefined;
893
+ timeoutSeconds?: number | undefined;
894
+ } | undefined;
895
+ }>;
896
+ export declare const UpdateToolInputSchema: z.ZodObject<z.objectUtil.extendShape<{
897
+ name: z.ZodOptional<z.ZodString>;
898
+ description: z.ZodOptional<z.ZodString>;
899
+ sms: z.ZodOptional<z.ZodObject<{
900
+ metadata: z.ZodObject<{
901
+ from: z.ZodString;
902
+ }, "strip", z.ZodTypeAny, {
903
+ from: string;
904
+ }, {
905
+ from: string;
906
+ }>;
907
+ }, "strip", z.ZodTypeAny, {
908
+ metadata: {
909
+ from: string;
910
+ };
911
+ }, {
912
+ metadata: {
913
+ from: string;
914
+ };
915
+ }>>;
916
+ transferCall: z.ZodOptional<z.ZodObject<{
917
+ destinations: z.ZodArray<z.ZodObject<{
918
+ type: z.ZodLiteral<"number">;
919
+ number: z.ZodString;
920
+ extension: z.ZodOptional<z.ZodString>;
921
+ callerId: z.ZodOptional<z.ZodString>;
922
+ description: z.ZodOptional<z.ZodString>;
923
+ }, "strip", z.ZodTypeAny, {
924
+ number: string;
925
+ type: "number";
926
+ extension?: string | undefined;
927
+ callerId?: string | undefined;
928
+ description?: string | undefined;
929
+ }, {
930
+ number: string;
931
+ type: "number";
932
+ extension?: string | undefined;
933
+ callerId?: string | undefined;
934
+ description?: string | undefined;
935
+ }>, "many">;
936
+ }, "strip", z.ZodTypeAny, {
937
+ destinations: {
938
+ number: string;
939
+ type: "number";
940
+ extension?: string | undefined;
941
+ callerId?: string | undefined;
942
+ description?: string | undefined;
943
+ }[];
944
+ }, {
945
+ destinations: {
946
+ number: string;
947
+ type: "number";
948
+ extension?: string | undefined;
949
+ callerId?: string | undefined;
950
+ description?: string | undefined;
951
+ }[];
952
+ }>>;
953
+ function: z.ZodOptional<z.ZodObject<{
954
+ parameters: z.ZodObject<{
955
+ type: z.ZodLiteral<"object">;
956
+ properties: z.ZodRecord<z.ZodString, z.ZodObject<{
957
+ type: z.ZodString;
958
+ description: z.ZodOptional<z.ZodString>;
959
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
960
+ items: z.ZodOptional<z.ZodAny>;
961
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
962
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
963
+ }, "strip", z.ZodTypeAny, {
964
+ type: string;
965
+ description?: string | undefined;
966
+ enum?: string[] | undefined;
967
+ items?: any;
968
+ properties?: Record<string, any> | undefined;
969
+ required?: string[] | undefined;
970
+ }, {
971
+ type: string;
972
+ description?: string | undefined;
973
+ enum?: string[] | undefined;
974
+ items?: any;
975
+ properties?: Record<string, any> | undefined;
976
+ required?: string[] | undefined;
977
+ }>>;
978
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
979
+ }, "strip", z.ZodTypeAny, {
980
+ type: "object";
981
+ properties: Record<string, {
982
+ type: string;
983
+ description?: string | undefined;
984
+ enum?: string[] | undefined;
985
+ items?: any;
986
+ properties?: Record<string, any> | undefined;
987
+ required?: string[] | undefined;
988
+ }>;
989
+ required?: string[] | undefined;
990
+ }, {
991
+ type: "object";
992
+ properties: Record<string, {
993
+ type: string;
994
+ description?: string | undefined;
995
+ enum?: string[] | undefined;
996
+ items?: any;
997
+ properties?: Record<string, any> | undefined;
998
+ required?: string[] | undefined;
999
+ }>;
1000
+ required?: string[] | undefined;
1001
+ }>;
1002
+ server: z.ZodObject<{
1003
+ url: z.ZodString;
1004
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1005
+ }, "strip", z.ZodTypeAny, {
1006
+ url: string;
1007
+ headers?: Record<string, string> | undefined;
1008
+ }, {
1009
+ url: string;
1010
+ headers?: Record<string, string> | undefined;
1011
+ }>;
1012
+ }, "strip", z.ZodTypeAny, {
1013
+ parameters: {
1014
+ type: "object";
1015
+ properties: Record<string, {
1016
+ type: string;
1017
+ description?: string | undefined;
1018
+ enum?: string[] | undefined;
1019
+ items?: any;
1020
+ properties?: Record<string, any> | undefined;
1021
+ required?: string[] | undefined;
1022
+ }>;
1023
+ required?: string[] | undefined;
1024
+ };
1025
+ server: {
1026
+ url: string;
1027
+ headers?: Record<string, string> | undefined;
1028
+ };
1029
+ }, {
1030
+ parameters: {
1031
+ type: "object";
1032
+ properties: Record<string, {
1033
+ type: string;
1034
+ description?: string | undefined;
1035
+ enum?: string[] | undefined;
1036
+ items?: any;
1037
+ properties?: Record<string, any> | undefined;
1038
+ required?: string[] | undefined;
1039
+ }>;
1040
+ required?: string[] | undefined;
1041
+ };
1042
+ server: {
1043
+ url: string;
1044
+ headers?: Record<string, string> | undefined;
1045
+ };
1046
+ }>>;
1047
+ apiRequest: z.ZodOptional<z.ZodObject<{
1048
+ url: z.ZodString;
1049
+ method: z.ZodDefault<z.ZodEnum<["GET", "POST"]>>;
1050
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1051
+ body: z.ZodOptional<z.ZodObject<{
1052
+ type: z.ZodLiteral<"object">;
1053
+ properties: z.ZodRecord<z.ZodString, z.ZodObject<{
1054
+ type: z.ZodString;
1055
+ description: z.ZodOptional<z.ZodString>;
1056
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1057
+ items: z.ZodOptional<z.ZodAny>;
1058
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1059
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1060
+ }, "strip", z.ZodTypeAny, {
1061
+ type: string;
1062
+ description?: string | undefined;
1063
+ enum?: string[] | undefined;
1064
+ items?: any;
1065
+ properties?: Record<string, any> | undefined;
1066
+ required?: string[] | undefined;
1067
+ }, {
1068
+ type: string;
1069
+ description?: string | undefined;
1070
+ enum?: string[] | undefined;
1071
+ items?: any;
1072
+ properties?: Record<string, any> | undefined;
1073
+ required?: string[] | undefined;
1074
+ }>>;
1075
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1076
+ }, "strip", z.ZodTypeAny, {
1077
+ type: "object";
1078
+ properties: Record<string, {
1079
+ type: string;
1080
+ description?: string | undefined;
1081
+ enum?: string[] | undefined;
1082
+ items?: any;
1083
+ properties?: Record<string, any> | undefined;
1084
+ required?: string[] | undefined;
1085
+ }>;
1086
+ required?: string[] | undefined;
1087
+ }, {
1088
+ type: "object";
1089
+ properties: Record<string, {
1090
+ type: string;
1091
+ description?: string | undefined;
1092
+ enum?: string[] | undefined;
1093
+ items?: any;
1094
+ properties?: Record<string, any> | undefined;
1095
+ required?: string[] | undefined;
1096
+ }>;
1097
+ required?: string[] | undefined;
1098
+ }>>;
1099
+ backoffPlan: z.ZodOptional<z.ZodObject<{
1100
+ type: z.ZodDefault<z.ZodEnum<["fixed", "exponential"]>>;
1101
+ maxRetries: z.ZodDefault<z.ZodNumber>;
1102
+ baseDelaySeconds: z.ZodDefault<z.ZodNumber>;
1103
+ }, "strip", z.ZodTypeAny, {
1104
+ type: "fixed" | "exponential";
1105
+ maxRetries: number;
1106
+ baseDelaySeconds: number;
1107
+ }, {
1108
+ type?: "fixed" | "exponential" | undefined;
1109
+ maxRetries?: number | undefined;
1110
+ baseDelaySeconds?: number | undefined;
1111
+ }>>;
1112
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
1113
+ }, "strip", z.ZodTypeAny, {
1114
+ url: string;
1115
+ method: "GET" | "POST";
1116
+ timeoutSeconds: number;
1117
+ headers?: Record<string, string> | undefined;
1118
+ body?: {
1119
+ type: "object";
1120
+ properties: Record<string, {
1121
+ type: string;
1122
+ description?: string | undefined;
1123
+ enum?: string[] | undefined;
1124
+ items?: any;
1125
+ properties?: Record<string, any> | undefined;
1126
+ required?: string[] | undefined;
1127
+ }>;
1128
+ required?: string[] | undefined;
1129
+ } | undefined;
1130
+ backoffPlan?: {
1131
+ type: "fixed" | "exponential";
1132
+ maxRetries: number;
1133
+ baseDelaySeconds: number;
1134
+ } | undefined;
1135
+ }, {
1136
+ url: string;
1137
+ headers?: Record<string, string> | undefined;
1138
+ method?: "GET" | "POST" | undefined;
1139
+ body?: {
1140
+ type: "object";
1141
+ properties: Record<string, {
1142
+ type: string;
1143
+ description?: string | undefined;
1144
+ enum?: string[] | undefined;
1145
+ items?: any;
1146
+ properties?: Record<string, any> | undefined;
1147
+ required?: string[] | undefined;
1148
+ }>;
1149
+ required?: string[] | undefined;
1150
+ } | undefined;
1151
+ backoffPlan?: {
1152
+ type?: "fixed" | "exponential" | undefined;
1153
+ maxRetries?: number | undefined;
1154
+ baseDelaySeconds?: number | undefined;
1155
+ } | undefined;
1156
+ timeoutSeconds?: number | undefined;
1157
+ }>>;
1158
+ }, {
1159
+ toolId: z.ZodString;
1160
+ }>, "strip", z.ZodTypeAny, {
1161
+ toolId: string;
1162
+ function?: {
1163
+ parameters: {
1164
+ type: "object";
1165
+ properties: Record<string, {
1166
+ type: string;
1167
+ description?: string | undefined;
1168
+ enum?: string[] | undefined;
1169
+ items?: any;
1170
+ properties?: Record<string, any> | undefined;
1171
+ required?: string[] | undefined;
1172
+ }>;
1173
+ required?: string[] | undefined;
1174
+ };
1175
+ server: {
1176
+ url: string;
1177
+ headers?: Record<string, string> | undefined;
1178
+ };
1179
+ } | undefined;
1180
+ name?: string | undefined;
1181
+ sms?: {
1182
+ metadata: {
1183
+ from: string;
1184
+ };
1185
+ } | undefined;
1186
+ description?: string | undefined;
1187
+ transferCall?: {
1188
+ destinations: {
1189
+ number: string;
1190
+ type: "number";
1191
+ extension?: string | undefined;
1192
+ callerId?: string | undefined;
1193
+ description?: string | undefined;
1194
+ }[];
1195
+ } | undefined;
1196
+ apiRequest?: {
1197
+ url: string;
1198
+ method: "GET" | "POST";
1199
+ timeoutSeconds: number;
1200
+ headers?: Record<string, string> | undefined;
1201
+ body?: {
1202
+ type: "object";
1203
+ properties: Record<string, {
1204
+ type: string;
1205
+ description?: string | undefined;
1206
+ enum?: string[] | undefined;
1207
+ items?: any;
1208
+ properties?: Record<string, any> | undefined;
1209
+ required?: string[] | undefined;
1210
+ }>;
1211
+ required?: string[] | undefined;
1212
+ } | undefined;
1213
+ backoffPlan?: {
1214
+ type: "fixed" | "exponential";
1215
+ maxRetries: number;
1216
+ baseDelaySeconds: number;
1217
+ } | undefined;
1218
+ } | undefined;
1219
+ }, {
1220
+ toolId: string;
1221
+ function?: {
1222
+ parameters: {
1223
+ type: "object";
1224
+ properties: Record<string, {
1225
+ type: string;
1226
+ description?: string | undefined;
1227
+ enum?: string[] | undefined;
1228
+ items?: any;
1229
+ properties?: Record<string, any> | undefined;
1230
+ required?: string[] | undefined;
1231
+ }>;
1232
+ required?: string[] | undefined;
1233
+ };
1234
+ server: {
1235
+ url: string;
1236
+ headers?: Record<string, string> | undefined;
1237
+ };
1238
+ } | undefined;
1239
+ name?: string | undefined;
1240
+ sms?: {
1241
+ metadata: {
1242
+ from: string;
1243
+ };
1244
+ } | undefined;
1245
+ description?: string | undefined;
1246
+ transferCall?: {
1247
+ destinations: {
1248
+ number: string;
1249
+ type: "number";
1250
+ extension?: string | undefined;
1251
+ callerId?: string | undefined;
1252
+ description?: string | undefined;
1253
+ }[];
1254
+ } | undefined;
1255
+ apiRequest?: {
1256
+ url: string;
1257
+ headers?: Record<string, string> | undefined;
1258
+ method?: "GET" | "POST" | undefined;
1259
+ body?: {
1260
+ type: "object";
1261
+ properties: Record<string, {
1262
+ type: string;
1263
+ description?: string | undefined;
1264
+ enum?: string[] | undefined;
1265
+ items?: any;
1266
+ properties?: Record<string, any> | undefined;
1267
+ required?: string[] | undefined;
1268
+ }>;
1269
+ required?: string[] | undefined;
1270
+ } | undefined;
1271
+ backoffPlan?: {
1272
+ type?: "fixed" | "exponential" | undefined;
1273
+ maxRetries?: number | undefined;
1274
+ baseDelaySeconds?: number | undefined;
1275
+ } | undefined;
1276
+ timeoutSeconds?: number | undefined;
1277
+ } | undefined;
1278
+ }>;
500
1279
  export declare const ToolOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
501
1280
  id: z.ZodString;
502
1281
  createdAt: z.ZodString;
@@ -505,6 +1284,17 @@ export declare const ToolOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
505
1284
  type: z.ZodString;
506
1285
  name: z.ZodString;
507
1286
  description: z.ZodString;
1287
+ parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
1288
+ server: z.ZodObject<{
1289
+ url: z.ZodString;
1290
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1291
+ }, "strip", z.ZodTypeAny, {
1292
+ url: string;
1293
+ headers?: Record<string, string> | undefined;
1294
+ }, {
1295
+ url: string;
1296
+ headers?: Record<string, string> | undefined;
1297
+ }>;
508
1298
  }>, "strip", z.ZodTypeAny, {
509
1299
  type: string;
510
1300
  id: string;
@@ -512,6 +1302,11 @@ export declare const ToolOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
512
1302
  updatedAt: string;
513
1303
  name: string;
514
1304
  description: string;
1305
+ parameters: Record<string, any>;
1306
+ server: {
1307
+ url: string;
1308
+ headers?: Record<string, string> | undefined;
1309
+ };
515
1310
  }, {
516
1311
  type: string;
517
1312
  id: string;
@@ -519,6 +1314,11 @@ export declare const ToolOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
519
1314
  updatedAt: string;
520
1315
  name: string;
521
1316
  description: string;
1317
+ parameters: Record<string, any>;
1318
+ server: {
1319
+ url: string;
1320
+ headers?: Record<string, string> | undefined;
1321
+ };
522
1322
  }>;
523
1323
  export {};
524
1324
  //# s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;EAEhC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAC"}
@@ -233,7 +233,7 @@ export const CallInputSchema = z.object({
233
233
  .describe('ID of the phone number to use for the call'),
234
234
  customer: z
235
235
  .object({
236
- phoneNumber: z.string().describe('Customer phone number'),
236
+ number: z.string().describe('Customer phone number'),
237
237
  })
238
238
  .optional()
239
239
  .describe('Customer information'),
@@ -241,6 +241,15 @@ export const CallInputSchema = z.object({
241
241
  .string()
242
242
  .optional()
243
243
  .describe('ISO datetime string for when the call should be scheduled (e.g. "2025-03-25T22:39:27.771Z")'),
244
+ assistantOverrides: z
245
+ .object({
246
+ variableValues: z
247
+ .record(z.string(), z.any())
248
+ .optional()
249
+ .describe('Key-value pairs for dynamic variables to use in the assistant\'s prompts (e.g. {"name": "Joe", "age": "24"})'),
250
+ })
251
+ .optional()
252
+ .describe('Overrides for the assistant configuration'),
244
253
  });
245
254
  export const CallOutputSchema = BaseResponseSchema.extend({
246
255
  status: z.string(),
@@ -249,7 +258,7 @@ export const CallOutputSchema = BaseResponseSchema.extend({
249
258
  phoneNumberId: z.string().optional(),
250
259
  customer: z
251
260
  .object({
252
- phoneNumber: z.string(),
261
+ number: z.string(),
253
262
  })
254
263
  .optional(),
255
264
  scheduledAt: z.string().optional(),
@@ -276,10 +285,79 @@ export const PhoneNumberOutputSchema = BaseResponseSchema.extend({
276
285
  export const GetToolInputSchema = z.object({
277
286
  toolId: z.string().describe('ID of the tool to get'),
278
287
  });
288
+ const TransferCallDestinationSchema = z.object({
289
+ type: z.literal('number'),
290
+ number: z.string().describe('Phone number to transfer to (e.g., "+16054440129"). It can be any phone number in E.164 format.'),
291
+ extension: z.string().optional().describe('Extension number if applicable'),
292
+ callerId: z.string().optional().describe('Caller ID to use for the transfer'),
293
+ description: z.string().optional().describe('Description of the transfer destination'),
294
+ });
295
+ // Generic custom tool schemas
296
+ const JsonSchemaProperty = z.object({
297
+ type: z.string(),
298
+ description: z.string().optional(),
299
+ enum: z.array(z.string()).optional(),
300
+ items: z.any().optional(),
301
+ properties: z.record(z.any()).optional(),
302
+ required: z.array(z.string()).optional(),
303
+ });
304
+ const JsonSchema = z.object({
305
+ type: z.literal('object'),
306
+ properties: z.record(JsonSchemaProperty),
307
+ required: z.array(z.string()).optional(),
308
+ });
309
+ const ServerSchema = z.object({
310
+ url: z.string().url().describe('Server URL where the function will be called'),
311
+ headers: z.record(z.string()).optional().describe('Headers to send with the request'),
312
+ });
313
+ const BackoffPlanSchema = z.object({
314
+ type: z.enum(['fixed', 'exponential']).default('fixed'),
315
+ maxRetries: z.number().default(3).describe('Maximum number of retries'),
316
+ baseDelaySeconds: z.number().default(1).describe('Base delay between retries in seconds'),
317
+ });
318
+ // Base tool configuration schema (reusable for both create and update)
319
+ const BaseToolConfigSchema = z.object({
320
+ // Common fields for all tools
321
+ name: z.string().optional().describe('Name of the function/tool'),
322
+ description: z.string().optional().describe('Description of what the function/tool does'),
323
+ // SMS tool configuration
324
+ sms: z.object({
325
+ metadata: z.object({
326
+ from: z.string().describe('Phone number to send SMS from (e.g., "+15551234567"). It must be a twilio number in E.164 format.'),
327
+ }).describe('SMS configuration metadata'),
328
+ }).optional().describe('SMS tool configuration - to send text messages'),
329
+ // Transfer call tool configuration
330
+ transferCall: z.object({
331
+ destinations: z.array(TransferCallDestinationSchema).describe('Array of possible transfer destinations'),
332
+ }).optional().describe('Transfer call tool configuration - to transfer calls to destinations'),
333
+ // Function tool configuration (custom functions with parameters)
334
+ function: z.object({
335
+ parameters: JsonSchema.describe('JSON schema for function parameters'),
336
+ server: ServerSchema.describe('Server configuration with URL where the function will be called'),
337
+ }).optional().describe('Custom function tool configuration - for custom server-side functions'),
338
+ // API Request tool configuration
339
+ apiRequest: z.object({
340
+ url: z.string().url().describe('URL to make the API request to'),
341
+ method: z.enum(['GET', 'POST']).default('POST').describe('HTTP method for the API request'),
342
+ headers: z.record(z.string()).optional().describe('Headers to send with the request (key-value pairs)'),
343
+ body: JsonSchema.optional().describe('Body schema for the API request in JSON Schema format'),
344
+ backoffPlan: BackoffPlanSchema.optional().describe('Retry configuration for failed API requests'),
345
+ timeoutSeconds: z.number().default(20).describe('Request timeout in seconds'),
346
+ }).optional().describe('API Request tool configuration - for HTTP API integration'),
347
+ });
348
+ export const CreateToolInputSchema = BaseToolConfigSchema.extend({
349
+ type: z.enum(['sms', 'transferCall', 'function', 'apiRequest'])
350
+ .describe('Type of the tool to create'),
351
+ });
352
+ export const UpdateToolInputSchema = BaseToolConfigSchema.extend({
353
+ toolId: z.string().describe('ID of the tool to update'),
354
+ });
279
355
  export const ToolOutputSchema = BaseResponseSchema.extend({
280
356
  type: z
281
357
  .string()
282
358
  .describe('Type of the tool (dtmf, function, mcp, query, etc.)'),
283
359
  name: z.string().describe('Name of the tool'),
284
360
  description: z.string().describe('Description of the tool'),
361
+ parameters: z.record(z.any()).describe('Parameters of the tool'),
362
+ server: ServerSchema.describe('Server of the tool'),
285
363
  });
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/tools/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAQ,MAAM,qBAAqB,CAAC;AAMvD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,EACjB,YAAY,UAAU,SAqBvB,CAAC"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/tools/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAQ,MAAM,qBAAqB,CAAC;AAMvD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,EACjB,YAAY,UAAU,SA2CvB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { GetToolInputSchema } from '../schemas/index.js';
2
- import { transformToolOutput } from '../transformers/index.js';
1
+ import { GetToolInputSchema, CreateToolInputSchema, UpdateToolInputSchema } from '../schemas/index.js';
2
+ import { transformToolInput, transformUpdateToolInput, transformToolOutput } from '../transformers/index.js';
3
3
  import { createToolHandler } from './utils.js';
4
4
  export const registerToolTools = (server, vapiClient) => {
5
5
  server.tool('list_tools', 'Lists all Vapi tools', {}, createToolHandler(async () => {
@@ -10,4 +10,14 @@ export const registerToolTools = (server, vapiClient) => {
10
10
  const tool = await vapiClient.tools.get(data.toolId);
11
11
  return transformToolOutput(tool);
12
12
  }));
13
+ server.tool('create_tool', 'Creates a new Vapi tool', CreateToolInputSchema.shape, createToolHandler(async (data) => {
14
+ const createToolDto = transformToolInput(data);
15
+ const tool = await vapiClient.tools.create(createToolDto);
16
+ return transformToolOutput(tool);
17
+ }));
18
+ server.tool('update_tool', 'Updates an existing Vapi tool', UpdateToolInputSchema.shape, createToolHandler(async (data) => {
19
+ const updateToolDto = transformUpdateToolInput(data);
20
+ const tool = await vapiClient.tools.update(data.toolId, updateToolDto);
21
+ return transformToolOutput(tool);
22
+ }));
13
23
  };
@@ -1,11 +1,13 @@
1
1
  import { Vapi } from '@vapi-ai/server-sdk';
2
2
  import { z } from 'zod';
3
- import { CreateAssistantInputSchema, CallInputSchema, AssistantOutputSchema, CallOutputSchema, PhoneNumberOutputSchema, ToolOutputSchema, UpdateAssistantInputSchema } from '../schemas/index.js';
3
+ import { CreateAssistantInputSchema, CallInputSchema, AssistantOutputSchema, CallOutputSchema, PhoneNumberOutputSchema, ToolOutputSchema, UpdateAssistantInputSchema, CreateToolInputSchema, UpdateToolInputSchema } from '../schemas/index.js';
4
4
  export declare function transformAssistantInput(input: z.infer<typeof CreateAssistantInputSchema>): Vapi.CreateAssistantDto;
5
5
  export declare function transformUpdateAssistantInput(input: z.infer<typeof UpdateAssistantInputSchema>): Vapi.UpdateAssistantDto;
6
6
  export declare function transformAssistantOutput(assistant: Vapi.Assistant): z.infer<typeof AssistantOutputSchema>;
7
7
  export declare function transformCallInput(input: z.infer<typeof CallInputSchema>): Vapi.CreateCallDto;
8
8
  export declare function transformCallOutput(call: Vapi.Call): z.infer<typeof CallOutputSchema>;
9
9
  export declare function transformPhoneNumberOutput(phoneNumber: any): z.infer<typeof PhoneNumberOutputSchema>;
10
- export declare function transformToolOutput(tool: any): z.infer<typeof ToolOutputSchema>;
10
+ export declare function transformToolInput(input: z.infer<typeof CreateToolInputSchema>): any;
11
+ export declare function transformUpdateToolInput(input: z.infer<typeof UpdateToolInputSchema>): any;
12
+ export declare function transformToolOutput(tool: Vapi.ToolsGetResponse): z.infer<typeof ToolOutputSchema>;
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAI7B,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CA2CzB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CAiEzB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,IAAI,CAAC,SAAS,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAqBvC;AA2BD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACrC,IAAI,CAAC,aAAa,CAmBpB;AAED,wBAAgB,mBAA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ID,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,GAAG,GACf,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CASzC;AAID,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAC3C,GAAG,CA8DL;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAC3C,GAAG,CAiDL;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,gBAAgB,GAC1B,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAclC"}
@@ -141,7 +141,7 @@ export function transformCallInput(input) {
141
141
  ...(input.customer
142
142
  ? {
143
143
  customer: {
144
- number: input.customer.phoneNumber,
144
+ number: input.customer.number,
145
145
  },
146
146
  }
147
147
  : {}),
@@ -152,6 +152,11 @@ export function transformCallInput(input) {
152
152
  },
153
153
  }
154
154
  : {}),
155
+ ...(input.assistantOverrides
156
+ ? {
157
+ assistantOverrides: input.assistantOverrides,
158
+ }
159
+ : {}),
155
160
  };
156
161
  }
157
162
  export function transformCallOutput(call) {
@@ -165,7 +170,7 @@ export function transformCallOutput(call) {
165
170
  phoneNumberId: call.phoneNumberId,
166
171
  customer: call.customer
167
172
  ? {
168
- phoneNumber: call.customer.number || '',
173
+ number: call.customer.number || '',
169
174
  }
170
175
  : undefined,
171
176
  scheduledAt: call.schedulePlan?.earliestAt,
@@ -183,6 +188,115 @@ export function transformPhoneNumberOutput(phoneNumber) {
183
188
  };
184
189
  }
185
190
  // ===== Tool Transformers =====
191
+ export function transformToolInput(input) {
192
+ let toolDto = {
193
+ type: input.type,
194
+ };
195
+ // Add function definition if name and description are provided
196
+ if (input.name || input.description) {
197
+ toolDto.function = {
198
+ ...(input.name && { name: input.name }),
199
+ ...(input.description && { description: input.description }),
200
+ };
201
+ }
202
+ // Handle different tool types using the new nested structure
203
+ switch (input.type) {
204
+ case 'sms':
205
+ if (input.sms?.metadata) {
206
+ toolDto.metadata = input.sms.metadata;
207
+ }
208
+ break;
209
+ case 'transferCall':
210
+ if (input.transferCall?.destinations) {
211
+ toolDto.destinations = input.transferCall.destinations;
212
+ }
213
+ break;
214
+ case 'function':
215
+ if (input.function?.parameters && input.function?.server) {
216
+ // For function tools, add parameters to the existing function object
217
+ if (toolDto.function) {
218
+ toolDto.function.parameters = input.function.parameters;
219
+ }
220
+ else {
221
+ toolDto.function = {
222
+ parameters: input.function.parameters,
223
+ };
224
+ }
225
+ toolDto.server = {
226
+ url: input.function.server.url,
227
+ ...(input.function.server.headers && { headers: input.function.server.headers }),
228
+ };
229
+ }
230
+ break;
231
+ case 'apiRequest':
232
+ if (input.apiRequest?.url) {
233
+ toolDto.url = input.apiRequest.url;
234
+ toolDto.method = input.apiRequest.method || 'POST';
235
+ if (input.apiRequest.headers)
236
+ toolDto.headers = input.apiRequest.headers;
237
+ if (input.apiRequest.body)
238
+ toolDto.body = input.apiRequest.body;
239
+ if (input.apiRequest.backoffPlan)
240
+ toolDto.backoffPlan = input.apiRequest.backoffPlan;
241
+ if (input.apiRequest.timeoutSeconds)
242
+ toolDto.timeoutSeconds = input.apiRequest.timeoutSeconds;
243
+ }
244
+ break;
245
+ default:
246
+ throw new Error(`Unsupported tool type: ${input.type}`);
247
+ }
248
+ return toolDto;
249
+ }
250
+ export function transformUpdateToolInput(input) {
251
+ let updateDto = {};
252
+ // Add function definition if name and description are provided
253
+ if (input.name || input.description) {
254
+ updateDto.function = {
255
+ ...(input.name && { name: input.name }),
256
+ ...(input.description && { description: input.description }),
257
+ };
258
+ }
259
+ // Handle SMS tool configuration
260
+ if (input.sms?.metadata) {
261
+ updateDto.metadata = input.sms.metadata;
262
+ }
263
+ // Handle Transfer call tool configuration
264
+ if (input.transferCall?.destinations) {
265
+ updateDto.destinations = input.transferCall.destinations;
266
+ }
267
+ // Handle Function tool configuration
268
+ if (input.function?.parameters && input.function?.server) {
269
+ // For function tools, add parameters to the existing function object
270
+ if (updateDto.function) {
271
+ updateDto.function.parameters = input.function.parameters;
272
+ }
273
+ else {
274
+ updateDto.function = {
275
+ parameters: input.function.parameters,
276
+ };
277
+ }
278
+ updateDto.server = {
279
+ url: input.function.server.url,
280
+ ...(input.function.server.headers && { headers: input.function.server.headers }),
281
+ };
282
+ }
283
+ // Handle API Request tool configuration
284
+ if (input.apiRequest) {
285
+ if (input.apiRequest.url)
286
+ updateDto.url = input.apiRequest.url;
287
+ if (input.apiRequest.method)
288
+ updateDto.method = input.apiRequest.method;
289
+ if (input.apiRequest.headers)
290
+ updateDto.headers = input.apiRequest.headers;
291
+ if (input.apiRequest.body)
292
+ updateDto.body = input.apiRequest.body;
293
+ if (input.apiRequest.backoffPlan)
294
+ updateDto.backoffPlan = input.apiRequest.backoffPlan;
295
+ if (input.apiRequest.timeoutSeconds)
296
+ updateDto.timeoutSeconds = input.apiRequest.timeoutSeconds;
297
+ }
298
+ return updateDto;
299
+ }
186
300
  export function transformToolOutput(tool) {
187
301
  return {
188
302
  id: tool.id,
@@ -191,5 +305,10 @@ export function transformToolOutput(tool) {
191
305
  type: tool.type || '',
192
306
  name: tool.function?.name || '',
193
307
  description: tool.function?.description || '',
308
+ parameters: tool.function?.parameters || {},
309
+ server: {
310
+ url: tool.server?.url || '',
311
+ headers: tool.server?.headers || {},
312
+ }
194
313
  };
195
314
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vapi-ai/mcp-server",
3
3
  "description": "Vapi MCP Server",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
@@ -39,6 +39,7 @@
39
39
  "dev": "tsx watch src/index.ts",
40
40
  "dev:stdio-example": "tsx examples/stdio-client.ts",
41
41
  "dev:sse-example": "tsx examples/sse-client.ts",
42
+ "dev:shttp-example": "tsx examples/shttp-client.ts",
42
43
  "inspector": "mcp-inspector",
43
44
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
44
45
  "test:unit": "NODE_OPTIONS=--experimental-vm-modules jest src/tests/mcp-server-mock.test.ts",