You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Helper to wrap tool execution with error handling
@@ -41,14 +42,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
41
42
{
42
43
title: "Ping Test",
43
44
description:
44
-
"Measure network latency, packet loss, and reachability to a target (domain or IP) from globally distributed probes. Use this tool to check if a server is online, debug connection issues, or assess global performance.",
45
+
"Measure network latency, packet loss, and reachability to a target (domain or IP) from globally distributed probes. Use this tool to check if a server is online, debug connection issues, or assess global performance. Note: Only public endpoints are supported. Private networks cannot be tested.",
45
46
annotations: {
46
47
readOnlyHint: true,
47
48
},
48
49
inputSchema: {
49
50
target: z
50
51
.string()
51
-
.describe("Domain name or IP to test (e.g., 'google.com', '1.1.1.1')"),
52
+
.describe("Public domain name or IP address to test (e.g., 'google.com', '1.1.1.1'). Private IPs (RFC1918), localhost, and link-local addresses are not supported."),
52
53
locations: z
53
54
.union([z.array(z.string()),z.string()])
54
55
.optional()
@@ -74,6 +75,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
74
75
},
75
76
async({ target, locations, limit, packets })=>{
76
77
returnhandleToolExecution(async()=>{
78
+
// Validate target is public
79
+
constvalidation=isPublicTarget(target);
80
+
if(!validation.valid){
81
+
thrownewError(
82
+
`Invalid target: ${validation.reason}. Globalping only supports public endpoints. Private IP addresses (RFC1918), localhost, and link-local addresses are not allowed.`,
83
+
);
84
+
}
85
+
77
86
consttoken=getToken();
78
87
constparsedLocations=parseLocations(locations);
79
88
@@ -129,14 +138,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
129
138
{
130
139
title: "Traceroute Test",
131
140
description:
132
-
"Trace the network path to a target (domain or IP) from global locations. Use this tool to identify where packets are being dropped, analyze routing paths, or pinpoint latency sources in the network.",
141
+
"Trace the network path to a target (domain or IP) from global locations. Use this tool to identify where packets are being dropped, analyze routing paths, or pinpoint latency sources in the network. Note: Only public endpoints are supported. Private networks cannot be tested.",
133
142
annotations: {
134
143
readOnlyHint: true,
135
144
},
136
145
inputSchema: {
137
146
target: z
138
147
.string()
139
-
.describe("Domain name or IP to test (e.g., 'cloudflare.com', '1.1.1.1')"),
148
+
.describe("Public domain name or IP address to test (e.g., 'cloudflare.com', '1.1.1.1'). Private IPs (RFC1918), localhost, and link-local addresses are not supported."),
140
149
locations: z
141
150
.union([z.array(z.string()),z.string()])
142
151
.optional()
@@ -169,6 +178,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
169
178
},
170
179
async({ target, locations, limit, protocol, port })=>{
171
180
returnhandleToolExecution(async()=>{
181
+
// Validate target is public
182
+
constvalidation=isPublicTarget(target);
183
+
if(!validation.valid){
184
+
thrownewError(
185
+
`Invalid target: ${validation.reason}. Globalping only supports public endpoints. Private IP addresses (RFC1918), localhost, and link-local addresses are not allowed.`,
186
+
);
187
+
}
188
+
172
189
consttoken=getToken();
173
190
constparsedLocations=parseLocations(locations);
174
191
@@ -224,12 +241,12 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
224
241
{
225
242
title: "DNS Lookup",
226
243
description:
227
-
"Resolve DNS records (A, AAAA, MX, etc.) for a domain from global locations. Use this tool to verify DNS propagation, troubleshoot resolution failures, or check if users in different regions are seeing the correct records.",
244
+
"Resolve DNS records (A, AAAA, MX, etc.) for a domain from global locations. Use this tool to verify DNS propagation, troubleshoot resolution failures, or check if users in different regions are seeing the correct records. Note: Only public endpoints are supported. Private networks cannot be tested.",
228
245
annotations: {
229
246
readOnlyHint: true,
230
247
},
231
248
inputSchema: {
232
-
target: z.string().describe("Domain name to resolve (e.g., 'google.com')"),
249
+
target: z.string().describe("Public domain name to resolve (e.g., 'google.com'). Private domains, localhost, and link-local addresses are not supported."),
233
250
locations: z
234
251
.union([z.array(z.string()),z.string()])
235
252
.optional()
@@ -285,6 +302,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
`Invalid target: ${validation.reason}. Globalping only supports public endpoints. Private IP addresses (RFC1918), localhost, and link-local addresses are not allowed.`,
310
+
);
311
+
}
312
+
288
313
consttoken=getToken();
289
314
constparsedLocations=parseLocations(locations);
290
315
@@ -343,15 +368,15 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
343
368
{
344
369
title: "MTR Test",
345
370
description:
346
-
"Run an MTR (My Traceroute) diagnostic, which combines Ping and Traceroute. Use this tool to analyze packet loss and latency trends at every hop in the network path over time, helpful for spotting intermittent issues.",
371
+
"Run an MTR (My Traceroute) diagnostic, which combines Ping and Traceroute. Use this tool to analyze packet loss and latency trends at every hop in the network path over time, helpful for spotting intermittent issues. Note: Only public endpoints are supported. Private networks cannot be tested.",
347
372
annotations: {
348
373
readOnlyHint: true,
349
374
},
350
375
inputSchema: {
351
376
target: z
352
377
.string()
353
378
.min(1)
354
-
.describe("Destination hostname or IP to run the MTR against"),
379
+
.describe("Public destination hostname or IP address to run the MTR against. Private IPs (RFC1918), localhost, and link-local addresses are not supported."),
355
380
locations: z
356
381
.union([z.array(z.string()),z.string()])
357
382
.optional()
@@ -387,6 +412,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
`Invalid target: ${validation.reason}. Globalping only supports public endpoints. Private IP addresses (RFC1918), localhost, and link-local addresses are not allowed.`,
420
+
);
421
+
}
422
+
390
423
consttoken=getToken();
391
424
constparsedLocations=parseLocations(locations);
392
425
@@ -443,12 +476,12 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
443
476
{
444
477
title: "HTTP Request",
445
478
description:
446
-
"Send HTTP/HTTPS requests (GET, HEAD or OPTIONS) to a URL from global locations. Use this tool to check website uptime, verify response status codes, analyze timing (TTFB, download), and debug CDN or caching issues.",
479
+
"Send HTTP/HTTPS requests (GET, HEAD or OPTIONS) to a URL from global locations. Use this tool to check website uptime, verify response status codes, analyze timing (TTFB, download), and debug CDN or caching issues. Note: Only public endpoints are supported. Private networks cannot be tested.",
447
480
annotations: {
448
481
readOnlyHint: true,
449
482
},
450
483
inputSchema: {
451
-
target: z.string().describe("Domain name or IP to test (e.g., 'example.com')"),
484
+
target: z.string().describe("Public domain name or IP address to test (e.g., 'example.com'). Private IPs (RFC1918), localhost, and link-local addresses are not supported."),
452
485
locations: z
453
486
.union([z.array(z.string()),z.string()])
454
487
.optional()
@@ -495,6 +528,14 @@ export function registerGlobalpingTools(agent: GlobalpingMCP, getToken: () => st
495
528
},
496
529
async({ target, locations, limit, method, protocol, path, query, port })=>{
497
530
returnhandleToolExecution(async()=>{
531
+
// Validate target is public
532
+
constvalidation=isPublicTarget(target);
533
+
if(!validation.valid){
534
+
thrownewError(
535
+
`Invalid target: ${validation.reason}. Globalping only supports public endpoints. Private IP addresses (RFC1918), localhost, and link-local addresses are not allowed.`,
0 commit comments