@@ -32,7 +32,7 @@ const RETRIEVAL_TOOL: Tool = {
3232 description : 'The number of documents to retrieve.' ,
3333 } ,
3434 } ,
35- required : [ 'pipelineId' , 'question' , 'k' ] ,
35+ required : process . env . VECTORIZE_PIPELINE_ID ? [ 'question' , 'k' ] : [ 'pipelineId' , 'question' , 'k' ] ,
3636 } ,
3737} ;
3838
@@ -56,7 +56,7 @@ const DEEP_RESEARCH_TOOL: Tool = {
5656 description : 'Whether to perform a web search.' ,
5757 } ,
5858 } ,
59- required : [ 'pipelineId' , 'query' , 'webSearch' ] ,
59+ required : process . env . VECTORIZE_PIPELINE_ID ? [ 'query' , 'webSearch' ] : [ 'pipelineId' , 'query' , 'webSearch' ] ,
6060 } ,
6161} ;
6262
@@ -97,6 +97,7 @@ const server = new Server(
9797// Get optional API URL
9898const VECTORIZE_ORG_ID = process . env . VECTORIZE_ORG_ID ;
9999const VECTORIZE_TOKEN = process . env . VECTORIZE_TOKEN ;
100+ const VECTORIZE_PIPELINE_ID = process . env . VECTORIZE_PIPELINE_ID ;
100101// Check if API key is required (only for cloud service)
101102if ( ! VECTORIZE_ORG_ID || ! VECTORIZE_TOKEN ) {
102103 console . error (
@@ -250,7 +251,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
250251 case 'retrieve' : {
251252 return await performRetrieval (
252253 VECTORIZE_ORG_ID ,
253- args . pipelineId + '' ,
254+ args . pipelineId ? ( args . pipelineId + '' ) : ( VECTORIZE_PIPELINE_ID || '' ) ,
254255 args . question + '' ,
255256 Number ( args . k )
256257 ) ;
@@ -265,7 +266,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
265266 case 'deep-research' : {
266267 return await performDeepResearch (
267268 VECTORIZE_ORG_ID ,
268- args . pipelineId + '' ,
269+ args . pipelineId ? ( args . pipelineId + '' ) : ( VECTORIZE_PIPELINE_ID || '' ) ,
269270 args . query + '' ,
270271 Boolean ( args . webSearch )
271272 ) ;
@@ -305,6 +306,13 @@ async function runServer() {
305306 data : `Configuration: Organization ID: ${ VECTORIZE_ORG_ID || 'default' } ` ,
306307 } ) ;
307308
309+ if ( VECTORIZE_PIPELINE_ID ) {
310+ server . sendLoggingMessage ( {
311+ level : 'info' ,
312+ data : `Configuration: Using fixed Pipeline ID: ${ VECTORIZE_PIPELINE_ID } ` ,
313+ } ) ;
314+ }
315+
308316 console . error ( 'Vectorize MCP Server running' ) ;
309317}
310318
0 commit comments