Skip to content

Commit 4b44e78

Browse files
authored
fix: add default Actors in standby mode (#77)
1 parent fdfc72e commit 4b44e78

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ActorCallOptions } from 'apify-client';
77
import type { Request, Response } from 'express';
88
import express from 'express';
99

10-
import { HEADER_READINESS_PROBE, Routes } from './const.js';
10+
import { getActorsAsTools } from './actors.js';
11+
import { defaults, HEADER_READINESS_PROBE, Routes } from './const.js';
1112
import { processInput } from './input.js';
1213
import { log } from './logger.js';
1314
import { ApifyMcpServer } from './server.js';
@@ -144,6 +145,10 @@ if (STANDBY_MODE) {
144145
if (input.enableAddingActors) {
145146
mcpServer.updateTools(getActorAutoLoadingTools());
146147
}
148+
const actors = input.actors ?? defaults.actors;
149+
const actorsToLoad = Array.isArray(actors) ? actors : actors.split(',');
150+
const actorTools = await getActorsAsTools(actorsToLoad);
151+
mcpServer.updateTools(actorTools);
147152
app.listen(PORT, () => {
148153
log.info(`The Actor web server is listening for user requests at ${HOST}`);
149154
});

0 commit comments

Comments
 (0)