ncloud-mcp-server 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.
Files changed (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +159 -0
  3. package/README_EN.md +159 -0
  4. package/dist/auth/signature.d.ts +16 -0
  5. package/dist/auth/signature.js +18 -0
  6. package/dist/auth/signature.js.map +1 -0
  7. package/dist/auth/signature.test.d.ts +1 -0
  8. package/dist/auth/signature.test.js +90 -0
  9. package/dist/auth/signature.test.js.map +1 -0
  10. package/dist/client/ncloud-client.d.ts +27 -0
  11. package/dist/client/ncloud-client.js +270 -0
  12. package/dist/client/ncloud-client.js.map +1 -0
  13. package/dist/client/ncloud-client.test.d.ts +1 -0
  14. package/dist/client/ncloud-client.test.js +477 -0
  15. package/dist/client/ncloud-client.test.js.map +1 -0
  16. package/dist/client/s3-compatible-client.d.ts +49 -0
  17. package/dist/client/s3-compatible-client.js +210 -0
  18. package/dist/client/s3-compatible-client.js.map +1 -0
  19. package/dist/client/swift-compatible-client.d.ts +68 -0
  20. package/dist/client/swift-compatible-client.js +173 -0
  21. package/dist/client/swift-compatible-client.js.map +1 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +362 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/tools/acg.d.ts +3 -0
  26. package/dist/tools/acg.js +220 -0
  27. package/dist/tools/acg.js.map +1 -0
  28. package/dist/tools/activity-tracer.d.ts +3 -0
  29. package/dist/tools/activity-tracer.js +77 -0
  30. package/dist/tools/activity-tracer.js.map +1 -0
  31. package/dist/tools/analytics-cdss.d.ts +3 -0
  32. package/dist/tools/analytics-cdss.js +618 -0
  33. package/dist/tools/analytics-cdss.js.map +1 -0
  34. package/dist/tools/analytics-datacatalog.d.ts +10 -0
  35. package/dist/tools/analytics-datacatalog.js +409 -0
  36. package/dist/tools/analytics-datacatalog.js.map +1 -0
  37. package/dist/tools/analytics-dataflow.d.ts +16 -0
  38. package/dist/tools/analytics-dataflow.js +478 -0
  39. package/dist/tools/analytics-dataflow.js.map +1 -0
  40. package/dist/tools/analytics-dataforest.d.ts +10 -0
  41. package/dist/tools/analytics-dataforest.js +379 -0
  42. package/dist/tools/analytics-dataforest.js.map +1 -0
  43. package/dist/tools/analytics-dataquery.d.ts +16 -0
  44. package/dist/tools/analytics-dataquery.js +143 -0
  45. package/dist/tools/analytics-dataquery.js.map +1 -0
  46. package/dist/tools/analytics-datastream.d.ts +13 -0
  47. package/dist/tools/analytics-datastream.js +359 -0
  48. package/dist/tools/analytics-datastream.js.map +1 -0
  49. package/dist/tools/analytics-hadoop.d.ts +12 -0
  50. package/dist/tools/analytics-hadoop.js +450 -0
  51. package/dist/tools/analytics-hadoop.js.map +1 -0
  52. package/dist/tools/analytics-ses.d.ts +3 -0
  53. package/dist/tools/analytics-ses.js +653 -0
  54. package/dist/tools/analytics-ses.js.map +1 -0
  55. package/dist/tools/api-gateway.d.ts +3 -0
  56. package/dist/tools/api-gateway.js +202 -0
  57. package/dist/tools/api-gateway.js.map +1 -0
  58. package/dist/tools/autoscaling.d.ts +3 -0
  59. package/dist/tools/autoscaling.js +430 -0
  60. package/dist/tools/autoscaling.js.map +1 -0
  61. package/dist/tools/billing.d.ts +14 -0
  62. package/dist/tools/billing.js +545 -0
  63. package/dist/tools/billing.js.map +1 -0
  64. package/dist/tools/certificate-manager.d.ts +18 -0
  65. package/dist/tools/certificate-manager.js +84 -0
  66. package/dist/tools/certificate-manager.js.map +1 -0
  67. package/dist/tools/cloud-advisor.d.ts +3 -0
  68. package/dist/tools/cloud-advisor.js +202 -0
  69. package/dist/tools/cloud-advisor.js.map +1 -0
  70. package/dist/tools/cloud-functions.d.ts +3 -0
  71. package/dist/tools/cloud-functions.js +497 -0
  72. package/dist/tools/cloud-functions.js.map +1 -0
  73. package/dist/tools/cloud-insight-integration.d.ts +3 -0
  74. package/dist/tools/cloud-insight-integration.js +90 -0
  75. package/dist/tools/cloud-insight-integration.js.map +1 -0
  76. package/dist/tools/cloud-insight-plugin.d.ts +3 -0
  77. package/dist/tools/cloud-insight-plugin.js +600 -0
  78. package/dist/tools/cloud-insight-plugin.js.map +1 -0
  79. package/dist/tools/cloud-insight-rule.d.ts +3 -0
  80. package/dist/tools/cloud-insight-rule.js +570 -0
  81. package/dist/tools/cloud-insight-rule.js.map +1 -0
  82. package/dist/tools/cloud-insight.d.ts +3 -0
  83. package/dist/tools/cloud-insight.js +246 -0
  84. package/dist/tools/cloud-insight.js.map +1 -0
  85. package/dist/tools/common.d.ts +3 -0
  86. package/dist/tools/common.js +120 -0
  87. package/dist/tools/common.js.map +1 -0
  88. package/dist/tools/compute-initscript.d.ts +3 -0
  89. package/dist/tools/compute-initscript.js +62 -0
  90. package/dist/tools/compute-initscript.js.map +1 -0
  91. package/dist/tools/compute-loginkey.d.ts +3 -0
  92. package/dist/tools/compute-loginkey.js +59 -0
  93. package/dist/tools/compute-loginkey.js.map +1 -0
  94. package/dist/tools/compute-placement.d.ts +3 -0
  95. package/dist/tools/compute-placement.js +196 -0
  96. package/dist/tools/compute-placement.js.map +1 -0
  97. package/dist/tools/compute-publicip.d.ts +3 -0
  98. package/dist/tools/compute-publicip.js +97 -0
  99. package/dist/tools/compute-publicip.js.map +1 -0
  100. package/dist/tools/compute-server.d.ts +3 -0
  101. package/dist/tools/compute-server.js +445 -0
  102. package/dist/tools/compute-server.js.map +1 -0
  103. package/dist/tools/compute-server.test.d.ts +1 -0
  104. package/dist/tools/compute-server.test.js +224 -0
  105. package/dist/tools/compute-server.test.js.map +1 -0
  106. package/dist/tools/compute-storage.d.ts +3 -0
  107. package/dist/tools/compute-storage.js +240 -0
  108. package/dist/tools/compute-storage.js.map +1 -0
  109. package/dist/tools/containers-nks.d.ts +13 -0
  110. package/dist/tools/containers-nks.js +576 -0
  111. package/dist/tools/containers-nks.js.map +1 -0
  112. package/dist/tools/containers-registry.d.ts +3 -0
  113. package/dist/tools/containers-registry.js +181 -0
  114. package/dist/tools/containers-registry.js.map +1 -0
  115. package/dist/tools/database-cache.d.ts +3 -0
  116. package/dist/tools/database-cache.js +388 -0
  117. package/dist/tools/database-cache.js.map +1 -0
  118. package/dist/tools/database-mongodb.d.ts +3 -0
  119. package/dist/tools/database-mongodb.js +460 -0
  120. package/dist/tools/database-mongodb.js.map +1 -0
  121. package/dist/tools/database-mssql.d.ts +3 -0
  122. package/dist/tools/database-mssql.js +345 -0
  123. package/dist/tools/database-mssql.js.map +1 -0
  124. package/dist/tools/database-mysql.d.ts +3 -0
  125. package/dist/tools/database-mysql.js +500 -0
  126. package/dist/tools/database-mysql.js.map +1 -0
  127. package/dist/tools/database-postgresql.d.ts +3 -0
  128. package/dist/tools/database-postgresql.js +432 -0
  129. package/dist/tools/database-postgresql.js.map +1 -0
  130. package/dist/tools/global-dns.d.ts +3 -0
  131. package/dist/tools/global-dns.js +207 -0
  132. package/dist/tools/global-dns.js.map +1 -0
  133. package/dist/tools/global-edge.d.ts +3 -0
  134. package/dist/tools/global-edge.js +386 -0
  135. package/dist/tools/global-edge.js.map +1 -0
  136. package/dist/tools/global-traffic-manager.d.ts +3 -0
  137. package/dist/tools/global-traffic-manager.js +497 -0
  138. package/dist/tools/global-traffic-manager.js.map +1 -0
  139. package/dist/tools/index.d.ts +63 -0
  140. package/dist/tools/index.js +64 -0
  141. package/dist/tools/index.js.map +1 -0
  142. package/dist/tools/kms.d.ts +8 -0
  143. package/dist/tools/kms.js +529 -0
  144. package/dist/tools/kms.js.map +1 -0
  145. package/dist/tools/loadbalancer.d.ts +3 -0
  146. package/dist/tools/loadbalancer.js +341 -0
  147. package/dist/tools/loadbalancer.js.map +1 -0
  148. package/dist/tools/log-analytics.d.ts +3 -0
  149. package/dist/tools/log-analytics.js +183 -0
  150. package/dist/tools/log-analytics.js.map +1 -0
  151. package/dist/tools/media-imageoptimizer.d.ts +3 -0
  152. package/dist/tools/media-imageoptimizer.js +187 -0
  153. package/dist/tools/media-imageoptimizer.js.map +1 -0
  154. package/dist/tools/media-livestation.d.ts +3 -0
  155. package/dist/tools/media-livestation.js +252 -0
  156. package/dist/tools/media-livestation.js.map +1 -0
  157. package/dist/tools/media-vodstation.d.ts +3 -0
  158. package/dist/tools/media-vodstation.js +197 -0
  159. package/dist/tools/media-vodstation.js.map +1 -0
  160. package/dist/tools/nat-gateway.d.ts +3 -0
  161. package/dist/tools/nat-gateway.js +91 -0
  162. package/dist/tools/nat-gateway.js.map +1 -0
  163. package/dist/tools/network-acl.d.ts +3 -0
  164. package/dist/tools/network-acl.js +322 -0
  165. package/dist/tools/network-acl.js.map +1 -0
  166. package/dist/tools/network-interface.d.ts +3 -0
  167. package/dist/tools/network-interface.js +193 -0
  168. package/dist/tools/network-interface.js.map +1 -0
  169. package/dist/tools/private-ca.d.ts +8 -0
  170. package/dist/tools/private-ca.js +368 -0
  171. package/dist/tools/private-ca.js.map +1 -0
  172. package/dist/tools/resource-manager.d.ts +3 -0
  173. package/dist/tools/resource-manager.js +151 -0
  174. package/dist/tools/resource-manager.js.map +1 -0
  175. package/dist/tools/route-table.d.ts +3 -0
  176. package/dist/tools/route-table.js +205 -0
  177. package/dist/tools/route-table.js.map +1 -0
  178. package/dist/tools/security-monitoring.d.ts +3 -0
  179. package/dist/tools/security-monitoring.js +182 -0
  180. package/dist/tools/security-monitoring.js.map +1 -0
  181. package/dist/tools/sens.d.ts +3 -0
  182. package/dist/tools/sens.js +240 -0
  183. package/dist/tools/sens.js.map +1 -0
  184. package/dist/tools/sourcebuild.d.ts +3 -0
  185. package/dist/tools/sourcebuild.js +481 -0
  186. package/dist/tools/sourcebuild.js.map +1 -0
  187. package/dist/tools/sourcecommit.d.ts +13 -0
  188. package/dist/tools/sourcecommit.js +228 -0
  189. package/dist/tools/sourcecommit.js.map +1 -0
  190. package/dist/tools/sourcedeploy.d.ts +3 -0
  191. package/dist/tools/sourcedeploy.js +448 -0
  192. package/dist/tools/sourcedeploy.js.map +1 -0
  193. package/dist/tools/sourcepipeline.d.ts +12 -0
  194. package/dist/tools/sourcepipeline.js +357 -0
  195. package/dist/tools/sourcepipeline.js.map +1 -0
  196. package/dist/tools/storage-archive.d.ts +3 -0
  197. package/dist/tools/storage-archive.js +337 -0
  198. package/dist/tools/storage-archive.js.map +1 -0
  199. package/dist/tools/storage-nas.d.ts +3 -0
  200. package/dist/tools/storage-nas.js +288 -0
  201. package/dist/tools/storage-nas.js.map +1 -0
  202. package/dist/tools/storage-ncloud.d.ts +3 -0
  203. package/dist/tools/storage-ncloud.js +864 -0
  204. package/dist/tools/storage-ncloud.js.map +1 -0
  205. package/dist/tools/storage-object.d.ts +3 -0
  206. package/dist/tools/storage-object.js +982 -0
  207. package/dist/tools/storage-object.js.map +1 -0
  208. package/dist/tools/sub-account.d.ts +3 -0
  209. package/dist/tools/sub-account.js +311 -0
  210. package/dist/tools/sub-account.js.map +1 -0
  211. package/dist/tools/target-group.d.ts +3 -0
  212. package/dist/tools/target-group.js +207 -0
  213. package/dist/tools/target-group.js.map +1 -0
  214. package/dist/tools/vpc-peering.d.ts +3 -0
  215. package/dist/tools/vpc-peering.js +109 -0
  216. package/dist/tools/vpc-peering.js.map +1 -0
  217. package/dist/tools/vpc.d.ts +3 -0
  218. package/dist/tools/vpc.js +194 -0
  219. package/dist/tools/vpc.js.map +1 -0
  220. package/package.json +53 -0
@@ -0,0 +1,207 @@
1
+ import { z } from "zod";
2
+ export function registerGlobalDnsTools(server, client) {
3
+ // ─── Domain Management Tools ─────────────────────────────────────────────────
4
+ server.tool("ncloud_dns_list_domains", "List Global DNS domains with pagination. Returns Spring Page structure (content, pageable, totalElements).", {
5
+ page: z.number({ required_error: "필수 파라미터 'page'가 누락되었습니다." }).describe("Page number (0-based)"),
6
+ size: z.number({ required_error: "필수 파라미터 'size'가 누락되었습니다." }).describe("Number of items per page"),
7
+ domainName: z.string().optional().describe("Filter by domain name"),
8
+ }, async (params) => {
9
+ try {
10
+ const queryParams = {
11
+ page: String(params.page),
12
+ size: String(params.size),
13
+ };
14
+ if (params.domainName !== undefined) {
15
+ queryParams.domainName = params.domainName;
16
+ }
17
+ const result = await client.requestRaw("GET", "/dns/v1/ncpdns/domain", queryParams);
18
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
19
+ }
20
+ catch (error) {
21
+ return { content: [{ type: "text", text: error.message }], isError: true };
22
+ }
23
+ });
24
+ server.tool("ncloud_dns_get_domain_detail", "Get detailed information about a specific Global DNS domain", {
25
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to query"),
26
+ }, async (params) => {
27
+ try {
28
+ const result = await client.requestRaw("GET", `/dns/v1/ncpdns/domain/${params.domainId}`);
29
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
30
+ }
31
+ catch (error) {
32
+ return { content: [{ type: "text", text: error.message }], isError: true };
33
+ }
34
+ });
35
+ server.tool("ncloud_dns_create_domain", "Create a new Global DNS domain", {
36
+ name: z.string({ required_error: "필수 파라미터 'name'이 누락되었습니다." }).describe("Domain name (e.g., example.com)"),
37
+ comment: z.string().optional().describe("Optional comment for the domain"),
38
+ }, async (params) => {
39
+ try {
40
+ const body = { name: params.name };
41
+ if (params.comment !== undefined) {
42
+ body.comment = params.comment;
43
+ }
44
+ const result = await client.requestRaw("POST", "/dns/v1/ncpdns/domain", undefined, body);
45
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
46
+ }
47
+ catch (error) {
48
+ return { content: [{ type: "text", text: error.message }], isError: true };
49
+ }
50
+ });
51
+ server.tool("ncloud_dns_delete_domain", "⚠️ Destructive: Permanently delete a Global DNS domain. All records under this domain will be removed. Set confirm=true to execute.", {
52
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to delete"),
53
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
54
+ }, async (params) => {
55
+ try {
56
+ if (!params.confirm) {
57
+ const message = `⚠️ This will permanently delete Global DNS Domain [${params.domainId}] and all associated records.\n\nTo execute, call this tool again with confirm=true.`;
58
+ return { content: [{ type: "text", text: message }] };
59
+ }
60
+ const result = await client.requestRaw("DELETE", `/dns/v1/ncpdns/domain/${params.domainId}`);
61
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
62
+ }
63
+ catch (error) {
64
+ return { content: [{ type: "text", text: error.message }], isError: true };
65
+ }
66
+ });
67
+ server.tool("ncloud_dns_apply_domain", "Apply pending changes to a Global DNS domain (publish DNS records)", {
68
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to apply"),
69
+ }, async (params) => {
70
+ try {
71
+ const result = await client.requestRaw("PUT", `/dns/v1/ncpdns/domain/${params.domainId}/apply`);
72
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
73
+ }
74
+ catch (error) {
75
+ return { content: [{ type: "text", text: error.message }], isError: true };
76
+ }
77
+ });
78
+ server.tool("ncloud_dns_rollback_domain", "⚠️ Destructive: Rollback a Global DNS domain to the previously applied state. Pending changes will be discarded. Set confirm=true to execute.", {
79
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to rollback"),
80
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
81
+ }, async (params) => {
82
+ try {
83
+ if (!params.confirm) {
84
+ const message = `⚠️ This will rollback Global DNS Domain [${params.domainId}] to the previously applied state. All pending changes will be discarded.\n\nTo execute, call this tool again with confirm=true.`;
85
+ return { content: [{ type: "text", text: message }] };
86
+ }
87
+ const result = await client.requestRaw("PUT", `/dns/v1/ncpdns/domain/${params.domainId}/rollback`);
88
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
89
+ }
90
+ catch (error) {
91
+ return { content: [{ type: "text", text: error.message }], isError: true };
92
+ }
93
+ });
94
+ // ─── Record Management Tools ──────────────────────────────────────────────────
95
+ server.tool("ncloud_dns_list_records", "List DNS records for a specific Global DNS domain with pagination", {
96
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to list records for"),
97
+ page: z.number({ required_error: "필수 파라미터 'page'가 누락되었습니다." }).describe("Page number (0-based)"),
98
+ size: z.number({ required_error: "필수 파라미터 'size'가 누락되었습니다." }).describe("Number of items per page"),
99
+ recordType: z.enum(["A", "AAAA", "CNAME", "MX", "PTR", "SPF", "TXT", "NS", "SRV", "CAA", "DS"]).optional().describe("Filter by record type"),
100
+ searchContent: z.string().optional().describe("Search filter for record content"),
101
+ }, async (params) => {
102
+ try {
103
+ const queryParams = {
104
+ page: String(params.page),
105
+ size: String(params.size),
106
+ };
107
+ if (params.recordType !== undefined) {
108
+ queryParams.recordType = params.recordType;
109
+ }
110
+ if (params.searchContent !== undefined) {
111
+ queryParams.searchContent = params.searchContent;
112
+ }
113
+ const result = await client.requestRaw("GET", `/dns/v1/ncpdns/record/${params.domainId}`, queryParams);
114
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
115
+ }
116
+ catch (error) {
117
+ return { content: [{ type: "text", text: error.message }], isError: true };
118
+ }
119
+ });
120
+ server.tool("ncloud_dns_create_records", "Create DNS records for a specific Global DNS domain", {
121
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to create records for"),
122
+ records: z.array(z.object({
123
+ host: z.string().describe("Record host name"),
124
+ type: z.string().describe("Record type (A, AAAA, CNAME, MX, PTR, SPF, TXT, NS, SRV, CAA, DS)"),
125
+ content: z.string().describe("Record content/value"),
126
+ ttl: z.number().describe("TTL in seconds"),
127
+ aliasId: z.number().optional().describe("Alias ID (optional)"),
128
+ lbId: z.number().optional().describe("Load Balancer ID (optional)"),
129
+ lbRegionCode: z.string().optional().describe("Load Balancer region code (optional)"),
130
+ }), { required_error: "필수 파라미터 'records'가 누락되었습니다." }).describe("Array of DNS records to create"),
131
+ }, async (params) => {
132
+ try {
133
+ const result = await client.requestRaw("POST", `/dns/v1/ncpdns/record/${params.domainId}`, undefined, params.records);
134
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
135
+ }
136
+ catch (error) {
137
+ return { content: [{ type: "text", text: error.message }], isError: true };
138
+ }
139
+ });
140
+ server.tool("ncloud_dns_update_records", "Update DNS records for a specific Global DNS domain", {
141
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to update records for"),
142
+ records: z.array(z.object({
143
+ id: z.number().describe("Record ID to update"),
144
+ host: z.string().describe("Record host name"),
145
+ type: z.string().describe("Record type (A, AAAA, CNAME, MX, PTR, SPF, TXT, NS, SRV, CAA, DS)"),
146
+ content: z.string().describe("Record content/value"),
147
+ ttl: z.number().describe("TTL in seconds"),
148
+ aliasId: z.number().optional().describe("Alias ID (optional)"),
149
+ lbId: z.number().optional().describe("Load Balancer ID (optional)"),
150
+ lbRegionCode: z.string().optional().describe("Load Balancer region code (optional)"),
151
+ }), { required_error: "필수 파라미터 'records'가 누락되었습니다." }).describe("Array of DNS records to update"),
152
+ }, async (params) => {
153
+ try {
154
+ const result = await client.requestRaw("PUT", `/dns/v1/ncpdns/record/${params.domainId}`, undefined, params.records);
155
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
156
+ }
157
+ catch (error) {
158
+ return { content: [{ type: "text", text: error.message }], isError: true };
159
+ }
160
+ });
161
+ server.tool("ncloud_dns_delete_records", "⚠️ Destructive: Delete DNS records from a Global DNS domain. This permanently removes the specified records. Set confirm=true to execute.", {
162
+ domainId: z.number({ required_error: "필수 파라미터 'domainId'가 누락되었습니다." }).describe("Domain ID to delete records from"),
163
+ recordIds: z.array(z.number(), { required_error: "필수 파라미터 'recordIds'가 누락되었습니다." }).describe("Array of record IDs to delete"),
164
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
165
+ }, async (params) => {
166
+ try {
167
+ if (!params.confirm) {
168
+ const message = `⚠️ This will permanently delete ${params.recordIds.length} DNS record(s) from Domain [${params.domainId}].\n\nTo execute, call this tool again with confirm=true.`;
169
+ return { content: [{ type: "text", text: message }] };
170
+ }
171
+ const result = await client.requestRaw("DELETE", `/dns/v1/ncpdns/record/${params.domainId}`, undefined, { recordIds: params.recordIds });
172
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
173
+ }
174
+ catch (error) {
175
+ return { content: [{ type: "text", text: error.message }], isError: true };
176
+ }
177
+ });
178
+ server.tool("ncloud_dns_list_lb_records", "List available Load Balancer records for Global DNS integration", {}, async () => {
179
+ try {
180
+ const result = await client.requestRaw("GET", "/dns/v1/ncpdns/record/lb");
181
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
182
+ }
183
+ catch (error) {
184
+ return { content: [{ type: "text", text: error.message }], isError: true };
185
+ }
186
+ });
187
+ // ─── Monitoring Tools ─────────────────────────────────────────────────────────
188
+ server.tool("ncloud_dns_get_query_count", "Get DNS query count monitoring data for Global DNS domains", {
189
+ baseTimeUnit: z.enum(["MINUTE_1", "MINUTE_5", "MINUTE_30", "HOUR_3", "DAY_1"], { required_error: "필수 파라미터 'baseTimeUnit'이 누락되었습니다." }).describe("Time unit for aggregation"),
190
+ domainId: z.number().optional().describe("Filter by specific domain ID"),
191
+ }, async (params) => {
192
+ try {
193
+ const queryParams = {
194
+ baseTimeUnit: params.baseTimeUnit,
195
+ };
196
+ if (params.domainId !== undefined) {
197
+ queryParams.domainId = String(params.domainId);
198
+ }
199
+ const result = await client.requestRaw("GET", "/dns/v1/ncpdns/domain/monitoring", queryParams);
200
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
201
+ }
202
+ catch (error) {
203
+ return { content: [{ type: "text", text: error.message }], isError: true };
204
+ }
205
+ });
206
+ }
207
+ //# sourceMappingURL=global-dns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-dns.js","sourceRoot":"","sources":["../../src/tools/global-dns.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,sBAAsB,C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AC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACtF,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { NcloudClient } from "../client/ncloud-client.js";
3
+ export declare function registerGlobalEdgeTools(server: McpServer, client: NcloudClient): void;
@@ -0,0 +1,386 @@
1
+ import { z } from "zod";
2
+ export function registerGlobalEdgeTools(server, client) {
3
+ // ─── Profile Query Tools ───────────────────────────────────────────────────
4
+ server.tool("ncloud_edge_list_profiles", "List all Global Edge CDN profiles", {
5
+ pageNo: z.number().optional().describe("Page number for pagination (default 1)"),
6
+ pageSize: z.number().optional().describe("Number of items per page (default 15)"),
7
+ }, async (params) => {
8
+ try {
9
+ const result = await client.request("/api/v1/profiles", params);
10
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
11
+ }
12
+ catch (error) {
13
+ return { content: [{ type: "text", text: error.message }], isError: true };
14
+ }
15
+ });
16
+ server.tool("ncloud_edge_get_profile", "Get detailed information about a specific Global Edge profile", {
17
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID to query"),
18
+ }, async (params) => {
19
+ try {
20
+ const result = await client.request(`/api/v1/profiles/${params.profileId}`);
21
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
22
+ }
23
+ catch (error) {
24
+ return { content: [{ type: "text", text: error.message }], isError: true };
25
+ }
26
+ });
27
+ // ─── Profile Management Tools ────────────────────────────────────────────────
28
+ server.tool("ncloud_edge_create_profile", "Create a new Global Edge CDN profile", {
29
+ profileName: z.string({ required_error: "필수 파라미터 'profileName'이 누락되었습니다." }).describe("Name for the new Global Edge profile"),
30
+ }, async (params) => {
31
+ try {
32
+ const body = { profileName: params.profileName };
33
+ const result = await client.postRequest("/api/v1/profiles", body);
34
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
35
+ }
36
+ catch (error) {
37
+ return { content: [{ type: "text", text: error.message }], isError: true };
38
+ }
39
+ });
40
+ server.tool("ncloud_edge_delete_profile", "⚠️ Destructive: Permanently delete a Global Edge CDN profile. All edges under this profile must be deleted first. Set confirm=true to execute.", {
41
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID to delete"),
42
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
43
+ }, async (params) => {
44
+ try {
45
+ if (!params.confirm) {
46
+ const message = `⚠️ This will permanently delete Global Edge Profile [${params.profileId}]. All edges under this profile must be deleted first.\n\nTo execute, call this tool again with confirm=true.`;
47
+ return { content: [{ type: "text", text: message }] };
48
+ }
49
+ const result = await client.deleteRequest(`/api/v1/profiles/${params.profileId}`);
50
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
51
+ }
52
+ catch (error) {
53
+ return { content: [{ type: "text", text: error.message }], isError: true };
54
+ }
55
+ });
56
+ // ─── Edge Query Tools ──────────────────────────────────────────────────────
57
+ server.tool("ncloud_edge_list_edges", "List all edges under a specific Global Edge profile", {
58
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID to list edges for"),
59
+ pageNo: z.number().optional().describe("Page number for pagination (default 1)"),
60
+ pageSize: z.number().optional().describe("Number of items per page (default 15)"),
61
+ }, async (params) => {
62
+ try {
63
+ const { profileId, ...queryParams } = params;
64
+ const result = await client.request("/api/v1/cdn-edges", { profileId, ...queryParams });
65
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
66
+ }
67
+ catch (error) {
68
+ return { content: [{ type: "text", text: error.message }], isError: true };
69
+ }
70
+ });
71
+ server.tool("ncloud_edge_get_edge", "Get detailed configuration of a specific Global Edge CDN edge including origin, caching, and access control settings", {
72
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to query"),
73
+ }, async (params) => {
74
+ try {
75
+ const result = await client.request(`/api/v1/cdn-edge/${params.edgeId}`);
76
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
77
+ }
78
+ catch (error) {
79
+ return { content: [{ type: "text", text: error.message }], isError: true };
80
+ }
81
+ });
82
+ // ─── Edge Create Tool ──────────────────────────────────────────────────────
83
+ server.tool("ncloud_edge_create_edge", "Create a new Global Edge CDN edge with origin, caching, and distribution settings. Use dryRun=true to preview without creating.", {
84
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID to create the edge under"),
85
+ edgeName: z.string({ required_error: "필수 파라미터 'edgeName'이 누락되었습니다." }).describe("Edge name (3-35 chars, letters, numbers, '-', '_')"),
86
+ protocolType: z.enum(["HTTP", "HTTPS", "ALL"]).describe("Service protocol type"),
87
+ regionType: z.enum(["KOREA", "JAPAN", "GLOBAL"]).describe("Service area (KOREA, JAPAN, or GLOBAL)"),
88
+ serviceDomainType: z.enum(["NCP_DOMAIN_AUTO", "NCP_DOMAIN_CUSTOM", "CUSTOM_DOMAIN"]).describe("Service domain type"),
89
+ serviceDomainName: z.string().optional().describe("Domain name (required for NCP_DOMAIN_CUSTOM or CUSTOM_DOMAIN)"),
90
+ certificateSlotId: z.number().optional().describe("Certificate slot ID (required for CUSTOM_DOMAIN with HTTPS)"),
91
+ originType: z.enum(["OBJECT_STORAGE", "LOAD_BALANCER", "API_GATEWAY", "CUSTOM"]).describe("Origin server type"),
92
+ originRegion: z.string().optional().describe("Origin region (required for OBJECT_STORAGE or LOAD_BALANCER)"),
93
+ originBucketName: z.string().optional().describe("Origin bucket name (required for OBJECT_STORAGE)"),
94
+ originCustomLocation: z.string().optional().describe("Origin domain name (required for LOAD_BALANCER, API_GATEWAY, or CUSTOM)"),
95
+ originProtocolType: z.enum(["HTTP", "HTTPS"]).optional().default("HTTP").describe("Origin protocol type"),
96
+ originPort: z.number().optional().default(80).describe("Origin port number"),
97
+ dryRun: z.boolean().optional().default(false).describe("If true, returns a preview without actually creating the edge"),
98
+ }, async (params) => {
99
+ try {
100
+ if (params.dryRun) {
101
+ const preview = {
102
+ label: "🔍 Dry-Run Preview: Global Edge Creation",
103
+ profileId: params.profileId,
104
+ edgeName: params.edgeName,
105
+ protocolType: params.protocolType,
106
+ regionType: params.regionType,
107
+ serviceDomainType: params.serviceDomainType,
108
+ serviceDomainName: params.serviceDomainName || "(auto-generated)",
109
+ originType: params.originType,
110
+ originLocation: params.originBucketName || params.originCustomLocation || "(not specified)",
111
+ message: "이 요청은 실제 엣지를 생성하지 않습니다. dryRun=false로 호출하면 엣지가 생성됩니다.",
112
+ };
113
+ return { content: [{ type: "text", text: JSON.stringify(preview, null, 2) }] };
114
+ }
115
+ const body = {
116
+ profileId: params.profileId,
117
+ edgeName: params.edgeName,
118
+ distributionConfig: {
119
+ protocolType: params.protocolType,
120
+ regionType: params.regionType,
121
+ serviceDomain: {
122
+ domainType: params.serviceDomainType,
123
+ domainName: params.serviceDomainName || null,
124
+ certificate: params.certificateSlotId ? { id: params.certificateSlotId } : null,
125
+ },
126
+ edgeLogging: { enabled: false },
127
+ },
128
+ originalCopyConfig: {
129
+ originalCopyLocation: {
130
+ type: params.originType,
131
+ region: params.originRegion || null,
132
+ bucketName: params.originBucketName || null,
133
+ customLocation: params.originCustomLocation || null,
134
+ },
135
+ forwardHostHeader: {
136
+ type: "INCOMING_HOST_HEADER",
137
+ customHostHeader: null,
138
+ },
139
+ originalCopyProtocol: {
140
+ type: params.originProtocolType,
141
+ port: params.originPort,
142
+ },
143
+ originalCopyPath: null,
144
+ },
145
+ cachingConfig: {
146
+ defaultCaching: {
147
+ enabled: true,
148
+ ruleDefinitionType: "CACHING",
149
+ cacheRevalidateConfig: {
150
+ type: "IF_POSSIBLE",
151
+ ageType: "DAYS",
152
+ age: 7,
153
+ },
154
+ },
155
+ negativeTtl: true,
156
+ bypassQueryString: { enabled: false },
157
+ cacheKeyHostname: "INCOMING_HOST_HEADER",
158
+ cacheKeyIgnoreQueryString: { type: "ALL_ALLOWED" },
159
+ removeVaryHeader: true,
160
+ edgeAuth: { enabled: false },
161
+ cachingRules: [],
162
+ },
163
+ managedRule: {
164
+ cors: false,
165
+ http2: true,
166
+ trueClientIpHeader: false,
167
+ hsts: false,
168
+ },
169
+ headerPolicies: [],
170
+ optimizationConfig: {
171
+ httpCompression: true,
172
+ largeFileOptimization: true,
173
+ headerMaxSize: {
174
+ singleSize: "SIZE_16KB",
175
+ totalSize: "SIZE_32KB",
176
+ },
177
+ },
178
+ accessControl: {
179
+ type: "WHITELIST",
180
+ ipPolicies: [],
181
+ geoPolicies: [],
182
+ refererPolicies: [],
183
+ },
184
+ };
185
+ const result = await client.postRequest("/api/v1/cdn-edges", body);
186
+ const summary = {
187
+ 리소스타입: "Global Edge",
188
+ 엣지명: params.edgeName,
189
+ 프로필ID: params.profileId,
190
+ 서비스영역: params.regionType,
191
+ 프로토콜: params.protocolType,
192
+ 오리진타입: params.originType,
193
+ 상태: "creating",
194
+ edgeId: result?.result?.edgeId || result?.edgeId,
195
+ };
196
+ return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
197
+ }
198
+ catch (error) {
199
+ return { content: [{ type: "text", text: error.message }], isError: true };
200
+ }
201
+ });
202
+ // ─── Edge Edit Tool ────────────────────────────────────────────────────────
203
+ server.tool("ncloud_edge_edit_edge", "Edit an existing Global Edge CDN edge configuration. Provide the full edge configuration as a JSON object.", {
204
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to edit"),
205
+ configuration: z.string({ required_error: "필수 파라미터 'configuration'이 누락되었습니다." }).describe("Full edge configuration as JSON string (get current config from ncloud_edge_get_edge, modify, and pass here)"),
206
+ }, async (params) => {
207
+ try {
208
+ let config;
209
+ try {
210
+ config = JSON.parse(params.configuration);
211
+ }
212
+ catch {
213
+ return {
214
+ content: [{ type: "text", text: "잘못된 파라미터: 'configuration'은 유효한 JSON 문자열이어야 합니다." }],
215
+ isError: true,
216
+ };
217
+ }
218
+ const result = await client.putRequest(`/api/v1/cdn-edges/${params.edgeId}`, config);
219
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
220
+ }
221
+ catch (error) {
222
+ return { content: [{ type: "text", text: error.message }], isError: true };
223
+ }
224
+ });
225
+ // ─── Edge Delete Tool ──────────────────────────────────────────────────────
226
+ server.tool("ncloud_edge_delete_edge", "⚠️ Destructive: Permanently delete a Global Edge CDN edge. The edge must be in Stopped status. Set confirm=true to execute.", {
227
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to delete"),
228
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
229
+ }, async (params) => {
230
+ try {
231
+ if (!params.confirm) {
232
+ const message = `⚠️ This will permanently delete Global Edge [${params.edgeId}]. The edge must be in Stopped status. All cached content will be purged.\n\nTo execute, call this tool again with confirm=true.`;
233
+ return { content: [{ type: "text", text: message }] };
234
+ }
235
+ const result = await client.deleteRequest(`/api/v1/cdn-edges/${params.edgeId}`);
236
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
237
+ }
238
+ catch (error) {
239
+ return { content: [{ type: "text", text: error.message }], isError: true };
240
+ }
241
+ });
242
+ // ─── Purge Tool ────────────────────────────────────────────────────────────
243
+ server.tool("ncloud_edge_purge", "Run a cache purge (invalidation) on a Global Edge CDN edge. Supports purging all content, by directory, pattern, or specific URLs.", {
244
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to purge cache for"),
245
+ purgeType: z.enum(["ALL", "DIRECTORY", "PATTERN", "URL"]).describe("Purge type: ALL (purge everything), DIRECTORY (by directory path), PATTERN (directory + extension), URL (specific files)"),
246
+ purgeTarget: z.array(z.string()).optional().describe("Purge target list (omit for ALL type). DIRECTORY: /path/*, PATTERN: /path/*.ext, URL: /path/file.ext"),
247
+ }, async (params) => {
248
+ try {
249
+ const body = {
250
+ edgeId: params.edgeId,
251
+ purgeType: params.purgeType,
252
+ };
253
+ if (params.purgeType !== "ALL" && params.purgeTarget) {
254
+ body.purgeTarget = params.purgeTarget;
255
+ }
256
+ const result = await client.postRequest("/api/v1/purge", body);
257
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
258
+ }
259
+ catch (error) {
260
+ return { content: [{ type: "text", text: error.message }], isError: true };
261
+ }
262
+ });
263
+ // ─── Edge Operation Tools ────────────────────────────────────────────────────
264
+ server.tool("ncloud_edge_start_edge", "Start (restart) a stopped Global Edge CDN edge to resume content delivery", {
265
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID that the edge belongs to"),
266
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to start"),
267
+ }, async (params) => {
268
+ try {
269
+ const result = await client.postRequest(`/api/v1/profiles/${params.profileId}/cdn-edges/${params.edgeId}/start`, {});
270
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
271
+ }
272
+ catch (error) {
273
+ return { content: [{ type: "text", text: error.message }], isError: true };
274
+ }
275
+ });
276
+ server.tool("ncloud_edge_stop_edge", "Stop a running Global Edge CDN edge. Stopped edges do not serve content.", {
277
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID that the edge belongs to"),
278
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to stop"),
279
+ }, async (params) => {
280
+ try {
281
+ const result = await client.postRequest(`/api/v1/profiles/${params.profileId}/cdn-edges/${params.edgeId}/stop`, {});
282
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
283
+ }
284
+ catch (error) {
285
+ return { content: [{ type: "text", text: error.message }], isError: true };
286
+ }
287
+ });
288
+ server.tool("ncloud_edge_get_edge_status", "Get the current operational status of a Global Edge CDN edge", {
289
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID that the edge belongs to"),
290
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to check status for"),
291
+ }, async (params) => {
292
+ try {
293
+ const result = await client.request(`/api/v1/profiles/${params.profileId}/cdn-edges/${params.edgeId}/status`);
294
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
295
+ }
296
+ catch (error) {
297
+ return { content: [{ type: "text", text: error.message }], isError: true };
298
+ }
299
+ });
300
+ server.tool("ncloud_edge_get_edge_stats", "Get traffic statistics for a Global Edge CDN edge within a specified time range", {
301
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID that the edge belongs to"),
302
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to get statistics for"),
303
+ startDateTime: z.string({ required_error: "필수 파라미터 'startDateTime'이 누락되었습니다." }).describe("Start date-time for statistics (ISO 8601 format, e.g. 2024-01-01T00:00:00Z)"),
304
+ endDateTime: z.string({ required_error: "필수 파라미터 'endDateTime'이 누락되었습니다." }).describe("End date-time for statistics (ISO 8601 format, e.g. 2024-01-02T00:00:00Z)"),
305
+ }, async (params) => {
306
+ try {
307
+ const result = await client.request(`/api/v1/profiles/${params.profileId}/cdn-edges/${params.edgeId}/stats`, {
308
+ startDateTime: params.startDateTime,
309
+ endDateTime: params.endDateTime,
310
+ });
311
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
312
+ }
313
+ catch (error) {
314
+ return { content: [{ type: "text", text: error.message }], isError: true };
315
+ }
316
+ });
317
+ server.tool("ncloud_edge_get_purge_history", "Get cache purge execution history for a Global Edge CDN edge", {
318
+ profileId: z.number({ required_error: "필수 파라미터 'profileId'가 누락되었습니다." }).describe("Profile ID that the edge belongs to"),
319
+ edgeId: z.number({ required_error: "필수 파라미터 'edgeId'가 누락되었습니다." }).describe("Edge ID to get purge history for"),
320
+ }, async (params) => {
321
+ try {
322
+ const result = await client.request(`/api/v1/profiles/${params.profileId}/cdn-edges/${params.edgeId}/purge-history`);
323
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
324
+ }
325
+ catch (error) {
326
+ return { content: [{ type: "text", text: error.message }], isError: true };
327
+ }
328
+ });
329
+ // ─── Certificate Tools ─────────────────────────────────────────────────────
330
+ server.tool("ncloud_edge_list_certificates", "List all provisioned SSL/TLS certificates for Global Edge CDN", {
331
+ pageNo: z.number().optional().describe("Page number for pagination (default 1)"),
332
+ pageSize: z.number().optional().describe("Number of items per page (default 15)"),
333
+ }, async (params) => {
334
+ try {
335
+ const result = await client.request("/api/v1/certificate/provisioning", params);
336
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
337
+ }
338
+ catch (error) {
339
+ return { content: [{ type: "text", text: error.message }], isError: true };
340
+ }
341
+ });
342
+ server.tool("ncloud_edge_provision_certificate", "Provision (register) a certificate from Certificate Manager to Global Edge for use with custom domains", {
343
+ certificateNo: z.number({ required_error: "필수 파라미터 'certificateNo'가 누락되었습니다." }).describe("Certificate number from Certificate Manager to provision"),
344
+ serviceRegion: z.enum(["KR_JP", "GLOBAL"]).optional().default("KR_JP").describe("Certificate application scope: KR_JP (Korea/Japan) or GLOBAL"),
345
+ }, async (params) => {
346
+ try {
347
+ const body = {
348
+ certificateNo: params.certificateNo,
349
+ serviceRegion: params.serviceRegion,
350
+ };
351
+ const result = await client.postRequest("/api/v1/certificate/provisioning", body);
352
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
353
+ }
354
+ catch (error) {
355
+ return { content: [{ type: "text", text: error.message }], isError: true };
356
+ }
357
+ });
358
+ server.tool("ncloud_edge_get_certificate", "Get detailed information about a specific provisioned certificate for Global Edge CDN", {
359
+ certificateId: z.number({ required_error: "필수 파라미터 'certificateId'가 누락되었습니다." }).describe("Certificate ID to query"),
360
+ }, async (params) => {
361
+ try {
362
+ const result = await client.request(`/api/v1/certificate/provisioning/${params.certificateId}`);
363
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
364
+ }
365
+ catch (error) {
366
+ return { content: [{ type: "text", text: error.message }], isError: true };
367
+ }
368
+ });
369
+ server.tool("ncloud_edge_delete_certificate", "⚠️ Destructive: Delete a provisioned certificate from Global Edge CDN. The certificate must not be in use by any edge. Set confirm=true to execute.", {
370
+ certificateId: z.number({ required_error: "필수 파라미터 'certificateId'가 누락되었습니다." }).describe("Certificate ID to delete"),
371
+ confirm: z.boolean().optional().default(false).describe("Must be true to actually execute the destructive operation"),
372
+ }, async (params) => {
373
+ try {
374
+ if (!params.confirm) {
375
+ const message = `⚠️ This will permanently delete Global Edge Certificate [${params.certificateId}]. The certificate must not be in use by any edge.\n\nTo execute, call this tool again with confirm=true.`;
376
+ return { content: [{ type: "text", text: message }] };
377
+ }
378
+ const result = await client.deleteRequest(`/api/v1/certificate/provisioning/${params.certificateId}`);
379
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
380
+ }
381
+ catch (error) {
382
+ return { content: [{ type: "text", text: error.message }], isError: true };
383
+ }
384
+ });
385
+ }
386
+ //# sourceMappingURL=global-edge.js.map