mcp-server-esa 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -243,10 +243,13 @@ class Client {
243
243
  return this.client.callApi(params, request, runtime);
244
244
  }
245
245
  createRecord(params) {
246
- log('createRecord', JSON.stringify(params));
247
246
  const request = new esa20240910_namespaceObject.CreateRecordRequest(params);
248
247
  return this.callApi(this.client.createRecord.bind(this.client), request);
249
248
  }
249
+ listRecords(params) {
250
+ const request = new esa20240910_namespaceObject.ListRecordsRequest(params);
251
+ return this.callApi(this.client.listRecords.bind(this.client), request);
252
+ }
250
253
  constructor(){
251
254
  _define_property(this, "client", void 0);
252
255
  _define_property(this, "callApi", async (action, request)=>{
@@ -459,8 +462,8 @@ const deployment_delete = async (request)=>{
459
462
  success: true
460
463
  };
461
464
  };
462
- const RECORD_CREATE_TOOL = {
463
- name: 'record_create',
465
+ const ER_RECORD_CREATE_TOOL = {
466
+ name: 'er_record_create',
464
467
  description: 'Create a record',
465
468
  inputSchema: {
466
469
  type: 'object',
@@ -485,8 +488,8 @@ const RECORD_CREATE_TOOL = {
485
488
  ]
486
489
  }
487
490
  };
488
- const RECORD_DELETE_TOOL = {
489
- name: 'record_delete',
491
+ const ER_RECORD_DELETE_TOOL = {
492
+ name: 'er_record_delete',
490
493
  description: 'Delete a record',
491
494
  inputSchema: {
492
495
  type: 'object',
@@ -515,8 +518,8 @@ const RECORD_DELETE_TOOL = {
515
518
  ]
516
519
  }
517
520
  };
518
- const RECORD_LIST_TOOL = {
519
- name: 'record_list',
521
+ const ER_RECORD_LIST_TOOL = {
522
+ name: 'er_record_list',
520
523
  description: 'List all records',
521
524
  inputSchema: {
522
525
  type: 'object',
@@ -543,7 +546,7 @@ const RECORD_LIST_TOOL = {
543
546
  ]
544
547
  }
545
548
  };
546
- const record_create = async (request)=>{
549
+ const er_record_create = async (request)=>{
547
550
  const res = await service.createRoutineRelatedRecord(request.params.arguments);
548
551
  return {
549
552
  content: [
@@ -555,7 +558,7 @@ const record_create = async (request)=>{
555
558
  success: true
556
559
  };
557
560
  };
558
- const record_delete = async (request)=>{
561
+ const er_record_delete = async (request)=>{
559
562
  const res = await service.deleteRoutineRelatedRecord(request.params.arguments);
560
563
  return {
561
564
  content: [
@@ -567,7 +570,7 @@ const record_delete = async (request)=>{
567
570
  success: true
568
571
  };
569
572
  };
570
- const record_list = async (request)=>{
573
+ const er_record_list = async (request)=>{
571
574
  const res = await service.listRoutineRelatedRecords(request.params.arguments);
572
575
  return {
573
576
  content: [
@@ -1046,8 +1049,8 @@ const SITE_MATCH_TOOL = {
1046
1049
  ]
1047
1050
  }
1048
1051
  };
1049
- const SITE_CREATE_DNS_TYPE_A_RECORD = {
1050
- name: 'site_create_dns_type_a_record',
1052
+ const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL = {
1053
+ name: 'site_dns_type_a_record_create',
1051
1054
  description: 'Create a A record for a site.',
1052
1055
  inputSchema: {
1053
1056
  type: 'object',
@@ -1069,10 +1072,7 @@ const SITE_CREATE_DNS_TYPE_A_RECORD = {
1069
1072
  },
1070
1073
  data: {
1071
1074
  type: 'object',
1072
- data: {
1073
- type: 'object',
1074
- description: 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.'
1075
- },
1075
+ description: 'The data for the DNS record, varying by record type. Required.',
1076
1076
  properties: {
1077
1077
  value: {
1078
1078
  type: 'string',
@@ -1091,8 +1091,8 @@ const SITE_CREATE_DNS_TYPE_A_RECORD = {
1091
1091
  ]
1092
1092
  }
1093
1093
  };
1094
- const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1095
- name: 'site_create_dns_cname_domain_record',
1094
+ const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL = {
1095
+ name: 'site_dns_cname_domain_record_create',
1096
1096
  description: 'Create a CNAME domain record for a site.',
1097
1097
  inputSchema: {
1098
1098
  type: 'object',
@@ -1114,10 +1114,7 @@ const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1114
1114
  },
1115
1115
  data: {
1116
1116
  type: 'object',
1117
- data: {
1118
- type: 'object',
1119
- description: 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.'
1120
- },
1117
+ description: 'The data for the DNS record, varying by record type. Required.',
1121
1118
  properties: {
1122
1119
  value: {
1123
1120
  type: 'string',
@@ -1136,7 +1133,20 @@ const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1136
1133
  ]
1137
1134
  }
1138
1135
  };
1139
- const site_create_dns_type_a_record = async (request)=>{
1136
+ const SITE_RECORD_LIST_TOOL = {
1137
+ name: 'site_record_list',
1138
+ description: 'List all records in a site',
1139
+ inputSchema: {
1140
+ type: 'object',
1141
+ properties: {
1142
+ SiteId: {
1143
+ type: 'number',
1144
+ description: 'The ID of the site, obtained from the ListSites operation. Required.'
1145
+ }
1146
+ }
1147
+ }
1148
+ };
1149
+ const site_dns_type_a_record_create = async (request)=>{
1140
1150
  const res = await service.createRecord({
1141
1151
  ttl: 1,
1142
1152
  proxied: true,
@@ -1154,7 +1164,7 @@ const site_create_dns_type_a_record = async (request)=>{
1154
1164
  success: true
1155
1165
  };
1156
1166
  };
1157
- const site_create_dns_cname_domain_record = async (request)=>{
1167
+ const site_dns_cname_domain_record_create = async (request)=>{
1158
1168
  const res = await service.createRecord({
1159
1169
  ttl: 1,
1160
1170
  proxied: true,
@@ -1174,6 +1184,21 @@ const site_create_dns_cname_domain_record = async (request)=>{
1174
1184
  success: true
1175
1185
  };
1176
1186
  };
1187
+ const site_record_list = async (request)=>{
1188
+ var _request_params_arguments;
1189
+ const res = await service.listRecords({
1190
+ siteId: (null === (_request_params_arguments = request.params.arguments) || void 0 === _request_params_arguments ? void 0 : _request_params_arguments.SiteId) ?? 0
1191
+ });
1192
+ return {
1193
+ content: [
1194
+ {
1195
+ type: 'text',
1196
+ text: JSON.stringify(res)
1197
+ }
1198
+ ],
1199
+ success: true
1200
+ };
1201
+ };
1177
1202
  const site_active_list = async ()=>{
1178
1203
  const res = await service.listSites({
1179
1204
  siteSearchType: 'fuzzy',
@@ -1223,18 +1248,23 @@ const ESA_OPENAPI_ER_LIST = [
1223
1248
  ROUTE_UPDATE_TOOL,
1224
1249
  ROUTE_GET_TOOL,
1225
1250
  SITE_MATCH_TOOL,
1226
- RECORD_CREATE_TOOL,
1227
- RECORD_DELETE_TOOL,
1228
- RECORD_LIST_TOOL,
1229
- SITE_CREATE_DNS_TYPE_A_RECORD,
1230
- SITE_CREATE_DNS_CNAME_DOMAIN_RECORD
1251
+ ER_RECORD_CREATE_TOOL,
1252
+ ER_RECORD_DELETE_TOOL,
1253
+ ER_RECORD_LIST_TOOL,
1254
+ SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
1255
+ SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
1256
+ SITE_RECORD_LIST_TOOL
1231
1257
  ];
1232
1258
  const ESA_OPENAPI_LIST = [
1233
1259
  ...ESA_OPENAPI_ER_LIST
1234
1260
  ];
1235
1261
  const routineHandlers = {
1236
- site_create_dns_type_a_record: site_create_dns_type_a_record,
1237
- site_create_dns_cname_domain_record: site_create_dns_cname_domain_record,
1262
+ site_dns_type_a_record_create: site_dns_type_a_record_create,
1263
+ site_dns_cname_domain_record_create: site_dns_cname_domain_record_create,
1264
+ site_active_list: site_active_list,
1265
+ site_match: site_match,
1266
+ site_route_list: site_route_list,
1267
+ site_record_list: site_record_list,
1238
1268
  routine_create: routine_create,
1239
1269
  routine_delete: routine_delete,
1240
1270
  routine_list: routine_list,
@@ -1244,16 +1274,13 @@ const routineHandlers = {
1244
1274
  routine_route_list: routine_route_list,
1245
1275
  canary_area_list: canary_area_list,
1246
1276
  deployment_delete: deployment_delete,
1247
- site_active_list: site_active_list,
1248
- site_match: site_match,
1249
- site_route_list: site_route_list,
1250
1277
  route_create: route_create,
1251
1278
  route_delete: route_delete,
1252
1279
  route_update: route_update,
1253
1280
  route_get: route_get,
1254
- record_create: record_create,
1255
- record_delete: record_delete,
1256
- record_list: record_list
1281
+ er_record_create: er_record_create,
1282
+ er_record_delete: er_record_delete,
1283
+ er_record_list: er_record_list
1257
1284
  };
1258
1285
  const server = new index_js_namespaceObject.Server({
1259
1286
  name: 'esa-server',
package/dist/index.mjs CHANGED
@@ -217,10 +217,13 @@ class Client {
217
217
  return this.client.callApi(params, request, runtime);
218
218
  }
219
219
  createRecord(params) {
220
- log('createRecord', JSON.stringify(params));
221
220
  const request = new __WEBPACK_EXTERNAL_MODULE__alicloud_esa20240910_b5517a12__.CreateRecordRequest(params);
222
221
  return this.callApi(this.client.createRecord.bind(this.client), request);
223
222
  }
223
+ listRecords(params) {
224
+ const request = new __WEBPACK_EXTERNAL_MODULE__alicloud_esa20240910_b5517a12__.ListRecordsRequest(params);
225
+ return this.callApi(this.client.listRecords.bind(this.client), request);
226
+ }
224
227
  constructor(){
225
228
  _define_property(this, "client", void 0);
226
229
  _define_property(this, "callApi", async (action, request)=>{
@@ -433,8 +436,8 @@ const deployment_delete = async (request)=>{
433
436
  success: true
434
437
  };
435
438
  };
436
- const RECORD_CREATE_TOOL = {
437
- name: 'record_create',
439
+ const ER_RECORD_CREATE_TOOL = {
440
+ name: 'er_record_create',
438
441
  description: 'Create a record',
439
442
  inputSchema: {
440
443
  type: 'object',
@@ -459,8 +462,8 @@ const RECORD_CREATE_TOOL = {
459
462
  ]
460
463
  }
461
464
  };
462
- const RECORD_DELETE_TOOL = {
463
- name: 'record_delete',
465
+ const ER_RECORD_DELETE_TOOL = {
466
+ name: 'er_record_delete',
464
467
  description: 'Delete a record',
465
468
  inputSchema: {
466
469
  type: 'object',
@@ -489,8 +492,8 @@ const RECORD_DELETE_TOOL = {
489
492
  ]
490
493
  }
491
494
  };
492
- const RECORD_LIST_TOOL = {
493
- name: 'record_list',
495
+ const ER_RECORD_LIST_TOOL = {
496
+ name: 'er_record_list',
494
497
  description: 'List all records',
495
498
  inputSchema: {
496
499
  type: 'object',
@@ -517,7 +520,7 @@ const RECORD_LIST_TOOL = {
517
520
  ]
518
521
  }
519
522
  };
520
- const record_create = async (request)=>{
523
+ const er_record_create = async (request)=>{
521
524
  const res = await service.createRoutineRelatedRecord(request.params.arguments);
522
525
  return {
523
526
  content: [
@@ -529,7 +532,7 @@ const record_create = async (request)=>{
529
532
  success: true
530
533
  };
531
534
  };
532
- const record_delete = async (request)=>{
535
+ const er_record_delete = async (request)=>{
533
536
  const res = await service.deleteRoutineRelatedRecord(request.params.arguments);
534
537
  return {
535
538
  content: [
@@ -541,7 +544,7 @@ const record_delete = async (request)=>{
541
544
  success: true
542
545
  };
543
546
  };
544
- const record_list = async (request)=>{
547
+ const er_record_list = async (request)=>{
545
548
  const res = await service.listRoutineRelatedRecords(request.params.arguments);
546
549
  return {
547
550
  content: [
@@ -1020,8 +1023,8 @@ const SITE_MATCH_TOOL = {
1020
1023
  ]
1021
1024
  }
1022
1025
  };
1023
- const SITE_CREATE_DNS_TYPE_A_RECORD = {
1024
- name: 'site_create_dns_type_a_record',
1026
+ const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL = {
1027
+ name: 'site_dns_type_a_record_create',
1025
1028
  description: 'Create a A record for a site.',
1026
1029
  inputSchema: {
1027
1030
  type: 'object',
@@ -1043,10 +1046,7 @@ const SITE_CREATE_DNS_TYPE_A_RECORD = {
1043
1046
  },
1044
1047
  data: {
1045
1048
  type: 'object',
1046
- data: {
1047
- type: 'object',
1048
- description: 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.'
1049
- },
1049
+ description: 'The data for the DNS record, varying by record type. Required.',
1050
1050
  properties: {
1051
1051
  value: {
1052
1052
  type: 'string',
@@ -1065,8 +1065,8 @@ const SITE_CREATE_DNS_TYPE_A_RECORD = {
1065
1065
  ]
1066
1066
  }
1067
1067
  };
1068
- const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1069
- name: 'site_create_dns_cname_domain_record',
1068
+ const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL = {
1069
+ name: 'site_dns_cname_domain_record_create',
1070
1070
  description: 'Create a CNAME domain record for a site.',
1071
1071
  inputSchema: {
1072
1072
  type: 'object',
@@ -1088,10 +1088,7 @@ const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1088
1088
  },
1089
1089
  data: {
1090
1090
  type: 'object',
1091
- data: {
1092
- type: 'object',
1093
- description: 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.'
1094
- },
1091
+ description: 'The data for the DNS record, varying by record type. Required.',
1095
1092
  properties: {
1096
1093
  value: {
1097
1094
  type: 'string',
@@ -1110,7 +1107,20 @@ const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD = {
1110
1107
  ]
1111
1108
  }
1112
1109
  };
1113
- const site_create_dns_type_a_record = async (request)=>{
1110
+ const SITE_RECORD_LIST_TOOL = {
1111
+ name: 'site_record_list',
1112
+ description: 'List all records in a site',
1113
+ inputSchema: {
1114
+ type: 'object',
1115
+ properties: {
1116
+ SiteId: {
1117
+ type: 'number',
1118
+ description: 'The ID of the site, obtained from the ListSites operation. Required.'
1119
+ }
1120
+ }
1121
+ }
1122
+ };
1123
+ const site_dns_type_a_record_create = async (request)=>{
1114
1124
  const res = await service.createRecord({
1115
1125
  ttl: 1,
1116
1126
  proxied: true,
@@ -1128,7 +1138,7 @@ const site_create_dns_type_a_record = async (request)=>{
1128
1138
  success: true
1129
1139
  };
1130
1140
  };
1131
- const site_create_dns_cname_domain_record = async (request)=>{
1141
+ const site_dns_cname_domain_record_create = async (request)=>{
1132
1142
  const res = await service.createRecord({
1133
1143
  ttl: 1,
1134
1144
  proxied: true,
@@ -1148,6 +1158,21 @@ const site_create_dns_cname_domain_record = async (request)=>{
1148
1158
  success: true
1149
1159
  };
1150
1160
  };
1161
+ const site_record_list = async (request)=>{
1162
+ var _request_params_arguments;
1163
+ const res = await service.listRecords({
1164
+ siteId: (null === (_request_params_arguments = request.params.arguments) || void 0 === _request_params_arguments ? void 0 : _request_params_arguments.SiteId) ?? 0
1165
+ });
1166
+ return {
1167
+ content: [
1168
+ {
1169
+ type: 'text',
1170
+ text: JSON.stringify(res)
1171
+ }
1172
+ ],
1173
+ success: true
1174
+ };
1175
+ };
1151
1176
  const site_active_list = async ()=>{
1152
1177
  const res = await service.listSites({
1153
1178
  siteSearchType: 'fuzzy',
@@ -1197,18 +1222,23 @@ const ESA_OPENAPI_ER_LIST = [
1197
1222
  ROUTE_UPDATE_TOOL,
1198
1223
  ROUTE_GET_TOOL,
1199
1224
  SITE_MATCH_TOOL,
1200
- RECORD_CREATE_TOOL,
1201
- RECORD_DELETE_TOOL,
1202
- RECORD_LIST_TOOL,
1203
- SITE_CREATE_DNS_TYPE_A_RECORD,
1204
- SITE_CREATE_DNS_CNAME_DOMAIN_RECORD
1225
+ ER_RECORD_CREATE_TOOL,
1226
+ ER_RECORD_DELETE_TOOL,
1227
+ ER_RECORD_LIST_TOOL,
1228
+ SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
1229
+ SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
1230
+ SITE_RECORD_LIST_TOOL
1205
1231
  ];
1206
1232
  const ESA_OPENAPI_LIST = [
1207
1233
  ...ESA_OPENAPI_ER_LIST
1208
1234
  ];
1209
1235
  const routineHandlers = {
1210
- site_create_dns_type_a_record: site_create_dns_type_a_record,
1211
- site_create_dns_cname_domain_record: site_create_dns_cname_domain_record,
1236
+ site_dns_type_a_record_create: site_dns_type_a_record_create,
1237
+ site_dns_cname_domain_record_create: site_dns_cname_domain_record_create,
1238
+ site_active_list: site_active_list,
1239
+ site_match: site_match,
1240
+ site_route_list: site_route_list,
1241
+ site_record_list: site_record_list,
1212
1242
  routine_create: routine_create,
1213
1243
  routine_delete: routine_delete,
1214
1244
  routine_list: routine_list,
@@ -1218,16 +1248,13 @@ const routineHandlers = {
1218
1248
  routine_route_list: routine_route_list,
1219
1249
  canary_area_list: canary_area_list,
1220
1250
  deployment_delete: deployment_delete,
1221
- site_active_list: site_active_list,
1222
- site_match: site_match,
1223
- site_route_list: site_route_list,
1224
1251
  route_create: route_create,
1225
1252
  route_delete: route_delete,
1226
1253
  route_update: route_update,
1227
1254
  route_get: route_get,
1228
- record_create: record_create,
1229
- record_delete: record_delete,
1230
- record_list: record_list
1255
+ er_record_create: er_record_create,
1256
+ er_record_delete: er_record_delete,
1257
+ er_record_list: er_record_list
1231
1258
  };
1232
1259
  const server = new __WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_server_index_js_269b79bf__.Server({
1233
1260
  name: 'esa-server',
@@ -1,22 +1,22 @@
1
1
  import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js';
2
- export declare const RECORD_CREATE_TOOL: Tool;
3
- export declare const RECORD_DELETE_TOOL: Tool;
4
- export declare const RECORD_LIST_TOOL: Tool;
5
- export declare const record_create: (request: CallToolRequest) => Promise<{
2
+ export declare const ER_RECORD_CREATE_TOOL: Tool;
3
+ export declare const ER_RECORD_DELETE_TOOL: Tool;
4
+ export declare const ER_RECORD_LIST_TOOL: Tool;
5
+ export declare const er_record_create: (request: CallToolRequest) => Promise<{
6
6
  content: {
7
7
  type: string;
8
8
  text: string;
9
9
  }[];
10
10
  success: boolean;
11
11
  }>;
12
- export declare const record_delete: (request: CallToolRequest) => Promise<{
12
+ export declare const er_record_delete: (request: CallToolRequest) => Promise<{
13
13
  content: {
14
14
  type: string;
15
15
  text: string;
16
16
  }[];
17
17
  success: boolean;
18
18
  }>;
19
- export declare const record_list: (request: CallToolRequest) => Promise<{
19
+ export declare const er_record_list: (request: CallToolRequest) => Promise<{
20
20
  content: {
21
21
  type: string;
22
22
  text: string;
@@ -1,16 +1,24 @@
1
1
  import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js';
2
2
  export declare const SITE_ACTIVE_LIST_TOOL: Tool;
3
3
  export declare const SITE_MATCH_TOOL: Tool;
4
- export declare const SITE_CREATE_DNS_TYPE_A_RECORD: Tool;
5
- export declare const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD: Tool;
6
- export declare const site_create_dns_type_a_record: (request: CallToolRequest) => Promise<{
4
+ export declare const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL: Tool;
5
+ export declare const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL: Tool;
6
+ export declare const SITE_RECORD_LIST_TOOL: Tool;
7
+ export declare const site_dns_type_a_record_create: (request: CallToolRequest) => Promise<{
7
8
  content: {
8
9
  type: string;
9
10
  text: string;
10
11
  }[];
11
12
  success: boolean;
12
13
  }>;
13
- export declare const site_create_dns_cname_domain_record: (request: CallToolRequest) => Promise<{
14
+ export declare const site_dns_cname_domain_record_create: (request: CallToolRequest) => Promise<{
15
+ content: {
16
+ type: string;
17
+ text: string;
18
+ }[];
19
+ success: boolean;
20
+ }>;
21
+ export declare const site_record_list: (request: CallToolRequest) => Promise<{
14
22
  content: {
15
23
  type: string;
16
24
  text: string;
@@ -1,4 +1,4 @@
1
- import ESA, { CommitRoutineStagingCodeRequest, CommitRoutineStagingCodeResponse, CreateRecordRequest, CreateRecordResponse, CreateRoutineRelatedRecordRequest, CreateRoutineRelatedRecordResponse, CreateRoutineRequest, CreateRoutineResponse, CreateRoutineRouteRequest, CreateRoutineRouteResponse, DeleteRoutineCodeVersionRequest, DeleteRoutineCodeVersionResponse, DeleteRoutineRelatedRecordRequest, DeleteRoutineRelatedRecordResponse, DeleteRoutineRequest, DeleteRoutineResponse, DeleteRoutineRouteRequest, DeleteRoutineRouteResponse, GetRoutineRequest, GetRoutineResponse, GetRoutineRouteRequest, GetRoutineRouteResponse, GetRoutineStagingCodeUploadInfoRequest, GetRoutineStagingCodeUploadInfoResponse, ListRoutineRoutesRequest, ListRoutineRoutesResponse, ListSiteRoutesRequest, ListSiteRoutesResponse, ListSitesRequest, ListSitesResponse, PublishRoutineCodeVersionRequest, PublishRoutineCodeVersionResponse, UpdateRoutineRouteRequest, UpdateRoutineRouteResponse } from '@alicloud/esa20240910';
1
+ import ESA, { CommitRoutineStagingCodeRequest, CommitRoutineStagingCodeResponse, CreateRecordRequest, CreateRecordResponse, CreateRoutineRelatedRecordRequest, CreateRoutineRelatedRecordResponse, CreateRoutineRequest, CreateRoutineResponse, CreateRoutineRouteRequest, CreateRoutineRouteResponse, DeleteRoutineCodeVersionRequest, DeleteRoutineCodeVersionResponse, DeleteRoutineRelatedRecordRequest, DeleteRoutineRelatedRecordResponse, DeleteRoutineRequest, DeleteRoutineResponse, DeleteRoutineRouteRequest, DeleteRoutineRouteResponse, GetRoutineRequest, GetRoutineResponse, GetRoutineRouteRequest, GetRoutineRouteResponse, GetRoutineStagingCodeUploadInfoRequest, GetRoutineStagingCodeUploadInfoResponse, ListRecordsRequest, ListRecordsResponse, ListRoutineRoutesRequest, ListRoutineRoutesResponse, ListSiteRoutesRequest, ListSiteRoutesResponse, ListSitesRequest, ListSitesResponse, PublishRoutineCodeVersionRequest, PublishRoutineCodeVersionResponse, UpdateRoutineRouteRequest, UpdateRoutineRouteResponse } from '@alicloud/esa20240910';
2
2
  import * as $Util from '@alicloud/tea-util';
3
3
  import { CliConfig, GetMatchSiteRequest, ListRoutineRelatedRecordsRequest } from './types';
4
4
  export interface ApiMethod<RequestType, ResponseType> {
@@ -35,6 +35,7 @@ declare class Client {
35
35
  [key: string]: any;
36
36
  }>;
37
37
  createRecord(params: CreateRecordRequest): Promise<CreateRecordResponse>;
38
+ listRecords(params: ListRecordsRequest): Promise<ListRecordsResponse>;
38
39
  }
39
40
  declare const _default: Client;
40
41
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-esa",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Alibaba Cloud ESA (Edge Security Acceleration) MCP Server",
5
5
  "main": "./dist/index.js",
6
6
  "type": "commonjs",
package/readme.md CHANGED
@@ -29,21 +29,21 @@
29
29
 
30
30
  **Claude Demo**
31
31
 
32
- ![1744168230082.gif](https://github.com/aliyun/mcp-server-esa/blob/main/image/readme/1744168230082.gif?raw=true)
32
+ ![1744168230082](image/readme/1744168230082.gif)
33
33
 
34
- ![1744168440370.gif](https://github.com/aliyun/mcp-server-esa/blob/main/image/readme/1744168440370.gif?raw=true)
34
+ ![1744168440370](image/readme/1744168440370.gif)
35
35
 
36
36
  **Cline Demo**
37
37
 
38
- ![1744168966418.gif](https://github.com/aliyun/mcp-server-esa/blob/main/image/readme/1744168966418.gif?raw=true)
38
+ ![1744168966418](image/readme/1744168966418.gif)
39
39
 
40
40
  **Cline configured successfully:**
41
41
 
42
- ![1744114625974.png](https://github.com/aliyun/mcp-server-esa/blob/main/image/readme/1744114625974.png?raw=true)
42
+ ![1744114625974](image/readme/1744114625974.png)
43
43
 
44
44
  **Claude configured successfully:**
45
45
 
46
- ![1744165412296.png](https://github.com/aliyun/mcp-server-esa/blob/main/image/readme/1744165412296.png?raw=true)
46
+ ![1744165412296](image/readme/1744165412296.png)
47
47
 
48
48
  ## Features
49
49
 
@@ -203,28 +203,37 @@
203
203
 
204
204
  ### Record Management Tools
205
205
 
206
- #### record_create
206
+ #### er_record_create
207
207
 
208
208
  **Create a record**
209
209
 
210
- | **Parameter** | **Type** | **Required** | **Description** |
211
- | ------------- | ---------- | ------------ | ---------------- |
212
- | **key** | **string** | **Yes** | **Record key** |
213
- | **value** | **string** | **Yes** | **Record value** |
210
+ | **Parameter** | **Type** | **Required** | **Description** |
211
+ | ------------- | ---------- | ------------ | ---------------------- |
212
+ | name | string | Yes | The name of the routine|
213
+ | siteId | number | Yes | The ID of the site |
214
+ | recordName | string | Yes | The name of the record |
214
215
 
215
- #### record_delete
216
+ #### er_record_delete
216
217
 
217
218
  **Delete a record**
218
219
 
219
- | **Parameter** | **Type** | **Required** | **Description** |
220
- | ------------- | ---------- | ------------ | ------------------------ |
221
- | **key** | **string** | **Yes** | **Record key to delete** |
220
+ | **Parameter** | **Type** | **Required** | **Description** |
221
+ | ------------- | ---------- | ------------ | ---------------------- |
222
+ | name | string | Yes | The name of the routine|
223
+ | siteId | number | Yes | The ID of the site |
224
+ | recordName | string | Yes | The name of the record |
225
+ | recordId | number | No | The ID of the record |
222
226
 
223
- #### record_list
227
+ #### er_record_list
224
228
 
225
229
  **List all records**
226
230
 
227
- **No parameters required.**
231
+ | **Parameter** | **Type** | **Required** | **Description** |
232
+ | ---------------- | ---------- | ------------ | ------------------------------ |
233
+ | Name | string | Yes | The name of the routine |
234
+ | PageNumber | number | No | The page number of the records |
235
+ | PageSize | number | No | The page size of the records |
236
+ | SearchKeyWord | string | No | The search key word |
228
237
 
229
238
  ### Site Tools
230
239
 
@@ -242,27 +251,35 @@ No parameters required.
242
251
  | ---------- | ------ | -------- | ----------------------------- |
243
252
  | recordName | string | Yes | The name of the site to match |
244
253
 
245
- #### site_create_dns_type_a_record
254
+ #### site_dns_type_a_record_create
246
255
 
247
256
  **Create an A record for a site**
248
257
 
249
- | Parameter | Type | Required | Description |
250
- | ---------- | ------ | -------- | ----------------------------------------------------------- |
251
- | recordName | string | Yes | The name of the DNS record (e.g., subdomain or full domain) |
252
- | siteId | number | Yes | The ID of the site, obtained from the ListSites operation |
253
- | data | object | Yes | The data for the DNS record with value property |
254
- | data.value | string | Yes | The IP address of the A record (e.g., "2.2.2.2") |
258
+ | Parameter | Type | Required | Description |
259
+ | ---------- | ------ | -------- | ------------------------------------------------------------------ |
260
+ | recordName | string | Yes | The name of the DNS record (e.g., subdomain or full domain) |
261
+ | siteId | number | Yes | The ID of the site, obtained from the ListSites operation |
262
+ | data | object | Yes | The data for the DNS record, with value property |
263
+ | data.value | string | Yes | The IP address of the A record (e.g., "2.2.2.2") |
255
264
 
256
- #### site_create_dns_cname_domain_record
265
+ #### site_dns_cname_domain_record_create
257
266
 
258
267
  **Create a CNAME domain record for a site**
259
268
 
260
- | Parameter | Type | Required | Description |
261
- | ---------- | ------ | -------- | ----------------------------------------------------------- |
262
- | recordName | string | Yes | The name of the DNS record (e.g., subdomain or full domain) |
263
- | siteId | number | Yes | The ID of the site, obtained from the ListSites operation |
264
- | data | object | Yes | The data for the DNS record with value property |
265
- | data.value | string | Yes | The domain value for the CNAME record |
269
+ | Parameter | Type | Required | Description |
270
+ | ---------- | ------ | -------- | ------------------------------------------------------------------ |
271
+ | recordName | string | Yes | The name of the DNS record (e.g., subdomain or full domain) |
272
+ | siteId | number | Yes | The ID of the site, obtained from the ListSites operation |
273
+ | data | object | Yes | The data for the DNS record, with value property |
274
+ | data.value | string | Yes | The domain value for the CNAME record |
275
+
276
+ #### site_record_list
277
+
278
+ **List all records in a site**
279
+
280
+ | Parameter | Type | Required | Description |
281
+ | ---------- | ------ | -------- | ------------------------------------------------------------------ |
282
+ | SiteId | number | Yes | The ID of the site, obtained from the ListSites operation |
266
283
 
267
284
  ##
268
285
 
package/readme_zh.md CHANGED
@@ -200,28 +200,37 @@ Claude配置成功后界面
200
200
 
201
201
  ### 记录管理工具
202
202
 
203
- #### record_create
203
+ #### er_record_create
204
204
 
205
205
  **创建记录**
206
206
 
207
- | 参数 | 类型 | 是否必需 | 描述 |
208
- | ----- | ------ | -------- | ------ |
209
- | key | string | 是 | 记录键 |
210
- | value | string | 是 | 记录值 |
207
+ | 参数 | 类型 | 是否必需 | 描述 |
208
+ | ---------- | ------ | -------- | ------------ |
209
+ | name | string | 是 | Routine 名称 |
210
+ | siteId | number | 是 | 站点 ID |
211
+ | recordName | string | 是 | 记录名称 |
211
212
 
212
- #### record_delete
213
+ #### er_record_delete
213
214
 
214
215
  **删除记录**
215
216
 
216
- | 参数 | 类型 | 是否必需 | 描述 |
217
- | ---- | ------ | -------- | -------------- |
218
- | key | string | 是 | 要删除的记录键 |
217
+ | 参数 | 类型 | 是否必需 | 描述 |
218
+ | ---------- | ------ | -------- | ------------ |
219
+ | name | string | 是 | Routine 名称 |
220
+ | siteId | number | 是 | 站点 ID |
221
+ | recordName | string | 是 | 记录名称 |
222
+ | recordId | number | 否 | 记录 ID |
219
223
 
220
- #### record_list
224
+ #### er_record_list
221
225
 
222
226
  **列出所有记录**
223
227
 
224
- 无需参数。
228
+ | 参数 | 类型 | 是否必需 | 描述 |
229
+ | -------------- | ------ | -------- | ------------------ |
230
+ | Name | string | 是 | Routine 名称 |
231
+ | PageNumber | number | 否 | 页码 |
232
+ | PageSize | number | 否 | 每页数量 |
233
+ | SearchKeyWord | string | 否 | 搜索关键字 |
225
234
 
226
235
  ### 站点工具
227
236
 
@@ -239,28 +248,36 @@ Claude配置成功后界面
239
248
  | ---------- | ------ | -------- | ---------------- |
240
249
  | recordName | string | 是 | 要匹配的站点名称 |
241
250
 
242
- #### site_create_dns_type_a_record
251
+ #### site_dns_type_a_record_create
243
252
 
244
253
  **为站点创建 A 记录**
245
254
 
246
255
  | 参数 | 类型 | 是否必需 | 描述 |
247
256
  | ---------- | ------ | -------- | -------------------------------------- |
248
- | recordName | string | 是 | DNS 记录名称(例如,子域名或完整域名) |
249
- | siteId | number | 是 | 站点 ID,从 ListSites 操作获取 |
250
- | data | object | 是 | 带有 value 属性的 DNS 记录数据 |
251
- | data.value | string | 是 | A 记录的 IP 地址(例如,"2.2.2.2") |
257
+ | recordName | string | 是 | DNS 记录名称(如子域名或完整域名) |
258
+ | siteId | number | 是 | 站点 ID(通过 ListSites 获取) |
259
+ | data | object | 是 | DNS 记录数据,需包含 value 属性 |
260
+ | data.value | string | 是 | A 记录的 IP 地址(如 "2.2.2.2") |
252
261
 
253
- #### site_create_dns_cname_domain_record
262
+ #### site_dns_cname_domain_record_create
254
263
 
255
264
  **为站点创建 CNAME 域名记录**
256
265
 
257
266
  | 参数 | 类型 | 是否必需 | 描述 |
258
267
  | ---------- | ------ | -------- | -------------------------------------- |
259
- | recordName | string | 是 | DNS 记录名称(例如,子域名或完整域名) |
260
- | siteId | number | 是 | 站点 ID,从 ListSites 操作获取 |
261
- | data | object | 是 | 带有 value 属性的 DNS 记录数据 |
268
+ | recordName | string | 是 | DNS 记录名称(如子域名或完整域名) |
269
+ | siteId | number | 是 | 站点 ID(通过 ListSites 获取) |
270
+ | data | object | 是 | DNS 记录数据,需包含 value 属性 |
262
271
  | data.value | string | 是 | CNAME 记录的域名值 |
263
272
 
273
+ #### site_record_list
274
+
275
+ **列出站点的所有记录**
276
+
277
+ | 参数 | 类型 | 是否必需 | 描述 |
278
+ | ------ | ------ | -------- | -------------------------- |
279
+ | SiteId | number | 是 | 站点 ID(通过 ListSites 获取) |
280
+
264
281
  ##
265
282
 
266
283
  ## 可用脚本
@@ -8,12 +8,12 @@ import {
8
8
  } from './deploy';
9
9
  import { deployment_delete, DEPLOYMENT_DELETE_TOOL } from './deployments';
10
10
  import {
11
- record_create,
12
- RECORD_CREATE_TOOL,
13
- record_delete,
14
- RECORD_DELETE_TOOL,
15
- record_list,
16
- RECORD_LIST_TOOL,
11
+ er_record_create,
12
+ ER_RECORD_CREATE_TOOL,
13
+ er_record_delete,
14
+ ER_RECORD_DELETE_TOOL,
15
+ er_record_list,
16
+ ER_RECORD_LIST_TOOL,
17
17
  } from './record';
18
18
  import {
19
19
  route_create,
@@ -42,12 +42,14 @@ import {
42
42
  import {
43
43
  site_active_list,
44
44
  SITE_ACTIVE_LIST_TOOL,
45
- SITE_CREATE_DNS_CNAME_DOMAIN_RECORD,
46
- site_create_dns_cname_domain_record,
47
- site_create_dns_type_a_record,
48
- SITE_CREATE_DNS_TYPE_A_RECORD,
45
+ site_dns_cname_domain_record_create,
46
+ SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
47
+ site_dns_type_a_record_create,
48
+ SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
49
49
  site_match,
50
50
  SITE_MATCH_TOOL,
51
+ site_record_list,
52
+ SITE_RECORD_LIST_TOOL,
51
53
  } from './site';
52
54
 
53
55
  export const ESA_OPENAPI_ER_LIST = [
@@ -67,17 +69,22 @@ export const ESA_OPENAPI_ER_LIST = [
67
69
  ROUTE_UPDATE_TOOL,
68
70
  ROUTE_GET_TOOL,
69
71
  SITE_MATCH_TOOL,
70
- RECORD_CREATE_TOOL,
71
- RECORD_DELETE_TOOL,
72
- RECORD_LIST_TOOL,
73
- SITE_CREATE_DNS_TYPE_A_RECORD,
74
- SITE_CREATE_DNS_CNAME_DOMAIN_RECORD,
72
+ ER_RECORD_CREATE_TOOL,
73
+ ER_RECORD_DELETE_TOOL,
74
+ ER_RECORD_LIST_TOOL,
75
+ SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
76
+ SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
77
+ SITE_RECORD_LIST_TOOL,
75
78
  ];
76
79
 
77
80
  export const ESA_OPENAPI_LIST = [...ESA_OPENAPI_ER_LIST];
78
81
  export const routineHandlers: ToolHandlers = {
79
- site_create_dns_type_a_record,
80
- site_create_dns_cname_domain_record,
82
+ site_dns_type_a_record_create,
83
+ site_dns_cname_domain_record_create,
84
+ site_active_list,
85
+ site_match,
86
+ site_route_list,
87
+ site_record_list,
81
88
  routine_create,
82
89
  routine_delete,
83
90
  routine_list,
@@ -87,14 +94,11 @@ export const routineHandlers: ToolHandlers = {
87
94
  routine_route_list,
88
95
  canary_area_list,
89
96
  deployment_delete,
90
- site_active_list,
91
- site_match,
92
- site_route_list,
93
97
  route_create,
94
98
  route_delete,
95
99
  route_update,
96
100
  route_get,
97
- record_create,
98
- record_delete,
99
- record_list,
101
+ er_record_create,
102
+ er_record_delete,
103
+ er_record_list,
100
104
  };
@@ -6,8 +6,8 @@ import {
6
6
  } from '@alicloud/esa20240910';
7
7
  import { ListRoutineRelatedRecordsRequest } from '../utils/types.js';
8
8
 
9
- export const RECORD_CREATE_TOOL: Tool = {
10
- name: 'record_create',
9
+ export const ER_RECORD_CREATE_TOOL: Tool = {
10
+ name: 'er_record_create',
11
11
  description: 'Create a record',
12
12
  inputSchema: {
13
13
  type: 'object',
@@ -29,8 +29,8 @@ export const RECORD_CREATE_TOOL: Tool = {
29
29
  },
30
30
  };
31
31
 
32
- export const RECORD_DELETE_TOOL: Tool = {
33
- name: 'record_delete',
32
+ export const ER_RECORD_DELETE_TOOL: Tool = {
33
+ name: 'er_record_delete',
34
34
  description: 'Delete a record',
35
35
  inputSchema: {
36
36
  type: 'object',
@@ -56,8 +56,8 @@ export const RECORD_DELETE_TOOL: Tool = {
56
56
  },
57
57
  };
58
58
 
59
- export const RECORD_LIST_TOOL: Tool = {
60
- name: 'record_list',
59
+ export const ER_RECORD_LIST_TOOL: Tool = {
60
+ name: 'er_record_list',
61
61
  description: 'List all records',
62
62
  inputSchema: {
63
63
  type: 'object',
@@ -83,7 +83,7 @@ export const RECORD_LIST_TOOL: Tool = {
83
83
  },
84
84
  };
85
85
 
86
- export const record_create = async (request: CallToolRequest) => {
86
+ export const er_record_create = async (request: CallToolRequest) => {
87
87
  const res = await api.createRoutineRelatedRecord(
88
88
  request.params.arguments as CreateRoutineRelatedRecordRequest,
89
89
  );
@@ -94,7 +94,7 @@ export const record_create = async (request: CallToolRequest) => {
94
94
  };
95
95
  };
96
96
 
97
- export const record_delete = async (request: CallToolRequest) => {
97
+ export const er_record_delete = async (request: CallToolRequest) => {
98
98
  const res = await api.deleteRoutineRelatedRecord(
99
99
  request.params.arguments as DeleteRoutineRelatedRecordRequest,
100
100
  );
@@ -104,7 +104,7 @@ export const record_delete = async (request: CallToolRequest) => {
104
104
  };
105
105
  };
106
106
 
107
- export const record_list = async (request: CallToolRequest) => {
107
+ export const er_record_list = async (request: CallToolRequest) => {
108
108
  const res = await api.listRoutineRelatedRecords(
109
109
  request.params.arguments as unknown as ListRoutineRelatedRecordsRequest,
110
110
  );
package/src/tools/site.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js';
2
2
  import api from '../utils/service.js';
3
- import { CreateRecordRequest, ListSitesRequest } from '@alicloud/esa20240910';
3
+ import {
4
+ CreateRecordRequest,
5
+ ListRecordsRequest,
6
+ ListSitesRequest,
7
+ } from '@alicloud/esa20240910';
4
8
  import { GetMatchSiteRequest } from '../utils/types.js';
5
9
 
6
10
  export const SITE_ACTIVE_LIST_TOOL: Tool = {
@@ -28,8 +32,8 @@ export const SITE_MATCH_TOOL: Tool = {
28
32
  },
29
33
  };
30
34
 
31
- export const SITE_CREATE_DNS_TYPE_A_RECORD: Tool = {
32
- name: 'site_create_dns_type_a_record',
35
+ export const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL: Tool = {
36
+ name: 'site_dns_type_a_record_create',
33
37
  description: 'Create a A record for a site.',
34
38
  inputSchema: {
35
39
  type: 'object',
@@ -48,11 +52,8 @@ export const SITE_CREATE_DNS_TYPE_A_RECORD: Tool = {
48
52
  },
49
53
  data: {
50
54
  type: 'object',
51
- data: {
52
- type: 'object',
53
- description:
54
- 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.',
55
- },
55
+ description:
56
+ 'The data for the DNS record, varying by record type. Required.',
56
57
  properties: {
57
58
  value: {
58
59
  type: 'string',
@@ -66,8 +67,8 @@ export const SITE_CREATE_DNS_TYPE_A_RECORD: Tool = {
66
67
  },
67
68
  };
68
69
 
69
- export const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD: Tool = {
70
- name: 'site_create_dns_cname_domain_record',
70
+ export const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL: Tool = {
71
+ name: 'site_dns_cname_domain_record_create',
71
72
  description: 'Create a CNAME domain record for a site.',
72
73
  inputSchema: {
73
74
  type: 'object',
@@ -86,11 +87,8 @@ export const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD: Tool = {
86
87
  },
87
88
  data: {
88
89
  type: 'object',
89
- data: {
90
- type: 'object',
91
- description:
92
- 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.',
93
- },
90
+ description:
91
+ 'The data for the DNS record, varying by record type. Required.',
94
92
  properties: {
95
93
  value: {
96
94
  type: 'string',
@@ -104,265 +102,22 @@ export const SITE_CREATE_DNS_CNAME_DOMAIN_RECORD: Tool = {
104
102
  },
105
103
  };
106
104
 
107
- // export const SITE_CREATE_DNS_RECORD_TOOL: Tool = {
108
- // name: 'site_create_dns_record',
109
- // description:
110
- // 'Create a DNS record for a site. Supports various DNS record types such as A/AAAA, CNAME, MX, TXT, and more, with optional proxying and origin authentication.',
111
- // inputSchema: {
112
- // type: 'object',
113
- // properties: {
114
- // recordName: {
115
- // type: 'string',
116
- // description:
117
- // 'The name of the DNS record (e.g., subdomain or full domain). Required.',
118
- // examples: ['www.example.com', 'sub.example.com'],
119
- // },
120
- // siteId: {
121
- // type: 'number',
122
- // description:
123
- // 'The ID of the site, obtained from the ListSites operation. Required.',
124
- // examples: [1234567890123],
125
- // },
126
- // type: {
127
- // type: 'string',
128
- // description:
129
- // 'The type of the DNS record. Required. Valid values: A, AAAA, CNAME, MX, TXT, NS, CAA, SRV, URI, CERT, SSHFP, SMIMEA, TLSA.',
130
- // enum: [
131
- // 'A',
132
- // 'AAAA',
133
- // 'CNAME',
134
- // 'MX',
135
- // 'TXT',
136
- // 'NS',
137
- // 'CAA',
138
- // 'SRV',
139
- // 'URI',
140
- // 'CERT',
141
- // 'SSHFP',
142
- // 'SMIMEA',
143
- // 'TLSA',
144
- // ],
145
- // examples: ['A', 'CNAME', 'MX'],
146
- // },
147
- // sourceType: {
148
- // type: 'string',
149
- // description:
150
- // 'The type of origin for CNAME records. Required for CNAME records; defaults to "Domain" if not specified. Valid values: OSS, S3, LB, OP, Domain.',
151
- // enum: ['OSS', 'S3', 'LB', 'OP', 'Domain'],
152
- // examples: ['OSS', 'Domain'],
153
- // },
154
- // data: {
155
- // type: 'object',
156
- // description:
157
- // 'The data for the DNS record, varying by record type. Required. See CreateRecordRequestData for field requirements per record type.',
158
- // properties: {
159
- // algorithm: {
160
- // type: 'number',
161
- // description:
162
- // 'The encryption algorithm for CERT or SSHFP records (0-255). Required for CERT, SSHFP.',
163
- // minimum: 0,
164
- // maximum: 255,
165
- // examples: [1],
166
- // },
167
- // certificate: {
168
- // type: 'string',
169
- // description:
170
- // 'The public key of the certificate for CERT, SMIMEA, or TLSA records. Required for these types.',
171
- // examples: ['dGVzdGFkYWxrcw=='],
172
- // },
173
- // fingerprint: {
174
- // type: 'string',
175
- // description:
176
- // 'The public key fingerprint for SSHFP records. Required for SSHFP.',
177
- // examples: ['abcdef1234567890'],
178
- // },
179
- // flag: {
180
- // type: 'number',
181
- // description:
182
- // 'The flag bit for CAA records, indicating priority (0-255). Required for CAA.',
183
- // minimum: 0,
184
- // maximum: 255,
185
- // examples: [128],
186
- // },
187
- // keyTag: {
188
- // type: 'number',
189
- // description:
190
- // 'The public key identification for CAA records (0-65535). Required for CAA.',
191
- // minimum: 0,
192
- // maximum: 65535,
193
- // examples: [0],
194
- // },
195
- // matchingType: {
196
- // type: 'number',
197
- // description:
198
- // 'The algorithm policy for SMIMEA or TLSA records (0-255). Required for these types.',
199
- // minimum: 0,
200
- // maximum: 255,
201
- // examples: [1],
202
- // },
203
- // port: {
204
- // type: 'number',
205
- // description:
206
- // 'The port for SRV records (0-65535). Required for SRV.',
207
- // minimum: 0,
208
- // maximum: 65535,
209
- // examples: [0],
210
- // },
211
- // priority: {
212
- // type: 'number',
213
- // description:
214
- // 'The priority for MX, SRV, or URI records (0-65535, lower is higher priority). Required for these types.',
215
- // minimum: 0,
216
- // maximum: 65535,
217
- // examples: [10],
218
- // },
219
- // selector: {
220
- // type: 'number',
221
- // description:
222
- // 'The certificate or public key type for SMIMEA or TLSA records (0-255). Required for these types.',
223
- // minimum: 0,
224
- // maximum: 255,
225
- // examples: [1],
226
- // },
227
- // tag: {
228
- // type: 'string',
229
- // description:
230
- // 'The label for CAA records. Required for CAA. Valid values: issue, issuewild, iodef.',
231
- // enum: ['issue', 'issuewild', 'iodef'],
232
- // examples: ['issue'],
233
- // },
234
- // type: {
235
- // type: 'number',
236
- // description:
237
- // 'The certificate type (CERT) or public key type (SSHFP). Required for CERT, SSHFP.',
238
- // examples: [1], // Assuming numeric representation; adjust if string like 'RSA' is expected
239
- // },
240
- // usage: {
241
- // type: 'number',
242
- // description:
243
- // 'The usage identifier for SMIMEA or TLSA records (0-255). Required for these types.',
244
- // minimum: 0,
245
- // maximum: 255,
246
- // examples: [1],
247
- // },
248
- // value: {
249
- // type: 'string',
250
- // description:
251
- // 'The record value. Required for A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, URI. Format varies by type (e.g., IP for A/AAAA, domain for CNAME).',
252
- // examples: ['2.2.2.2', 'example.com', 'mail.example.com'],
253
- // },
254
- // weight: {
255
- // type: 'number',
256
- // description:
257
- // 'The weight for SRV or URI records (0-65535). Required for these types.',
258
- // minimum: 0,
259
- // maximum: 65535,
260
- // examples: [0],
261
- // },
262
- // },
263
- // additionalProperties: false,
264
- // examples: [
265
- // { value: '2.2.2.2' }, // A record
266
- // { value: 'example.com', priority: 10 }, // MX record
267
- // { tag: 'issue', value: 'ca.example.com', flag: 128, keyTag: 0 }, // CAA record
268
- // ],
269
- // },
270
- // ttl: {
271
- // type: 'number',
272
- // description:
273
- // 'The TTL of the record in seconds. Set to 1 for system-determined TTL.',
274
- // minimum: 1,
275
- // examples: [30, 1],
276
- // },
277
- // authConf: {
278
- // type: 'object',
279
- // description:
280
- // 'Origin authentication information for CNAME records. Required for OSS or S3 origins with specific auth types.',
281
- // properties: {
282
- // accessKey: {
283
- // type: 'string',
284
- // description:
285
- // 'The access key for OSS (private_cross_account) or S3 (private) origins.',
286
- // examples: ['u0Nkg5gBK*******QF5wvKMM504JUHt'],
287
- // },
288
- // authType: {
289
- // type: 'string',
290
- // description:
291
- // 'The authentication type for OSS or S3 origins. Valid values: public, private, private_same_account, private_cross_account.',
292
- // enum: [
293
- // 'public',
294
- // 'private',
295
- // 'private_same_account',
296
- // 'private_cross_account',
297
- // ],
298
- // examples: ['private'],
299
- // },
300
- // region: {
301
- // type: 'string',
302
- // description:
303
- // 'The region of the S3 origin. Required for S3 origins.',
304
- // examples: ['us-east-1'],
305
- // },
306
- // secretKey: {
307
- // type: 'string',
308
- // description:
309
- // 'The secret access key for OSS (private_same_account) or S3 (private) origins.',
310
- // examples: ['VIxuvJSA2S03f******kp208dy5w7'],
311
- // },
312
- // version: {
313
- // type: 'string',
314
- // description:
315
- // 'The signature algorithm version for S3 (private). Valid values: v2, v4. Defaults to v4.',
316
- // enum: ['v2', 'v4'],
317
- // examples: ['v4'],
318
- // },
319
- // },
320
- // additionalProperties: false,
321
- // examples: [
322
- // { authType: 'public' },
323
- // {
324
- // authType: 'private',
325
- // accessKey: 'u0Nkg5gBK*******QF5wvKMM504JUHt',
326
- // secretKey: 'VIxuvJSA2S03f******kp208dy5w7',
327
- // region: 'us-east-1',
328
- // version: 'v4',
329
- // },
330
- // ],
331
- // },
332
- // proxied: {
333
- // type: 'boolean',
334
- // description:
335
- // 'Whether to proxy the record. Only applicable for CNAME and A/AAAA records.',
336
- // examples: [true, false],
337
- // },
338
- // hostPolicy: {
339
- // type: 'string',
340
- // description:
341
- // 'The origin host policy for CNAME records. Valid values: follow_hostname, follow_origin_domain.',
342
- // enum: ['follow_hostname', 'follow_origin_domain'],
343
- // examples: ['follow_origin_domain'],
344
- // },
345
- // bizName: {
346
- // type: 'string',
347
- // description:
348
- // 'The business scenario for acceleration. Leave empty if not proxied. Valid values: image_video, api, web.',
349
- // enum: ['image_video', 'api', 'web'],
350
- // examples: ['web'],
351
- // },
352
- // comment: {
353
- // type: 'string',
354
- // description:
355
- // 'A comment for the record. Maximum length is 100 characters.',
356
- // maxLength: 100,
357
- // examples: ['This is a remark.'],
358
- // },
359
- // },
360
- // required: ['recordName', 'siteId', 'type', 'data', 'ttl'],
361
- // additionalProperties: false,
362
- // },
363
- // };
105
+ export const SITE_RECORD_LIST_TOOL: Tool = {
106
+ name: 'site_record_list',
107
+ description: 'List all records in a site',
108
+ inputSchema: {
109
+ type: 'object',
110
+ properties: {
111
+ SiteId: {
112
+ type: 'number',
113
+ description:
114
+ 'The ID of the site, obtained from the ListSites operation. Required.',
115
+ },
116
+ },
117
+ },
118
+ };
364
119
 
365
- export const site_create_dns_type_a_record = async (
120
+ export const site_dns_type_a_record_create = async (
366
121
  request: CallToolRequest,
367
122
  ) => {
368
123
  const res = await api.createRecord({
@@ -383,7 +138,7 @@ export const site_create_dns_type_a_record = async (
383
138
  };
384
139
  };
385
140
 
386
- export const site_create_dns_cname_domain_record = async (
141
+ export const site_dns_cname_domain_record_create = async (
387
142
  request: CallToolRequest,
388
143
  ) => {
389
144
  const res = await api.createRecord({
@@ -407,6 +162,21 @@ export const site_create_dns_cname_domain_record = async (
407
162
  };
408
163
  };
409
164
 
165
+ export const site_record_list = async (request: CallToolRequest) => {
166
+ const res = await api.listRecords({
167
+ siteId: request.params.arguments?.SiteId ?? 0,
168
+ } as ListRecordsRequest);
169
+ return {
170
+ content: [
171
+ {
172
+ type: 'text',
173
+ text: JSON.stringify(res),
174
+ },
175
+ ],
176
+ success: true,
177
+ };
178
+ };
179
+
410
180
  export const site_active_list = async () => {
411
181
  const res = await api.listSites({
412
182
  siteSearchType: 'fuzzy',
@@ -23,6 +23,8 @@ import ESA, {
23
23
  GetRoutineRouteResponse,
24
24
  GetRoutineStagingCodeUploadInfoRequest,
25
25
  GetRoutineStagingCodeUploadInfoResponse,
26
+ ListRecordsRequest,
27
+ ListRecordsResponse,
26
28
  ListRoutineRoutesRequest,
27
29
  ListRoutineRoutesResponse,
28
30
  ListSiteRoutesRequest,
@@ -336,7 +338,6 @@ class Client {
336
338
  }
337
339
 
338
340
  createRecord(params: CreateRecordRequest) {
339
- log('createRecord', JSON.stringify(params));
340
341
  const request = new CreateRecordRequest(params);
341
342
  return this.callApi(
342
343
  this.client.createRecord.bind(this.client) as ApiMethod<
@@ -346,6 +347,17 @@ class Client {
346
347
  request,
347
348
  );
348
349
  }
350
+
351
+ listRecords(params: ListRecordsRequest) {
352
+ const request = new ListRecordsRequest(params);
353
+ return this.callApi(
354
+ this.client.listRecords.bind(this.client) as ApiMethod<
355
+ ListRecordsRequest,
356
+ ListRecordsResponse
357
+ >,
358
+ request,
359
+ );
360
+ }
349
361
  }
350
362
 
351
363
  export default new Client();