@ktmcp/apidapp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1929 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ const API_SPEC = {
6
+ "openapi": "3.0.0",
7
+ "servers": [
8
+ {
9
+ "url": "https://ethereum.apidapp.com/1"
10
+ }
11
+ ],
12
+ "info": {
13
+ "contact": {
14
+ "x-twitter": "api_dapp"
15
+ },
16
+ "title": "ApiDapp",
17
+ "version": "2019-02-14T16:47:01Z",
18
+ "x-apisguru-categories": [
19
+ "financial"
20
+ ],
21
+ "x-logo": {
22
+ "url": "https://api.apis.guru/v2/cache/logo/https_i2_wp_com_apidapp_com_wp-content_uploads_2019_03_cropped-ApiDappIcon.svg"
23
+ },
24
+ "x-origin": [
25
+ {
26
+ "format": "openapi",
27
+ "url": "https://apidapp.s3.amazonaws.com/ApiDapp-Start-swagger-7/ApiDapp-Start-swagger+(7).json",
28
+ "version": "3.0"
29
+ }
30
+ ],
31
+ "x-providerName": "apidapp.com"
32
+ },
33
+ "paths": {
34
+ "/": {
35
+ "options": {
36
+ "responses": {
37
+ "200": {
38
+ "content": {
39
+ "application/json": {
40
+ "schema": {
41
+ "$ref": "#/components/schemas/Empty"
42
+ }
43
+ }
44
+ },
45
+ "description": "200 response",
46
+ "headers": {
47
+ "Access-Control-Allow-Headers": {
48
+ "schema": {
49
+ "type": "string"
50
+ }
51
+ },
52
+ "Access-Control-Allow-Methods": {
53
+ "schema": {
54
+ "type": "string"
55
+ }
56
+ },
57
+ "Access-Control-Allow-Origin": {
58
+ "schema": {
59
+ "type": "string"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "x-amazon-apigateway-any-method": {
67
+ "responses": {
68
+ "200": {
69
+ "content": {
70
+ "application/json": {
71
+ "schema": {
72
+ "$ref": "#/components/schemas/Empty"
73
+ }
74
+ }
75
+ },
76
+ "description": "200 response"
77
+ }
78
+ }
79
+ }
80
+ },
81
+ "/account": {
82
+ "options": {
83
+ "responses": {
84
+ "200": {
85
+ "content": {
86
+ "application/json": {
87
+ "schema": {
88
+ "$ref": "#/components/schemas/Empty"
89
+ }
90
+ }
91
+ },
92
+ "description": "200 response",
93
+ "headers": {
94
+ "Access-Control-Allow-Headers": {
95
+ "schema": {
96
+ "type": "string"
97
+ }
98
+ },
99
+ "Access-Control-Allow-Methods": {
100
+ "schema": {
101
+ "type": "string"
102
+ }
103
+ },
104
+ "Access-Control-Allow-Origin": {
105
+ "schema": {
106
+ "type": "string"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "post": {
114
+ "description": "Create new account",
115
+ "responses": {
116
+ "200": {
117
+ "content": {
118
+ "application/json": {
119
+ "schema": {
120
+ "$ref": "#/components/schemas/Empty"
121
+ }
122
+ }
123
+ },
124
+ "description": "200 response",
125
+ "headers": {
126
+ "Access-Control-Allow-Origin": {
127
+ "schema": {
128
+ "type": "string"
129
+ }
130
+ }
131
+ }
132
+ }
133
+ },
134
+ "security": [
135
+ {
136
+ "Key2": []
137
+ }
138
+ ]
139
+ }
140
+ },
141
+ "/account/{id}": {
142
+ "get": {
143
+ "description": "Get account balance",
144
+ "parameters": [
145
+ {
146
+ "in": "path",
147
+ "name": "id",
148
+ "required": true,
149
+ "schema": {
150
+ "type": "string"
151
+ }
152
+ }
153
+ ],
154
+ "responses": {
155
+ "200": {
156
+ "content": {
157
+ "application/json": {
158
+ "schema": {
159
+ "$ref": "#/components/schemas/Empty"
160
+ }
161
+ }
162
+ },
163
+ "description": "200 response",
164
+ "headers": {
165
+ "Access-Control-Allow-Origin": {
166
+ "schema": {
167
+ "type": "string"
168
+ }
169
+ }
170
+ }
171
+ }
172
+ },
173
+ "security": [
174
+ {
175
+ "Key2": []
176
+ }
177
+ ]
178
+ },
179
+ "options": {
180
+ "parameters": [
181
+ {
182
+ "description": "Automatically added",
183
+ "in": "path",
184
+ "name": "id",
185
+ "required": true,
186
+ "schema": {
187
+ "type": "string"
188
+ }
189
+ }
190
+ ],
191
+ "responses": {
192
+ "200": {
193
+ "content": {
194
+ "application/json": {
195
+ "schema": {
196
+ "$ref": "#/components/schemas/Empty"
197
+ }
198
+ }
199
+ },
200
+ "description": "200 response",
201
+ "headers": {
202
+ "Access-Control-Allow-Headers": {
203
+ "schema": {
204
+ "type": "string"
205
+ }
206
+ },
207
+ "Access-Control-Allow-Methods": {
208
+ "schema": {
209
+ "type": "string"
210
+ }
211
+ },
212
+ "Access-Control-Allow-Origin": {
213
+ "schema": {
214
+ "type": "string"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "/block": {
223
+ "get": {
224
+ "description": "Access detailed block information",
225
+ "responses": {
226
+ "200": {
227
+ "content": {
228
+ "application/json": {
229
+ "schema": {
230
+ "$ref": "#/components/schemas/Empty"
231
+ }
232
+ }
233
+ },
234
+ "description": "200 response",
235
+ "headers": {
236
+ "Access-Control-Allow-Origin": {
237
+ "schema": {
238
+ "type": "string"
239
+ }
240
+ }
241
+ }
242
+ }
243
+ },
244
+ "security": [
245
+ {
246
+ "Key2": []
247
+ }
248
+ ]
249
+ },
250
+ "options": {
251
+ "responses": {
252
+ "200": {
253
+ "content": {
254
+ "application/json": {
255
+ "schema": {
256
+ "$ref": "#/components/schemas/Empty"
257
+ }
258
+ }
259
+ },
260
+ "description": "200 response",
261
+ "headers": {
262
+ "Access-Control-Allow-Headers": {
263
+ "schema": {
264
+ "type": "string"
265
+ }
266
+ },
267
+ "Access-Control-Allow-Methods": {
268
+ "schema": {
269
+ "type": "string"
270
+ }
271
+ },
272
+ "Access-Control-Allow-Origin": {
273
+ "schema": {
274
+ "type": "string"
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "/block/{id}": {
283
+ "get": {
284
+ "description": "Get information about particular block",
285
+ "parameters": [
286
+ {
287
+ "in": "path",
288
+ "name": "id",
289
+ "required": true,
290
+ "schema": {
291
+ "type": "string"
292
+ }
293
+ }
294
+ ],
295
+ "responses": {
296
+ "200": {
297
+ "content": {
298
+ "application/json": {
299
+ "schema": {
300
+ "$ref": "#/components/schemas/Empty"
301
+ }
302
+ }
303
+ },
304
+ "description": "200 response",
305
+ "headers": {
306
+ "Access-Control-Allow-Origin": {
307
+ "schema": {
308
+ "type": "string"
309
+ }
310
+ }
311
+ }
312
+ }
313
+ },
314
+ "security": [
315
+ {
316
+ "Key2": []
317
+ }
318
+ ]
319
+ },
320
+ "options": {
321
+ "parameters": [
322
+ {
323
+ "description": "Automatically added",
324
+ "in": "path",
325
+ "name": "id",
326
+ "required": true,
327
+ "schema": {
328
+ "type": "string"
329
+ }
330
+ }
331
+ ],
332
+ "responses": {
333
+ "200": {
334
+ "content": {
335
+ "application/json": {
336
+ "schema": {
337
+ "$ref": "#/components/schemas/Empty"
338
+ }
339
+ }
340
+ },
341
+ "description": "200 response",
342
+ "headers": {
343
+ "Access-Control-Allow-Headers": {
344
+ "schema": {
345
+ "type": "string"
346
+ }
347
+ },
348
+ "Access-Control-Allow-Methods": {
349
+ "schema": {
350
+ "type": "string"
351
+ }
352
+ },
353
+ "Access-Control-Allow-Origin": {
354
+ "schema": {
355
+ "type": "string"
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "/block/{id}/transaction": {
364
+ "get": {
365
+ "description": "Get transaction count within block",
366
+ "parameters": [
367
+ {
368
+ "in": "path",
369
+ "name": "id",
370
+ "required": true,
371
+ "schema": {
372
+ "type": "string"
373
+ }
374
+ }
375
+ ],
376
+ "responses": {
377
+ "200": {
378
+ "content": {
379
+ "application/json": {
380
+ "schema": {
381
+ "$ref": "#/components/schemas/Empty"
382
+ }
383
+ }
384
+ },
385
+ "description": "200 response",
386
+ "headers": {
387
+ "Access-Control-Allow-Origin": {
388
+ "schema": {
389
+ "type": "string"
390
+ }
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "security": [
396
+ {
397
+ "Key2": []
398
+ }
399
+ ]
400
+ },
401
+ "options": {
402
+ "parameters": [
403
+ {
404
+ "description": "Automatically added",
405
+ "in": "path",
406
+ "name": "id",
407
+ "required": true,
408
+ "schema": {
409
+ "type": "string"
410
+ }
411
+ }
412
+ ],
413
+ "responses": {
414
+ "200": {
415
+ "content": {
416
+ "application/json": {
417
+ "schema": {
418
+ "$ref": "#/components/schemas/Empty"
419
+ }
420
+ }
421
+ },
422
+ "description": "200 response",
423
+ "headers": {
424
+ "Access-Control-Allow-Headers": {
425
+ "schema": {
426
+ "type": "string"
427
+ }
428
+ },
429
+ "Access-Control-Allow-Methods": {
430
+ "schema": {
431
+ "type": "string"
432
+ }
433
+ },
434
+ "Access-Control-Allow-Origin": {
435
+ "schema": {
436
+ "type": "string"
437
+ }
438
+ }
439
+ }
440
+ }
441
+ }
442
+ }
443
+ },
444
+ "/block/{id}/transaction/{index}": {
445
+ "get": {
446
+ "description": "Get information about particular transaction within block",
447
+ "parameters": [
448
+ {
449
+ "in": "path",
450
+ "name": "index",
451
+ "required": true,
452
+ "schema": {
453
+ "type": "string"
454
+ }
455
+ },
456
+ {
457
+ "in": "path",
458
+ "name": "id",
459
+ "required": true,
460
+ "schema": {
461
+ "type": "string"
462
+ }
463
+ }
464
+ ],
465
+ "responses": {
466
+ "200": {
467
+ "content": {
468
+ "application/json": {
469
+ "schema": {
470
+ "$ref": "#/components/schemas/Empty"
471
+ }
472
+ }
473
+ },
474
+ "description": "200 response",
475
+ "headers": {
476
+ "Access-Control-Allow-Origin": {
477
+ "schema": {
478
+ "type": "string"
479
+ }
480
+ }
481
+ }
482
+ }
483
+ },
484
+ "security": [
485
+ {
486
+ "Key2": []
487
+ }
488
+ ]
489
+ },
490
+ "options": {
491
+ "parameters": [
492
+ {
493
+ "description": "Automatically added",
494
+ "in": "path",
495
+ "name": "id",
496
+ "required": true,
497
+ "schema": {
498
+ "type": "string"
499
+ }
500
+ },
501
+ {
502
+ "description": "Automatically added",
503
+ "in": "path",
504
+ "name": "index",
505
+ "required": true,
506
+ "schema": {
507
+ "type": "string"
508
+ }
509
+ }
510
+ ],
511
+ "responses": {
512
+ "200": {
513
+ "content": {
514
+ "application/json": {
515
+ "schema": {
516
+ "$ref": "#/components/schemas/Empty"
517
+ }
518
+ }
519
+ },
520
+ "description": "200 response",
521
+ "headers": {
522
+ "Access-Control-Allow-Headers": {
523
+ "schema": {
524
+ "type": "string"
525
+ }
526
+ },
527
+ "Access-Control-Allow-Methods": {
528
+ "schema": {
529
+ "type": "string"
530
+ }
531
+ },
532
+ "Access-Control-Allow-Origin": {
533
+ "schema": {
534
+ "type": "string"
535
+ }
536
+ }
537
+ }
538
+ }
539
+ }
540
+ }
541
+ },
542
+ "/blockchain": {
543
+ "get": {
544
+ "description": "Get a list of supported blockchains",
545
+ "responses": {
546
+ "200": {
547
+ "content": {
548
+ "application/json": {
549
+ "schema": {
550
+ "$ref": "#/components/schemas/Empty"
551
+ }
552
+ }
553
+ },
554
+ "description": "200 response",
555
+ "headers": {
556
+ "Access-Control-Allow-Origin": {
557
+ "schema": {
558
+ "type": "string"
559
+ }
560
+ }
561
+ }
562
+ }
563
+ },
564
+ "security": [
565
+ {
566
+ "Key2": []
567
+ }
568
+ ]
569
+ },
570
+ "options": {
571
+ "responses": {
572
+ "200": {
573
+ "content": {
574
+ "application/json": {
575
+ "schema": {
576
+ "$ref": "#/components/schemas/Empty"
577
+ }
578
+ }
579
+ },
580
+ "description": "200 response",
581
+ "headers": {
582
+ "Access-Control-Allow-Headers": {
583
+ "schema": {
584
+ "type": "string"
585
+ }
586
+ },
587
+ "Access-Control-Allow-Methods": {
588
+ "schema": {
589
+ "type": "string"
590
+ }
591
+ },
592
+ "Access-Control-Allow-Origin": {
593
+ "schema": {
594
+ "type": "string"
595
+ }
596
+ }
597
+ }
598
+ }
599
+ }
600
+ }
601
+ },
602
+ "/blockchain/{id}": {
603
+ "get": {
604
+ "description": "Get information about blockchain woth given id",
605
+ "parameters": [
606
+ {
607
+ "in": "path",
608
+ "name": "id",
609
+ "required": true,
610
+ "schema": {
611
+ "type": "string"
612
+ }
613
+ }
614
+ ],
615
+ "responses": {
616
+ "200": {
617
+ "content": {
618
+ "application/json": {
619
+ "schema": {
620
+ "$ref": "#/components/schemas/Empty"
621
+ }
622
+ }
623
+ },
624
+ "description": "200 response",
625
+ "headers": {
626
+ "Access-Control-Allow-Origin": {
627
+ "schema": {
628
+ "type": "string"
629
+ }
630
+ }
631
+ }
632
+ }
633
+ },
634
+ "security": [
635
+ {
636
+ "Key2": []
637
+ }
638
+ ]
639
+ },
640
+ "options": {
641
+ "parameters": [
642
+ {
643
+ "description": "Automatically added",
644
+ "in": "path",
645
+ "name": "id",
646
+ "required": true,
647
+ "schema": {
648
+ "type": "string"
649
+ }
650
+ }
651
+ ],
652
+ "responses": {
653
+ "200": {
654
+ "content": {
655
+ "application/json": {
656
+ "schema": {
657
+ "$ref": "#/components/schemas/Empty"
658
+ }
659
+ }
660
+ },
661
+ "description": "200 response",
662
+ "headers": {
663
+ "Access-Control-Allow-Headers": {
664
+ "schema": {
665
+ "type": "string"
666
+ }
667
+ },
668
+ "Access-Control-Allow-Methods": {
669
+ "schema": {
670
+ "type": "string"
671
+ }
672
+ },
673
+ "Access-Control-Allow-Origin": {
674
+ "schema": {
675
+ "type": "string"
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+ }
682
+ },
683
+ "/contract": {
684
+ "options": {
685
+ "responses": {
686
+ "200": {
687
+ "content": {
688
+ "application/json": {
689
+ "schema": {
690
+ "$ref": "#/components/schemas/Empty"
691
+ }
692
+ }
693
+ },
694
+ "description": "200 response",
695
+ "headers": {
696
+ "Access-Control-Allow-Headers": {
697
+ "schema": {
698
+ "type": "string"
699
+ }
700
+ },
701
+ "Access-Control-Allow-Methods": {
702
+ "schema": {
703
+ "type": "string"
704
+ }
705
+ },
706
+ "Access-Control-Allow-Origin": {
707
+ "schema": {
708
+ "type": "string"
709
+ }
710
+ }
711
+ }
712
+ }
713
+ }
714
+ },
715
+ "post": {
716
+ "description": "Create a new smart contract",
717
+ "responses": {
718
+ "200": {
719
+ "content": {
720
+ "application/json": {
721
+ "schema": {
722
+ "$ref": "#/components/schemas/Empty"
723
+ }
724
+ }
725
+ },
726
+ "description": "200 response"
727
+ }
728
+ }
729
+ }
730
+ },
731
+ "/contract/{id}": {
732
+ "get": {
733
+ "description": "Get contract balance",
734
+ "parameters": [
735
+ {
736
+ "in": "path",
737
+ "name": "id",
738
+ "required": true,
739
+ "schema": {
740
+ "type": "string"
741
+ }
742
+ }
743
+ ],
744
+ "responses": {
745
+ "200": {
746
+ "content": {
747
+ "application/json": {
748
+ "schema": {
749
+ "$ref": "#/components/schemas/Empty"
750
+ }
751
+ }
752
+ },
753
+ "description": "200 response",
754
+ "headers": {
755
+ "Access-Control-Allow-Origin": {
756
+ "schema": {
757
+ "type": "string"
758
+ }
759
+ }
760
+ }
761
+ }
762
+ },
763
+ "security": [
764
+ {
765
+ "Key2": []
766
+ }
767
+ ]
768
+ },
769
+ "options": {
770
+ "parameters": [
771
+ {
772
+ "description": "Automatically added",
773
+ "in": "path",
774
+ "name": "id",
775
+ "required": true,
776
+ "schema": {
777
+ "type": "string"
778
+ }
779
+ }
780
+ ],
781
+ "responses": {
782
+ "200": {
783
+ "content": {
784
+ "application/json": {
785
+ "schema": {
786
+ "$ref": "#/components/schemas/Empty"
787
+ }
788
+ }
789
+ },
790
+ "description": "200 response",
791
+ "headers": {
792
+ "Access-Control-Allow-Headers": {
793
+ "schema": {
794
+ "type": "string"
795
+ }
796
+ },
797
+ "Access-Control-Allow-Methods": {
798
+ "schema": {
799
+ "type": "string"
800
+ }
801
+ },
802
+ "Access-Control-Allow-Origin": {
803
+ "schema": {
804
+ "type": "string"
805
+ }
806
+ }
807
+ }
808
+ }
809
+ }
810
+ },
811
+ "post": {
812
+ "description": "Call the contract",
813
+ "parameters": [
814
+ {
815
+ "in": "path",
816
+ "name": "id",
817
+ "required": true,
818
+ "schema": {
819
+ "type": "string"
820
+ }
821
+ }
822
+ ],
823
+ "responses": {
824
+ "200": {
825
+ "content": {
826
+ "application/json": {
827
+ "schema": {
828
+ "$ref": "#/components/schemas/Empty"
829
+ }
830
+ }
831
+ },
832
+ "description": "200 response",
833
+ "headers": {
834
+ "Access-Control-Allow-Origin": {
835
+ "schema": {
836
+ "type": "string"
837
+ }
838
+ }
839
+ }
840
+ }
841
+ },
842
+ "security": [
843
+ {
844
+ "Key2": []
845
+ }
846
+ ]
847
+ }
848
+ },
849
+ "/echo": {
850
+ "options": {
851
+ "responses": {
852
+ "200": {
853
+ "content": {
854
+ "application/json": {
855
+ "schema": {
856
+ "$ref": "#/components/schemas/Empty"
857
+ }
858
+ }
859
+ },
860
+ "description": "200 response",
861
+ "headers": {
862
+ "Access-Control-Allow-Headers": {
863
+ "schema": {
864
+ "type": "string"
865
+ }
866
+ },
867
+ "Access-Control-Allow-Methods": {
868
+ "schema": {
869
+ "type": "string"
870
+ }
871
+ },
872
+ "Access-Control-Allow-Origin": {
873
+ "schema": {
874
+ "type": "string"
875
+ }
876
+ }
877
+ }
878
+ }
879
+ }
880
+ },
881
+ "x-amazon-apigateway-any-method": {
882
+ "responses": {
883
+ "200": {
884
+ "content": {
885
+ "application/json": {
886
+ "schema": {
887
+ "$ref": "#/components/schemas/Empty"
888
+ }
889
+ }
890
+ },
891
+ "description": "200 response"
892
+ }
893
+ }
894
+ }
895
+ },
896
+ "/erc20": {
897
+ "get": {
898
+ "description": "Get token information such as name, total amount in circulation, etc",
899
+ "responses": {
900
+ "200": {
901
+ "content": {
902
+ "application/json": {
903
+ "schema": {
904
+ "$ref": "#/components/schemas/Empty"
905
+ }
906
+ }
907
+ },
908
+ "description": "200 response"
909
+ }
910
+ }
911
+ },
912
+ "options": {
913
+ "responses": {
914
+ "200": {
915
+ "content": {
916
+ "application/json": {
917
+ "schema": {
918
+ "$ref": "#/components/schemas/Empty"
919
+ }
920
+ }
921
+ },
922
+ "description": "200 response",
923
+ "headers": {
924
+ "Access-Control-Allow-Headers": {
925
+ "schema": {
926
+ "type": "string"
927
+ }
928
+ },
929
+ "Access-Control-Allow-Methods": {
930
+ "schema": {
931
+ "type": "string"
932
+ }
933
+ },
934
+ "Access-Control-Allow-Origin": {
935
+ "schema": {
936
+ "type": "string"
937
+ }
938
+ }
939
+ }
940
+ }
941
+ }
942
+ },
943
+ "post": {
944
+ "responses": {
945
+ "200": {
946
+ "content": {
947
+ "application/json": {
948
+ "schema": {
949
+ "$ref": "#/components/schemas/Empty"
950
+ }
951
+ }
952
+ },
953
+ "description": "200 response"
954
+ }
955
+ }
956
+ }
957
+ },
958
+ "/erc20/{address}": {
959
+ "get": {
960
+ "description": "Get information amout token balance in the account",
961
+ "parameters": [
962
+ {
963
+ "in": "path",
964
+ "name": "address",
965
+ "required": true,
966
+ "schema": {
967
+ "type": "string"
968
+ }
969
+ }
970
+ ],
971
+ "responses": {
972
+ "200": {
973
+ "content": {
974
+ "application/json": {
975
+ "schema": {
976
+ "$ref": "#/components/schemas/Empty"
977
+ }
978
+ }
979
+ },
980
+ "description": "200 response"
981
+ }
982
+ }
983
+ },
984
+ "options": {
985
+ "parameters": [
986
+ {
987
+ "description": "Automatically added",
988
+ "in": "path",
989
+ "name": "address",
990
+ "required": true,
991
+ "schema": {
992
+ "type": "string"
993
+ }
994
+ }
995
+ ],
996
+ "responses": {
997
+ "200": {
998
+ "content": {
999
+ "application/json": {
1000
+ "schema": {
1001
+ "$ref": "#/components/schemas/Empty"
1002
+ }
1003
+ }
1004
+ },
1005
+ "description": "200 response",
1006
+ "headers": {
1007
+ "Access-Control-Allow-Headers": {
1008
+ "schema": {
1009
+ "type": "string"
1010
+ }
1011
+ },
1012
+ "Access-Control-Allow-Methods": {
1013
+ "schema": {
1014
+ "type": "string"
1015
+ }
1016
+ },
1017
+ "Access-Control-Allow-Origin": {
1018
+ "schema": {
1019
+ "type": "string"
1020
+ }
1021
+ }
1022
+ }
1023
+ }
1024
+ }
1025
+ },
1026
+ "post": {
1027
+ "description": "Transfer tokens to another account",
1028
+ "parameters": [
1029
+ {
1030
+ "in": "path",
1031
+ "name": "address",
1032
+ "required": true,
1033
+ "schema": {
1034
+ "type": "string"
1035
+ }
1036
+ }
1037
+ ],
1038
+ "responses": {
1039
+ "200": {
1040
+ "content": {
1041
+ "application/json": {
1042
+ "schema": {
1043
+ "$ref": "#/components/schemas/Empty"
1044
+ }
1045
+ }
1046
+ },
1047
+ "description": "200 response"
1048
+ }
1049
+ }
1050
+ }
1051
+ },
1052
+ "/key": {
1053
+ "get": {
1054
+ "parameters": [
1055
+ {
1056
+ "in": "query",
1057
+ "name": "token",
1058
+ "required": false,
1059
+ "schema": {
1060
+ "type": "string"
1061
+ }
1062
+ }
1063
+ ],
1064
+ "responses": {
1065
+ "200": {
1066
+ "content": {
1067
+ "application/json": {
1068
+ "schema": {
1069
+ "$ref": "#/components/schemas/Empty"
1070
+ }
1071
+ }
1072
+ },
1073
+ "description": "200 response"
1074
+ }
1075
+ }
1076
+ },
1077
+ "options": {
1078
+ "responses": {
1079
+ "200": {
1080
+ "content": {
1081
+ "application/json": {
1082
+ "schema": {
1083
+ "$ref": "#/components/schemas/Empty"
1084
+ }
1085
+ }
1086
+ },
1087
+ "description": "200 response",
1088
+ "headers": {
1089
+ "Access-Control-Allow-Headers": {
1090
+ "schema": {
1091
+ "type": "string"
1092
+ }
1093
+ },
1094
+ "Access-Control-Allow-Methods": {
1095
+ "schema": {
1096
+ "type": "string"
1097
+ }
1098
+ },
1099
+ "Access-Control-Allow-Origin": {
1100
+ "schema": {
1101
+ "type": "string"
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ "post": {
1109
+ "responses": {
1110
+ "200": {
1111
+ "content": {
1112
+ "application/json": {
1113
+ "schema": {
1114
+ "$ref": "#/components/schemas/Empty"
1115
+ }
1116
+ }
1117
+ },
1118
+ "description": "200 response"
1119
+ }
1120
+ }
1121
+ }
1122
+ },
1123
+ "/key/{key}": {
1124
+ "delete": {
1125
+ "parameters": [
1126
+ {
1127
+ "in": "path",
1128
+ "name": "key",
1129
+ "required": true,
1130
+ "schema": {
1131
+ "type": "string"
1132
+ }
1133
+ }
1134
+ ],
1135
+ "responses": {
1136
+ "200": {
1137
+ "content": {
1138
+ "application/json": {
1139
+ "schema": {
1140
+ "$ref": "#/components/schemas/Empty"
1141
+ }
1142
+ }
1143
+ },
1144
+ "description": "200 response"
1145
+ }
1146
+ }
1147
+ },
1148
+ "options": {
1149
+ "parameters": [
1150
+ {
1151
+ "description": "Automatically added",
1152
+ "in": "path",
1153
+ "name": "key",
1154
+ "required": true,
1155
+ "schema": {
1156
+ "type": "string"
1157
+ }
1158
+ }
1159
+ ],
1160
+ "responses": {
1161
+ "200": {
1162
+ "content": {
1163
+ "application/json": {
1164
+ "schema": {
1165
+ "$ref": "#/components/schemas/Empty"
1166
+ }
1167
+ }
1168
+ },
1169
+ "description": "200 response",
1170
+ "headers": {
1171
+ "Access-Control-Allow-Headers": {
1172
+ "schema": {
1173
+ "type": "string"
1174
+ }
1175
+ },
1176
+ "Access-Control-Allow-Methods": {
1177
+ "schema": {
1178
+ "type": "string"
1179
+ }
1180
+ },
1181
+ "Access-Control-Allow-Origin": {
1182
+ "schema": {
1183
+ "type": "string"
1184
+ }
1185
+ }
1186
+ }
1187
+ }
1188
+ }
1189
+ }
1190
+ },
1191
+ "/transaction": {
1192
+ "options": {
1193
+ "responses": {
1194
+ "200": {
1195
+ "content": {
1196
+ "application/json": {
1197
+ "schema": {
1198
+ "$ref": "#/components/schemas/Empty"
1199
+ }
1200
+ }
1201
+ },
1202
+ "description": "200 response",
1203
+ "headers": {
1204
+ "Access-Control-Allow-Headers": {
1205
+ "schema": {
1206
+ "type": "string"
1207
+ }
1208
+ },
1209
+ "Access-Control-Allow-Methods": {
1210
+ "schema": {
1211
+ "type": "string"
1212
+ }
1213
+ },
1214
+ "Access-Control-Allow-Origin": {
1215
+ "schema": {
1216
+ "type": "string"
1217
+ }
1218
+ }
1219
+ }
1220
+ }
1221
+ }
1222
+ },
1223
+ "post": {
1224
+ "description": "Create a new transaction. Transfer Ether between accounts",
1225
+ "responses": {
1226
+ "200": {
1227
+ "content": {
1228
+ "application/json": {
1229
+ "schema": {
1230
+ "$ref": "#/components/schemas/Empty"
1231
+ }
1232
+ }
1233
+ },
1234
+ "description": "200 response",
1235
+ "headers": {
1236
+ "Access-Control-Allow-Origin": {
1237
+ "schema": {
1238
+ "type": "string"
1239
+ }
1240
+ }
1241
+ }
1242
+ }
1243
+ },
1244
+ "security": [
1245
+ {
1246
+ "Key2": []
1247
+ }
1248
+ ]
1249
+ }
1250
+ },
1251
+ "/transaction/{hash}": {
1252
+ "get": {
1253
+ "description": "Get information about transaction by the transaction hash value",
1254
+ "parameters": [
1255
+ {
1256
+ "in": "path",
1257
+ "name": "hash",
1258
+ "required": true,
1259
+ "schema": {
1260
+ "type": "string"
1261
+ }
1262
+ }
1263
+ ],
1264
+ "responses": {
1265
+ "200": {
1266
+ "content": {
1267
+ "application/json": {
1268
+ "schema": {
1269
+ "$ref": "#/components/schemas/Empty"
1270
+ }
1271
+ }
1272
+ },
1273
+ "description": "200 response",
1274
+ "headers": {
1275
+ "Access-Control-Allow-Origin": {
1276
+ "schema": {
1277
+ "type": "string"
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ },
1283
+ "security": [
1284
+ {
1285
+ "Key2": []
1286
+ }
1287
+ ]
1288
+ },
1289
+ "options": {
1290
+ "parameters": [
1291
+ {
1292
+ "description": "Automatically added",
1293
+ "in": "path",
1294
+ "name": "hash",
1295
+ "required": true,
1296
+ "schema": {
1297
+ "type": "string"
1298
+ }
1299
+ }
1300
+ ],
1301
+ "responses": {
1302
+ "200": {
1303
+ "content": {
1304
+ "application/json": {
1305
+ "schema": {
1306
+ "$ref": "#/components/schemas/Empty"
1307
+ }
1308
+ }
1309
+ },
1310
+ "description": "200 response",
1311
+ "headers": {
1312
+ "Access-Control-Allow-Headers": {
1313
+ "schema": {
1314
+ "type": "string"
1315
+ }
1316
+ },
1317
+ "Access-Control-Allow-Methods": {
1318
+ "schema": {
1319
+ "type": "string"
1320
+ }
1321
+ },
1322
+ "Access-Control-Allow-Origin": {
1323
+ "schema": {
1324
+ "type": "string"
1325
+ }
1326
+ }
1327
+ }
1328
+ }
1329
+ }
1330
+ }
1331
+ },
1332
+ "/transaction/{hash}/receipt": {
1333
+ "get": {
1334
+ "description": "Get receipt detail information",
1335
+ "parameters": [
1336
+ {
1337
+ "in": "path",
1338
+ "name": "hash",
1339
+ "required": true,
1340
+ "schema": {
1341
+ "type": "string"
1342
+ }
1343
+ }
1344
+ ],
1345
+ "responses": {
1346
+ "200": {
1347
+ "content": {
1348
+ "application/json": {
1349
+ "schema": {
1350
+ "$ref": "#/components/schemas/Empty"
1351
+ }
1352
+ }
1353
+ },
1354
+ "description": "200 response",
1355
+ "headers": {
1356
+ "Access-Control-Allow-Origin": {
1357
+ "schema": {
1358
+ "type": "string"
1359
+ }
1360
+ }
1361
+ }
1362
+ }
1363
+ },
1364
+ "security": [
1365
+ {
1366
+ "Key2": []
1367
+ }
1368
+ ]
1369
+ },
1370
+ "options": {
1371
+ "parameters": [
1372
+ {
1373
+ "description": "Automatically added",
1374
+ "in": "path",
1375
+ "name": "hash",
1376
+ "required": true,
1377
+ "schema": {
1378
+ "type": "string"
1379
+ }
1380
+ }
1381
+ ],
1382
+ "responses": {
1383
+ "200": {
1384
+ "content": {
1385
+ "application/json": {
1386
+ "schema": {
1387
+ "$ref": "#/components/schemas/Empty"
1388
+ }
1389
+ }
1390
+ },
1391
+ "description": "200 response",
1392
+ "headers": {
1393
+ "Access-Control-Allow-Headers": {
1394
+ "schema": {
1395
+ "type": "string"
1396
+ }
1397
+ },
1398
+ "Access-Control-Allow-Methods": {
1399
+ "schema": {
1400
+ "type": "string"
1401
+ }
1402
+ },
1403
+ "Access-Control-Allow-Origin": {
1404
+ "schema": {
1405
+ "type": "string"
1406
+ }
1407
+ }
1408
+ }
1409
+ }
1410
+ }
1411
+ }
1412
+ },
1413
+ "/version": {
1414
+ "get": {
1415
+ "description": "Get API version info",
1416
+ "responses": {
1417
+ "200": {
1418
+ "content": {
1419
+ "application/json": {
1420
+ "schema": {
1421
+ "$ref": "#/components/schemas/Empty"
1422
+ }
1423
+ }
1424
+ },
1425
+ "description": "200 response",
1426
+ "headers": {
1427
+ "Access-Control-Allow-Origin": {
1428
+ "schema": {
1429
+ "type": "string"
1430
+ }
1431
+ }
1432
+ }
1433
+ }
1434
+ }
1435
+ },
1436
+ "options": {
1437
+ "responses": {
1438
+ "200": {
1439
+ "content": {
1440
+ "application/json": {
1441
+ "schema": {
1442
+ "$ref": "#/components/schemas/Empty"
1443
+ }
1444
+ }
1445
+ },
1446
+ "description": "200 response",
1447
+ "headers": {
1448
+ "Access-Control-Allow-Headers": {
1449
+ "schema": {
1450
+ "type": "string"
1451
+ }
1452
+ },
1453
+ "Access-Control-Allow-Methods": {
1454
+ "schema": {
1455
+ "type": "string"
1456
+ }
1457
+ },
1458
+ "Access-Control-Allow-Origin": {
1459
+ "schema": {
1460
+ "type": "string"
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+ }
1467
+ },
1468
+ "/wallet": {
1469
+ "get": {
1470
+ "description": "Get current account balance",
1471
+ "responses": {
1472
+ "200": {
1473
+ "content": {
1474
+ "application/json": {
1475
+ "schema": {
1476
+ "$ref": "#/components/schemas/Empty"
1477
+ }
1478
+ }
1479
+ },
1480
+ "description": "200 response"
1481
+ }
1482
+ }
1483
+ },
1484
+ "options": {
1485
+ "responses": {
1486
+ "200": {
1487
+ "content": {
1488
+ "application/json": {
1489
+ "schema": {
1490
+ "$ref": "#/components/schemas/Empty"
1491
+ }
1492
+ }
1493
+ },
1494
+ "description": "200 response",
1495
+ "headers": {
1496
+ "Access-Control-Allow-Headers": {
1497
+ "schema": {
1498
+ "type": "string"
1499
+ }
1500
+ },
1501
+ "Access-Control-Allow-Methods": {
1502
+ "schema": {
1503
+ "type": "string"
1504
+ }
1505
+ },
1506
+ "Access-Control-Allow-Origin": {
1507
+ "schema": {
1508
+ "type": "string"
1509
+ }
1510
+ }
1511
+ }
1512
+ }
1513
+ }
1514
+ },
1515
+ "post": {
1516
+ "description": "Create personal wallet",
1517
+ "responses": {
1518
+ "200": {
1519
+ "content": {
1520
+ "application/json": {
1521
+ "schema": {
1522
+ "$ref": "#/components/schemas/Empty"
1523
+ }
1524
+ }
1525
+ },
1526
+ "description": "200 response"
1527
+ }
1528
+ }
1529
+ }
1530
+ },
1531
+ "/wallet/account": {
1532
+ "get": {
1533
+ "responses": {
1534
+ "200": {
1535
+ "content": {
1536
+ "application/json": {
1537
+ "schema": {
1538
+ "$ref": "#/components/schemas/Empty"
1539
+ }
1540
+ }
1541
+ },
1542
+ "description": "200 response"
1543
+ }
1544
+ }
1545
+ },
1546
+ "options": {
1547
+ "responses": {
1548
+ "200": {
1549
+ "content": {
1550
+ "application/json": {
1551
+ "schema": {
1552
+ "$ref": "#/components/schemas/Empty"
1553
+ }
1554
+ }
1555
+ },
1556
+ "description": "200 response",
1557
+ "headers": {
1558
+ "Access-Control-Allow-Headers": {
1559
+ "schema": {
1560
+ "type": "string"
1561
+ }
1562
+ },
1563
+ "Access-Control-Allow-Methods": {
1564
+ "schema": {
1565
+ "type": "string"
1566
+ }
1567
+ },
1568
+ "Access-Control-Allow-Origin": {
1569
+ "schema": {
1570
+ "type": "string"
1571
+ }
1572
+ }
1573
+ }
1574
+ }
1575
+ }
1576
+ },
1577
+ "post": {
1578
+ "responses": {
1579
+ "200": {
1580
+ "content": {
1581
+ "application/json": {
1582
+ "schema": {
1583
+ "$ref": "#/components/schemas/Empty"
1584
+ }
1585
+ }
1586
+ },
1587
+ "description": "200 response"
1588
+ }
1589
+ }
1590
+ }
1591
+ },
1592
+ "/wallet/account/{id}": {
1593
+ "get": {
1594
+ "description": "Get account balance",
1595
+ "parameters": [
1596
+ {
1597
+ "in": "path",
1598
+ "name": "id",
1599
+ "required": true,
1600
+ "schema": {
1601
+ "type": "string"
1602
+ }
1603
+ }
1604
+ ],
1605
+ "responses": {
1606
+ "200": {
1607
+ "content": {
1608
+ "application/json": {
1609
+ "schema": {
1610
+ "$ref": "#/components/schemas/Empty"
1611
+ }
1612
+ }
1613
+ },
1614
+ "description": "200 response"
1615
+ }
1616
+ }
1617
+ },
1618
+ "options": {
1619
+ "parameters": [
1620
+ {
1621
+ "description": "Automatically added",
1622
+ "in": "path",
1623
+ "name": "id",
1624
+ "required": true,
1625
+ "schema": {
1626
+ "type": "string"
1627
+ }
1628
+ }
1629
+ ],
1630
+ "responses": {
1631
+ "200": {
1632
+ "content": {
1633
+ "application/json": {
1634
+ "schema": {
1635
+ "$ref": "#/components/schemas/Empty"
1636
+ }
1637
+ }
1638
+ },
1639
+ "description": "200 response",
1640
+ "headers": {
1641
+ "Access-Control-Allow-Headers": {
1642
+ "schema": {
1643
+ "type": "string"
1644
+ }
1645
+ },
1646
+ "Access-Control-Allow-Methods": {
1647
+ "schema": {
1648
+ "type": "string"
1649
+ }
1650
+ },
1651
+ "Access-Control-Allow-Origin": {
1652
+ "schema": {
1653
+ "type": "string"
1654
+ }
1655
+ }
1656
+ }
1657
+ }
1658
+ }
1659
+ }
1660
+ },
1661
+ "/wallet/account/{id}/contract": {
1662
+ "post": {
1663
+ "parameters": [
1664
+ {
1665
+ "in": "path",
1666
+ "name": "id",
1667
+ "required": true,
1668
+ "schema": {
1669
+ "type": "string"
1670
+ }
1671
+ }
1672
+ ],
1673
+ "responses": {
1674
+ "200": {
1675
+ "content": {
1676
+ "application/json": {
1677
+ "schema": {
1678
+ "$ref": "#/components/schemas/Empty"
1679
+ }
1680
+ }
1681
+ },
1682
+ "description": "200 response"
1683
+ }
1684
+ }
1685
+ }
1686
+ },
1687
+ "/wallet/account/{id}/erc20": {
1688
+ "post": {
1689
+ "parameters": [
1690
+ {
1691
+ "in": "path",
1692
+ "name": "id",
1693
+ "required": true,
1694
+ "schema": {
1695
+ "type": "string"
1696
+ }
1697
+ }
1698
+ ],
1699
+ "responses": {
1700
+ "200": {
1701
+ "content": {
1702
+ "application/json": {
1703
+ "schema": {
1704
+ "$ref": "#/components/schemas/Empty"
1705
+ }
1706
+ }
1707
+ },
1708
+ "description": "200 response"
1709
+ }
1710
+ }
1711
+ }
1712
+ },
1713
+ "/wallet/account/{id}/pay": {
1714
+ "options": {
1715
+ "parameters": [
1716
+ {
1717
+ "description": "Automatically added",
1718
+ "in": "path",
1719
+ "name": "id",
1720
+ "required": true,
1721
+ "schema": {
1722
+ "type": "string"
1723
+ }
1724
+ }
1725
+ ],
1726
+ "responses": {
1727
+ "200": {
1728
+ "content": {
1729
+ "application/json": {
1730
+ "schema": {
1731
+ "$ref": "#/components/schemas/Empty"
1732
+ }
1733
+ }
1734
+ },
1735
+ "description": "200 response",
1736
+ "headers": {
1737
+ "Access-Control-Allow-Headers": {
1738
+ "schema": {
1739
+ "type": "string"
1740
+ }
1741
+ },
1742
+ "Access-Control-Allow-Methods": {
1743
+ "schema": {
1744
+ "type": "string"
1745
+ }
1746
+ },
1747
+ "Access-Control-Allow-Origin": {
1748
+ "schema": {
1749
+ "type": "string"
1750
+ }
1751
+ }
1752
+ }
1753
+ }
1754
+ }
1755
+ },
1756
+ "post": {
1757
+ "description": "Send payment from the account held within the wallet",
1758
+ "parameters": [
1759
+ {
1760
+ "in": "path",
1761
+ "name": "id",
1762
+ "required": true,
1763
+ "schema": {
1764
+ "type": "string"
1765
+ }
1766
+ }
1767
+ ],
1768
+ "responses": {
1769
+ "200": {
1770
+ "content": {
1771
+ "application/json": {
1772
+ "schema": {
1773
+ "$ref": "#/components/schemas/Empty"
1774
+ }
1775
+ }
1776
+ },
1777
+ "description": "200 response"
1778
+ }
1779
+ }
1780
+ }
1781
+ }
1782
+ },
1783
+ "components": {
1784
+ "schemas": {
1785
+ "Empty": {
1786
+ "title": "Empty Schema",
1787
+ "type": "object"
1788
+ }
1789
+ },
1790
+ "securitySchemes": {
1791
+ "Key2": {
1792
+ "in": "header",
1793
+ "name": "X-Api-Key",
1794
+ "type": "apiKey",
1795
+ "x-amazon-apigateway-authtype": "custom"
1796
+ }
1797
+ }
1798
+ }
1799
+ };
1800
+ function generateTools() {
1801
+ const tools = [];
1802
+ const paths = API_SPEC.paths || {};
1803
+ for (const [path, pathItem] of Object.entries(paths)) {
1804
+ for (const [method, operation] of Object.entries(pathItem)) {
1805
+ if (!["get", "post", "put", "patch", "delete"].includes(method))
1806
+ continue;
1807
+ const op = operation;
1808
+ const operationId = op.operationId || `${method}_${path.replace(/\W/g, "_")}`;
1809
+ const summary = op.summary || op.description || `${method.toUpperCase()} ${path}`;
1810
+ const properties = {};
1811
+ const required = [];
1812
+ // Path parameters
1813
+ if (op.parameters) {
1814
+ for (const param of op.parameters) {
1815
+ if (param.in === "path" || param.in === "query") {
1816
+ properties[param.name] = {
1817
+ type: param.schema?.type || "string",
1818
+ description: param.description,
1819
+ ...(param.schema?.enum && { enum: param.schema.enum }),
1820
+ };
1821
+ if (param.required)
1822
+ required.push(param.name);
1823
+ }
1824
+ }
1825
+ }
1826
+ // Request body
1827
+ if (op.requestBody?.content?.["application/json"]?.schema) {
1828
+ properties.body = {
1829
+ type: "object",
1830
+ description: "Request body",
1831
+ };
1832
+ }
1833
+ tools.push({
1834
+ name: operationId,
1835
+ description: summary.substring(0, 200),
1836
+ inputSchema: {
1837
+ type: "object",
1838
+ properties,
1839
+ ...(required.length > 0 && { required }),
1840
+ },
1841
+ method: method.toUpperCase(),
1842
+ path,
1843
+ });
1844
+ }
1845
+ }
1846
+ return tools;
1847
+ }
1848
+ async function makeRequest(tool, args) {
1849
+ // Support both OpenAPI 3.0 (servers) and Swagger 2.0 (host + basePath)
1850
+ const apiSpec = API_SPEC;
1851
+ let baseUrl = "https://api.example.com";
1852
+ if (apiSpec.servers && apiSpec.servers.length > 0) {
1853
+ // OpenAPI 3.0
1854
+ baseUrl = apiSpec.servers[0].url;
1855
+ }
1856
+ else if (apiSpec.host) {
1857
+ // Swagger 2.0
1858
+ const scheme = apiSpec.schemes?.[0] || "https";
1859
+ const basePath = apiSpec.basePath || "";
1860
+ baseUrl = `${scheme}://${apiSpec.host}${basePath}`;
1861
+ }
1862
+ let url = baseUrl + tool.path;
1863
+ // Replace path parameters
1864
+ for (const [key, value] of Object.entries(args)) {
1865
+ if (url.includes(`{${key}}`)) {
1866
+ url = url.replace(`{${key}}`, encodeURIComponent(String(value)));
1867
+ }
1868
+ }
1869
+ // Add query parameters
1870
+ const queryParams = new URLSearchParams();
1871
+ for (const [key, value] of Object.entries(args)) {
1872
+ if (!tool.path.includes(`{${key}}`) && key !== "body") {
1873
+ queryParams.append(key, String(value));
1874
+ }
1875
+ }
1876
+ if (queryParams.toString()) {
1877
+ url += "?" + queryParams.toString();
1878
+ }
1879
+ const options = {
1880
+ method: tool.method,
1881
+ headers: {
1882
+ "Content-Type": "application/json",
1883
+ },
1884
+ };
1885
+ if (args.body && ["POST", "PUT", "PATCH"].includes(tool.method)) {
1886
+ options.body = JSON.stringify(args.body);
1887
+ }
1888
+ const response = await fetch(url, options);
1889
+ const data = await response.json();
1890
+ return {
1891
+ status: response.status,
1892
+ data,
1893
+ };
1894
+ }
1895
+ const server = new Server({
1896
+ name: "apidapp",
1897
+ version: "1.0.0",
1898
+ }, {
1899
+ capabilities: {
1900
+ tools: {},
1901
+ },
1902
+ });
1903
+ const tools = generateTools();
1904
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
1905
+ tools: tools.map(({ method, path, ...tool }) => tool),
1906
+ }));
1907
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1908
+ const tool = tools.find((t) => t.name === request.params.name);
1909
+ if (!tool) {
1910
+ throw new Error(`Unknown tool: ${request.params.name}`);
1911
+ }
1912
+ try {
1913
+ const result = await makeRequest(tool, request.params.arguments || {});
1914
+ return {
1915
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
1916
+ };
1917
+ }
1918
+ catch (error) {
1919
+ return {
1920
+ content: [{ type: "text", text: `Error: ${error.message}` }],
1921
+ isError: true,
1922
+ };
1923
+ }
1924
+ });
1925
+ async function main() {
1926
+ const transport = new StdioServerTransport();
1927
+ await server.connect(transport);
1928
+ }
1929
+ main();