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
httpsAgent: REST_ENABLE_SSL_VERIFY ? undefined : newhttps.Agent({// Disable SSL verification only when explicitly set to false
121
187
rejectUnauthorized: false
@@ -202,42 +268,42 @@ class RestTester {
202
268
tools: [
203
269
{
204
270
name: 'test_request',
205
-
description: `Test a REST API endpoint and get detailed response information.
206
-
207
-
Base URL: ${process.env.REST_BASE_URL}
208
-
209
-
SSL Verification: ${REST_ENABLE_SSL_VERIFY ? 'Enabled' : 'Disabled'} (see config resource for SSL settings)
210
-
211
-
Authentication: ${
271
+
description: `Test a REST API endpoint and get detailed response information. Base URL: ${normalizeBaseUrl(process.env.REST_BASE_URL!)} | SSL Verification ${REST_ENABLE_SSL_VERIFY ? 'enabled' : 'disabled'} (see config resource for SSL settings) | Authentication: ${
212
272
hasBasicAuth() ?
213
273
`Basic Auth with username: ${AUTH_BASIC_USERNAME}` :
214
274
hasBearerAuth() ?
215
275
'Bearer token authentication configured' :
216
276
hasApiKeyAuth() ?
217
277
`API Key using header: ${AUTH_APIKEY_HEADER_NAME}` :
218
278
'No authentication configured'
219
-
}
220
-
221
-
The tool automatically:
222
-
- Normalizes endpoints (adds leading slash, removes trailing slashes)
223
-
- Handles authentication header injection
224
-
- Accepts any HTTP status code as valid
225
-
- Limits response size to ${RESPONSE_SIZE_LIMIT} bytes (see config resource for size limit settings)
226
-
- Returns detailed response information including:
227
-
* Full URL called
228
-
* Status code and text
229
-
* Response headers
230
-
* Response body
231
-
* Request details (method, headers, body)
232
-
* Response timing
233
-
* Validation messages
234
-
235
-
Error Handling:
236
-
- Network errors are caught and returned with descriptive messages
237
-
- Invalid status codes are still returned with full response details
238
-
- Authentication errors include the attempted auth method
239
-
240
-
See the config resource for all configuration options.
279
+
} | ${(()=>{
280
+
constcustomHeaders=getCustomHeaders();
281
+
if(Object.keys(customHeaders).length===0){
282
+
return'No custom headers defined (see config resource for headers)';
283
+
}
284
+
285
+
// List of common headers that are safe to show values for
return`Custom headers defined: ${headerList} (see config resource for headers)`;
306
+
})()} | The tool automatically: - Normalizes endpoints (adds leading slash, removes trailing slashes) - Handles authentication header injection - Applies custom headers from HEADER_* environment variables - Accepts any HTTP status code as valid - Limits response size to ${RESPONSE_SIZE_LIMIT} bytes (see config resource for size limit settings) - Returns detailed response information including: * Full URL called * Status code and text * Response headers * Response body * Request details (method, headers, body) * Response timing * Validation messages | Error Handling: - Network errors are caught and returned with descriptive messages - Invalid status codes are still returned with full response details - Authentication errors include the attempted auth method | See the config resource for all configuration options, including header configuration.
241
307
`,
242
308
inputSchema: {
243
309
type: 'object',
@@ -249,19 +315,19 @@ See the config resource for all configuration options.
249
315
},
250
316
endpoint: {
251
317
type: 'string',
252
-
description: `Endpoint path (e.g. "/users"). Do not include full URLs - only the path. Example: "/api/users" will resolve to "${process.env.REST_BASE_URL}/api/users"`,
318
+
description: `Endpoint path (e.g. "/users"). Do not include full URLs - only the path. Example: "/api/users" will resolve to "${normalizeBaseUrl(process.env.REST_BASE_URL!)}/api/users"`,
253
319
},
254
320
body: {
255
321
type: 'object',
256
322
description: 'Optional request body for POST/PUT requests',
257
323
},
258
324
headers: {
259
325
type: 'object',
260
-
description: 'Optional request headers',
326
+
description: 'Optional request headers for one-time use. IMPORTANT: Do not use for sensitive data like API keys - those should be configured via environment variables. This parameter is intended for dynamic, non-sensitive headers that may be needed for specific requests.',
261
327
additionalProperties: {
262
-
type: 'string',
263
-
},
264
-
},
328
+
type: 'string'
329
+
}
330
+
}
265
331
},
266
332
required: ['method','endpoint'],
267
333
},
@@ -291,15 +357,25 @@ See the config resource for all configuration options.
0 commit comments