whistler-mcp 1.0.6 → 1.0.7
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/package.json +1 -1
- package/server.js +15 -0
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -217,6 +217,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
217
217
|
result = await invokeApi('/buy-bid', 'POST', params);
|
|
218
218
|
break;
|
|
219
219
|
case 'view_job_pdf': {
|
|
220
|
+
// Guard: pdfUrl must exist and look like a valid API path
|
|
221
|
+
if (!params.pdfUrl || params.pdfUrl === 'undefined' || params.pdfUrl === 'null') {
|
|
222
|
+
result = {
|
|
223
|
+
success: false,
|
|
224
|
+
message: "This job does not have a PDF available. The 'pdfUrl' field was not returned by get_company_roles, which means no JD PDF exists for this role."
|
|
225
|
+
};
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
if (!params.pdfUrl.startsWith('/api/pdfs/')) {
|
|
229
|
+
result = {
|
|
230
|
+
success: false,
|
|
231
|
+
message: `Invalid pdfUrl format: "${params.pdfUrl}". You must pass the exact 'pdfUrl' value returned by get_company_roles (e.g. /api/pdfs/secure/<id>).`
|
|
232
|
+
};
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
220
235
|
// pdfUrl from the backend is a relative path like /api/pdfs/secure/:id
|
|
221
236
|
// invokeApiBinary prepends API_BASE_URL which already ends in /api,
|
|
222
237
|
// so we must strip the leading /api prefix to avoid doubling it.
|