refactor: ped-ai calls clinical_semantic_search only

The nc_semantic_search alias is gone from the MCP server, so accepting it
here would point retrieval at a tool that no longer exists. A stale
override now stops the app at startup instead of silently retrieving
nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
This commit is contained in:
Daniel 2026-09-10 17:22:40 +02:00
parent 2200587b40
commit 846143ebe5
2 changed files with 6 additions and 7 deletions

View file

@ -16,7 +16,7 @@ The Clinical Assistant is a retrieval-grounded assistant for pediatric clinical
```txt
User asks a question
-> browser posts to Ped-AI
-> Ped-AI calls MCP `nc_semantic_search`
-> Ped-AI calls MCP `clinical_semantic_search`
-> MCP returns source excerpts and metadata
-> Ped-AI builds an answer prompt with source constraints
-> LiteLLM model returns answer text

View file

@ -3,13 +3,12 @@ var sleep = require('node:timers/promises').setTimeout;
var MCP_URLS = buildMcpUrls();
var _lastGoodMcpUrl = MCP_URLS[0];
// Search tool name is env-driven; invalid values stop the app before any MCP call.
// The server names this tool clinical_semantic_search. The old nc_ alias is
// gone from both sides; a stale override would silently retrieve nothing, so it
// stops the app here rather than at the first search.
var SEARCH_TOOL_NAME = process.env.CLINICAL_ASSISTANT_SEARCH_TOOL || 'clinical_semantic_search';
if (SEARCH_TOOL_NAME !== 'clinical_semantic_search' && SEARCH_TOOL_NAME !== 'nc_semantic_search') {
throw new Error('CLINICAL_ASSISTANT_SEARCH_TOOL must be clinical_semantic_search or nc_semantic_search');
}
if (SEARCH_TOOL_NAME === 'nc_semantic_search') {
console.warn('[clinical-mcp] CLINICAL_ASSISTANT_SEARCH_TOOL=nc_semantic_search is deprecated; prefer clinical_semantic_search');
if (SEARCH_TOOL_NAME !== 'clinical_semantic_search') {
throw new Error('CLINICAL_ASSISTANT_SEARCH_TOOL must be clinical_semantic_search (the nc_semantic_search alias was removed)');
}
var MCP_INITIALIZE_TIMEOUT_MS = positiveInt(process.env.CLINICAL_ASSISTANT_MCP_INITIALIZE_TIMEOUT_MS, 30000);
var MCP_REQUEST_TIMEOUT_MS = positiveInt(process.env.CLINICAL_ASSISTANT_MCP_REQUEST_TIMEOUT_MS, 90000);