Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import log from '@apify/log';
import type { Input } from './types.js';

/**
* Process input parameters, split actors string into an array
* Process input parameters, split Actors string into an array
* @param originalInput
* @returns input
*/
Expand Down
14 changes: 13 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ import log from '@apify/log';
import { createExpressApp } from './actor/server.js';
import { processInput } from './input.js';
import { ActorsMcpServer } from './mcp/server.js';
import { actorDefinitionTool, addTool, callActorGetDataset, removeTool, searchTool } from './tools/index.js';
import {
actorDefinitionTool,
addTool,
callActorGetDataset,
getActorsAsTools,
removeTool,
searchTool,
} from './tools/index.js';
import type { Input } from './types.js';

const STANDBY_MODE = Actor.getEnv().metaOrigin === 'STANDBY';
Expand Down Expand Up @@ -39,6 +46,11 @@ if (STANDBY_MODE) {
if (input.enableAddingActors) {
tools.push(addTool, removeTool);
}
if (input.actors && input.actors.length > 0) {
const { actors } = input;
const actorsToLoad = Array.isArray(actors) ? actors : actors.split(',');
tools.push(...await getActorsAsTools(actorsToLoad, process.env.APIFY_TOKEN as string));
}
mcpServer.updateTools(tools);
app.listen(PORT, () => {
log.info(`The Actor web server is listening for user requests at ${HOST}`);
Expand Down
Loading