@@ -149,6 +149,26 @@ export class ApifyMcpServer {
149149 } ) ;
150150 }
151151
152+ /**
153+ * Process input parameters and update tools
154+ * If URL contains query parameter actors, add tools from actors, otherwise add tools from default actors
155+ * @param url
156+ */
157+ public async processParamsAndUpdateTools ( url : string ) {
158+ const params = parse ( url . split ( '?' ) [ 1 ] || '' ) as ParsedUrlQuery ;
159+ delete params . token ;
160+ log . debug ( `Received input parameters: ${ JSON . stringify ( params ) } ` ) ;
161+ const input = await processInput ( params as unknown as Input ) ;
162+ if ( input . actors ) {
163+ await this . addToolsFromActors ( input . actors as string [ ] ) ;
164+ }
165+ if ( input . enableActorAutoLoading ) {
166+ this . updateTools ( getActorAutoLoadingTools ( ) ) ;
167+ }
168+ log . debug ( `Server is running in STANDBY mode with the following Actors (tools): ${ this . getToolNames ( ) } .
169+ To use different Actors, provide them in query parameter "actors" or include them in the Actor Task input.` ) ;
170+ }
171+
152172 private setupToolHandlers ( ) : void {
153173 this . server . setRequestHandler ( ListToolsRequestSchema , async ( ) => {
154174 return { tools : Array . from ( this . tools . values ( ) ) } ;
@@ -228,23 +248,3 @@ export class ApifyMcpServer {
228248 await this . server . connect ( transport ) ;
229249 }
230250}
231-
232- /**
233- * Process input parameters and update tools
234- * If URL contains query parameter actors, add tools from actors, otherwise add tools from default actors
235- * @param url
236- */
237- export async function processParamsAndUpdateTools ( url : string , mcpServer : ApifyMcpServer ) {
238- const params = parse ( url . split ( '?' ) [ 1 ] || '' ) as ParsedUrlQuery ;
239- delete params . token ;
240- log . debug ( `Received input parameters: ${ JSON . stringify ( params ) } ` ) ;
241- const input = await processInput ( params as unknown as Input ) ;
242- if ( input . actors ) {
243- await mcpServer . addToolsFromActors ( input . actors as string [ ] ) ;
244- }
245- if ( input . enableActorAutoLoading ) {
246- mcpServer . updateTools ( getActorAutoLoadingTools ( ) ) ;
247- }
248- log . debug ( `Server is running in STANDBY mode with the following Actors (tools): ${ mcpServer . getToolNames ( ) } .
249- To use different Actors, provide them in query parameter "actors" or include them in the Actor Task input.` ) ;
250- }
0 commit comments