@apify/actors-mcp-server 0.1.23 → 0.1.24-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +58 -2
  2. package/dist/actor/const.d.ts +12 -0
  3. package/dist/actor/const.d.ts.map +1 -0
  4. package/dist/actor/const.js +18 -0
  5. package/dist/actor/const.js.map +1 -0
  6. package/dist/actor/server.d.ts +4 -0
  7. package/dist/actor/server.d.ts.map +1 -0
  8. package/dist/actor/server.js +158 -0
  9. package/dist/actor/server.js.map +1 -0
  10. package/dist/actor/types.d.ts +23 -0
  11. package/dist/actor/types.d.ts.map +1 -0
  12. package/dist/actor/types.js +2 -0
  13. package/dist/actor/types.js.map +1 -0
  14. package/dist/actor/utils.d.ts +3 -0
  15. package/dist/actor/utils.d.ts.map +1 -0
  16. package/dist/actor/utils.js +26 -0
  17. package/dist/actor/utils.js.map +1 -0
  18. package/dist/apify-client.d.ts +7 -0
  19. package/dist/apify-client.d.ts.map +1 -0
  20. package/dist/apify-client.js +30 -0
  21. package/dist/apify-client.js.map +1 -0
  22. package/dist/const.d.ts +15 -19
  23. package/dist/const.d.ts.map +1 -1
  24. package/dist/const.js +23 -23
  25. package/dist/const.js.map +1 -1
  26. package/dist/examples/clientSse.d.ts +11 -1
  27. package/dist/examples/clientSse.d.ts.map +1 -1
  28. package/dist/examples/clientSse.js +13 -10
  29. package/dist/examples/clientSse.js.map +1 -1
  30. package/dist/examples/clientStdio.js +6 -6
  31. package/dist/examples/clientStdio.js.map +1 -1
  32. package/dist/examples/clientStdioChat.js +31 -16
  33. package/dist/examples/clientStdioChat.js.map +1 -1
  34. package/dist/examples/clientStreamableHttp.d.ts +2 -0
  35. package/dist/examples/clientStreamableHttp.d.ts.map +1 -0
  36. package/dist/examples/clientStreamableHttp.js +93 -0
  37. package/dist/examples/clientStreamableHttp.js.map +1 -0
  38. package/dist/index.d.ts +2 -14
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +6 -51
  41. package/dist/index.js.map +1 -1
  42. package/dist/input.d.ts +1 -1
  43. package/dist/input.d.ts.map +1 -1
  44. package/dist/input.js +15 -7
  45. package/dist/input.js.map +1 -1
  46. package/dist/main.d.ts +4 -0
  47. package/dist/main.d.ts.map +1 -1
  48. package/dist/main.js +22 -125
  49. package/dist/main.js.map +1 -1
  50. package/dist/mcp/actors.d.ts +22 -0
  51. package/dist/mcp/actors.d.ts.map +1 -0
  52. package/dist/mcp/actors.js +76 -0
  53. package/dist/mcp/actors.js.map +1 -0
  54. package/dist/mcp/client.d.ts +6 -0
  55. package/dist/mcp/client.d.ts.map +1 -0
  56. package/dist/mcp/client.js +33 -0
  57. package/dist/mcp/client.js.map +1 -0
  58. package/dist/mcp/const.d.ts +3 -0
  59. package/dist/mcp/const.d.ts.map +1 -0
  60. package/dist/mcp/const.js +3 -0
  61. package/dist/mcp/const.js.map +1 -0
  62. package/dist/mcp/proxy.d.ts +4 -0
  63. package/dist/mcp/proxy.d.ts.map +1 -0
  64. package/dist/mcp/proxy.js +29 -0
  65. package/dist/mcp/proxy.js.map +1 -0
  66. package/dist/mcp/server.d.ts +41 -0
  67. package/dist/mcp/server.d.ts.map +1 -0
  68. package/dist/mcp/server.js +187 -0
  69. package/dist/mcp/server.js.map +1 -0
  70. package/dist/mcp/utils.d.ts +26 -0
  71. package/dist/mcp/utils.d.ts.map +1 -0
  72. package/dist/mcp/utils.js +53 -0
  73. package/dist/mcp/utils.js.map +1 -0
  74. package/dist/stdio.d.ts +15 -0
  75. package/dist/stdio.d.ts.map +1 -0
  76. package/dist/stdio.js +57 -0
  77. package/dist/stdio.js.map +1 -0
  78. package/dist/tools/actor.d.ts +40 -0
  79. package/dist/tools/actor.d.ts.map +1 -0
  80. package/dist/tools/actor.js +138 -0
  81. package/dist/tools/actor.js.map +1 -0
  82. package/dist/tools/build.d.ts +13 -0
  83. package/dist/tools/build.d.ts.map +1 -0
  84. package/dist/tools/build.js +122 -0
  85. package/dist/tools/build.js.map +1 -0
  86. package/dist/tools/helpers.d.ts +19 -0
  87. package/dist/tools/helpers.d.ts.map +1 -0
  88. package/dist/tools/helpers.js +62 -0
  89. package/dist/tools/helpers.js.map +1 -0
  90. package/dist/tools/index.d.ts +6 -0
  91. package/dist/tools/index.d.ts.map +1 -0
  92. package/dist/tools/index.js +8 -0
  93. package/dist/tools/index.js.map +1 -0
  94. package/dist/tools/store_collection.d.ts +21 -0
  95. package/dist/tools/store_collection.d.ts.map +1 -0
  96. package/dist/tools/store_collection.js +82 -0
  97. package/dist/tools/store_collection.js.map +1 -0
  98. package/dist/tools/utils.d.ts +77 -0
  99. package/dist/tools/utils.d.ts.map +1 -0
  100. package/dist/tools/utils.js +202 -0
  101. package/dist/tools/utils.js.map +1 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -1
  103. package/dist/types.d.ts +97 -10
  104. package/dist/types.d.ts.map +1 -1
  105. package/package.json +17 -14
  106. package/dist/actors.d.ts +0 -74
  107. package/dist/actors.d.ts.map +0 -1
  108. package/dist/actors.js +0 -327
  109. package/dist/actors.js.map +0 -1
  110. package/dist/logger.d.ts +0 -3
  111. package/dist/logger.d.ts.map +0 -1
  112. package/dist/logger.js +0 -4
  113. package/dist/logger.js.map +0 -1
  114. package/dist/server.d.ts +0 -43
  115. package/dist/server.d.ts.map +0 -1
  116. package/dist/server.js +0 -178
  117. package/dist/server.js.map +0 -1
  118. package/dist/tools.d.ts +0 -46
  119. package/dist/tools.d.ts.map +0 -1
  120. package/dist/tools.js +0 -128
  121. package/dist/tools.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -1,13 +1,7 @@
1
+ import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
1
2
  import type { ValidateFunction } from 'ajv';
2
3
  import type { ActorDefaultRunOptions, ActorDefinition } from 'apify-client';
3
- export type Input = {
4
- actors: string[] | string;
5
- enableAddingActors?: boolean;
6
- enableActorAutoLoading?: boolean;
7
- maxActorMemoryBytes?: number;
8
- debugActor?: string;
9
- debugActorInput?: unknown;
10
- };
4
+ import type { ActorsMcpServer } from './mcp/server.js';
11
5
  export interface ISchemaProperties {
12
6
  type: string;
13
7
  title: string;
@@ -38,14 +32,84 @@ export type ActorDefinitionWithDesc = Omit<ActorDefinition, 'input'> & {
38
32
  input?: IActorInputSchema;
39
33
  };
40
34
  export type ActorDefinitionPruned = Pick<ActorDefinitionWithDesc, 'id' | 'actorFullName' | 'buildTag' | 'readme' | 'input' | 'description' | 'defaultRunOptions'>;
41
- export interface Tool {
35
+ /**
36
+ * Base interface for all tools in the MCP server.
37
+ * Contains common properties shared by all tool types.
38
+ */
39
+ export interface ToolBase {
40
+ /** Unique name/identifier for the tool */
42
41
  name: string;
43
- actorFullName: string;
42
+ /** Description of what the tool does */
44
43
  description: string;
44
+ /** JSON schema defining the tool's input parameters */
45
45
  inputSchema: object;
46
+ /** AJV validation function for the input schema */
46
47
  ajvValidate: ValidateFunction;
48
+ }
49
+ /**
50
+ * Interface for Actor-based tools - tools that wrap Apify Actors.
51
+ * Extends ToolBase with Actor-specific properties.
52
+ */
53
+ export interface ActorTool extends ToolBase {
54
+ /** Full name of the Apify Actor (username/name) */
55
+ actorFullName: string;
56
+ /** Optional memory limit in MB for the Actor execution */
47
57
  memoryMbytes?: number;
48
58
  }
59
+ /**
60
+ * Arguments passed to internal tool calls.
61
+ * Contains both the tool arguments and server references.
62
+ */
63
+ export type InternalToolArgs = {
64
+ /** Arguments passed to the tool */
65
+ args: Record<string, unknown>;
66
+ /** Reference to the Apify MCP server instance */
67
+ apifyMcpServer: ActorsMcpServer;
68
+ /** Reference to the MCP server instance */
69
+ mcpServer: Server;
70
+ /** Apify API token */
71
+ apifyToken: string;
72
+ };
73
+ /**
74
+ * Interface for internal tools - tools implemented directly in the MCP server.
75
+ * Extends ToolBase with a call function implementation.
76
+ */
77
+ export interface HelperTool extends ToolBase {
78
+ /**
79
+ * Executes the tool with the given arguments
80
+ * @param toolArgs - Arguments and server references
81
+ * @returns Promise resolving to the tool's output
82
+ */
83
+ call: (toolArgs: InternalToolArgs) => Promise<object>;
84
+ }
85
+ /**
86
+ * Actorized MCP server tool where this MCP server acts as a proxy.
87
+ * Extends ToolBase with tool associated MCP server.
88
+ */
89
+ export interface ActorMCPTool extends ToolBase {
90
+ originToolName: string;
91
+ actorID: string;
92
+ /**
93
+ * ID of the Actorized MCP server the tool is associated with.
94
+ * See getMCPServerID()
95
+ */
96
+ serverId: string;
97
+ serverUrl: string;
98
+ }
99
+ /**
100
+ * Type discriminator for tools - indicates whether a tool is internal or Actor-based.
101
+ */
102
+ export type ToolType = 'internal' | 'actor' | 'actor-mcp';
103
+ /**
104
+ * Wrapper interface that combines a tool with its type discriminator.
105
+ * Used to store and manage tools of different types uniformly.
106
+ */
107
+ export interface ToolWrap {
108
+ /** Type of the tool (internal or actor) */
109
+ type: ToolType;
110
+ /** The tool instance */
111
+ tool: ActorTool | HelperTool | ActorMCPTool;
112
+ }
49
113
  export interface ActorStats {
50
114
  totalRuns: number;
51
115
  totalUsers30Days: number;
@@ -68,4 +132,27 @@ export interface ActorStorePruned {
68
132
  url: string;
69
133
  totalStars?: number | null;
70
134
  }
135
+ /**
136
+ * Interface for internal tools - tools implemented directly in the MCP server.
137
+ * Extends ToolBase with a call function implementation.
138
+ */
139
+ export interface InternalTool extends ToolBase {
140
+ /**
141
+ * Executes the tool with the given arguments
142
+ * @param toolArgs - Arguments and server references
143
+ * @returns Promise resolving to the tool's output
144
+ */
145
+ call: (toolArgs: InternalToolArgs) => Promise<object>;
146
+ }
147
+ export type Input = {
148
+ actors: string[] | string;
149
+ /**
150
+ * @deprecated Use `enableAddingActors` instead.
151
+ */
152
+ enableActorAutoLoading?: boolean | string;
153
+ enableAddingActors?: boolean | string;
154
+ maxActorMemoryBytes?: number;
155
+ debugActor?: string;
156
+ debugActorInput?: unknown;
157
+ };
71
158
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","s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AkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@apify/actors-mcp-server",
3
- "version": "0.1.23",
3
+ "version": "0.1.24-beta.0",
4
4
  "type": "module",
5
- "description": "Model Context Protocol Server for Apify Actors",
5
+ "description": "Model Context Protocol Server for Apify",
6
6
  "engines": {
7
7
  "node": ">=18.0.0"
8
8
  },
9
9
  "main": "dist/index.js",
10
10
  "bin": {
11
- "actors-mcp-server": "./dist/index.js"
11
+ "actors-mcp-server": "./dist/stdio.js"
12
12
  },
13
13
  "files": [
14
14
  "dist",
@@ -30,29 +30,30 @@
30
30
  "model context protocol"
31
31
  ],
32
32
  "dependencies": {
33
- "@modelcontextprotocol/sdk": "^1.3.1",
33
+ "@apify/log": "^2.5.16",
34
+ "@modelcontextprotocol/sdk": "github:jirispilka/mcp-typescript-sdk#fix/add-src-dir",
34
35
  "ajv": "^8.17.1",
35
- "apify": "^3.2.6",
36
- "apify-client": "^2.11.2",
36
+ "apify": "^3.4.0",
37
+ "apify-client": "^2.12.1",
37
38
  "express": "^4.21.2",
38
- "yargs-parser": "^21.1.1",
39
+ "minimist": "^1.2.8",
39
40
  "zod": "^3.24.1",
40
41
  "zod-to-json-schema": "^3.24.1"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@anthropic-ai/sdk": "^0.33.1",
44
45
  "@anthropic-ai/tokenizer": "^0.0.4",
45
- "@apify/eslint-config": "^0.5.0-beta.2",
46
+ "@apify/eslint-config": "^1.0.0",
46
47
  "@apify/tsconfig": "^0.1.0",
47
48
  "@types/express": "^4.0.0",
48
49
  "@types/minimist": "^1.2.5",
49
50
  "@types/yargs-parser": "^21.0.3",
50
51
  "dotenv": "^16.4.7",
51
- "eslint": "^9.17.0",
52
+ "eslint": "^9.19.0",
52
53
  "eventsource": "^3.0.2",
53
54
  "tsx": "^4.6.2",
54
55
  "typescript": "^5.3.3",
55
- "typescript-eslint": "^8.18.2",
56
+ "typescript-eslint": "^8.23.0",
56
57
  "vitest": "^3.0.8"
57
58
  },
58
59
  "scripts": {
@@ -61,10 +62,12 @@
61
62
  "start:dev": "tsx src/main.ts",
62
63
  "lint": "eslint .",
63
64
  "lint:fix": "eslint . --fix",
64
- "build": "tsc",
65
- "watch": "tsc --watch",
66
- "inspector": "npx @modelcontextprotocol/inspector dist/index.js",
67
- "test": "vitest run"
65
+ "build": "tsc -b src",
66
+ "build:watch": "tsc -b src -w",
67
+ "type-check": "tsc --noEmit",
68
+ "inspector": "npm run build && npx @modelcontextprotocol/inspector dist/stdio.js",
69
+ "test": "vitest run",
70
+ "clean": "tsc -b src --clean"
68
71
  },
69
72
  "author": "Apify",
70
73
  "license": "MIT"
package/dist/actors.d.ts DELETED
@@ -1,74 +0,0 @@
1
- import type { ActorDefinitionPruned, ISchemaProperties, Tool } from './types.js';
2
- export declare function actorNameToToolName(actorName: string): string;
3
- /**
4
- * Get actor input schema by actor name.
5
- * First, fetch the actor details to get the default build tag and buildId.
6
- * Then, fetch the build details and return actorName, description, and input schema.
7
- * @param {string} actorIdOrName - Actor ID or Actor full name.
8
- * @param {number} limit - Truncate the README to this limit.
9
- * @returns {Promise<ActorDefinitionWithDesc | null>} - The actor definition with description or null if not found.
10
- */
11
- export declare function getActorDefinition(actorIdOrName: string, limit?: number): Promise<ActorDefinitionPruned | null>;
12
- /**
13
- * Helper function to shorten the enum list if it is too long.
14
- *
15
- * @param {string[]} enumList - The list of enum values to be shortened.
16
- * @returns {string[] | undefined} - The shortened enum list or undefined if the list is too long.
17
- */
18
- export declare function shortenEnum(enumList: string[]): string[] | undefined;
19
- /**
20
- * Shortens the description, enum, and items.enum properties of the schema properties.
21
- * @param properties
22
- */
23
- export declare function shortenProperties(properties: {
24
- [key: string]: ISchemaProperties;
25
- }): {
26
- [key: string]: ISchemaProperties;
27
- };
28
- /** Prune Actor README if it is too long
29
- * If the README is too long
30
- * - We keep the README as it is up to the limit.
31
- * - After the limit, we keep heading only
32
- * - We add a note that the README was truncated because it was too long.
33
- */
34
- export declare function truncateActorReadme(readme: string, limit?: number): string;
35
- /**
36
- * Helps determine the type of items in an array schema property.
37
- * Priority order: explicit type in items > prefill type > default value type > editor type.
38
- *
39
- * Based on JSON schema, the array needs a type, and most of the time Actor input schema does not have this, so we need to infer that.
40
- *
41
- */
42
- export declare function inferArrayItemType(property: ISchemaProperties): string | null;
43
- /**
44
- * Filters schema properties to include only the necessary fields.
45
- *
46
- * This is done to reduce the size of the input schema and to make it more readable.
47
- *
48
- * @param properties
49
- */
50
- export declare function filterSchemaProperties(properties: {
51
- [key: string]: ISchemaProperties;
52
- }): {
53
- [key: string]: ISchemaProperties;
54
- };
55
- /**
56
- * Fetches actor input schemas by Actor IDs or Actor full names and creates MCP tools.
57
- *
58
- * This function retrieves the input schemas for the specified actors and compiles them into MCP tools.
59
- * It uses the AJV library to validate the input schemas.
60
- *
61
- * Tool name can't contain /, so it is replaced with _
62
- *
63
- * The input schema processing workflow:
64
- * 1. Properties are marked as required using markInputPropertiesAsRequired() to add "REQUIRED" prefix to descriptions
65
- * 2. Nested properties are built by analyzing editor type (proxy, requestListSources) using buildNestedProperties()
66
- * 3. Properties are filtered using filterSchemaProperties()
67
- * 4. Properties are shortened using shortenProperties()
68
- * 5. Enums are added to descriptions with examples using addEnumsToDescriptionsWithExamples()
69
- *
70
- * @param {string[]} actors - An array of actor IDs or Actor full names.
71
- * @returns {Promise<Tool[]>} - A promise that resolves to an array of MCP tools.
72
- */
73
- export declare function getActorsAsTools(actors: string[]): Promise<Tool[]>;
74
- //# sourceMappingURL=actors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../src/actors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAq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GTH, ACTOR_ENUM_MAX_LENGTH } from './const.js';
4
- import { log } from './logger.js';
5
- export function actorNameToToolName(actorName) {
6
- return actorName
7
- .replace(/\//g, '-slash-')
8
- .replace(/\./g, '-dot-')
9
- .slice(0, 64);
10
- }
11
- /**
12
- * Get actor input schema by actor name.
13
- * First, fetch the actor details to get the default build tag and buildId.
14
- * Then, fetch the build details and return actorName, description, and input schema.
15
- * @param {string} actorIdOrName - Actor ID or Actor full name.
16
- * @param {number} limit - Truncate the README to this limit.
17
- * @returns {Promise<ActorDefinitionWithDesc | null>} - The actor definition with description or null if not found.
18
- */
19
- export async function getActorDefinition(actorIdOrName, limit = ACTOR_README_MAX_LENGTH) {
20
- const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
21
- const actorClient = client.actor(actorIdOrName);
22
- try {
23
- // Fetch actor details
24
- const actor = await actorClient.get();
25
- if (!actor) {
26
- log.error(`Failed to fetch input schema for Actor: ${actorIdOrName}. Actor not found.`);
27
- return null;
28
- }
29
- // fnesveda: The default build is not necessarily tagged, you can specify any build number as default build.
30
- // There will be a new API endpoint to fetch a default build.
31
- // For now, we'll use the tagged build, it will work for 90% of Actors. Later, we can update this.
32
- const tag = actor.defaultRunOptions?.build || '';
33
- const buildId = actor.taggedBuilds?.[tag]?.buildId || '';
34
- if (!buildId) {
35
- log.error(`Failed to fetch input schema for Actor: ${actorIdOrName}. Build ID not found.`);
36
- return null;
37
- }
38
- // Fetch build details and return the input schema
39
- const buildDetails = await client.build(buildId).get();
40
- if (buildDetails?.actorDefinition) {
41
- const actorDefinitions = buildDetails?.actorDefinition;
42
- actorDefinitions.id = actor.id;
43
- actorDefinitions.readme = truncateActorReadme(actorDefinitions.readme || '', limit);
44
- actorDefinitions.description = actor.description || '';
45
- actorDefinitions.actorFullName = `${actor.username}/${actor.name}`;
46
- actorDefinitions.defaultRunOptions = actor.defaultRunOptions;
47
- return pruneActorDefinition(actorDefinitions);
48
- }
49
- return null;
50
- }
51
- catch (error) {
52
- const errorMessage = `Failed to fetch input schema for Actor: ${actorIdOrName} with error ${error}.`;
53
- log.error(errorMessage);
54
- throw new Error(errorMessage);
55
- }
56
- }
57
- function pruneActorDefinition(response) {
58
- return {
59
- id: response.id,
60
- actorFullName: response.actorFullName || '',
61
- buildTag: response?.buildTag || '',
62
- readme: response?.readme || '',
63
- input: response?.input && 'type' in response.input && 'properties' in response.input
64
- ? { ...response.input,
65
- type: response.input.type,
66
- properties: response.input.properties }
67
- : undefined,
68
- description: response.description,
69
- defaultRunOptions: response.defaultRunOptions,
70
- };
71
- }
72
- /**
73
- * Helper function to shorten the enum list if it is too long.
74
- *
75
- * @param {string[]} enumList - The list of enum values to be shortened.
76
- * @returns {string[] | undefined} - The shortened enum list or undefined if the list is too long.
77
- */
78
- export function shortenEnum(enumList) {
79
- let charCount = 0;
80
- const resultEnumList = enumList.filter((enumValue) => {
81
- charCount += enumValue.length;
82
- return charCount <= ACTOR_ENUM_MAX_LENGTH;
83
- });
84
- return resultEnumList.length > 0 ? resultEnumList : undefined;
85
- }
86
- /**
87
- * Shortens the description, enum, and items.enum properties of the schema properties.
88
- * @param properties
89
- */
90
- export function shortenProperties(properties) {
91
- for (const property of Object.values(properties)) {
92
- if (property.description.length > MAX_DESCRIPTION_LENGTH) {
93
- property.description = `${property.description.slice(0, MAX_DESCRIPTION_LENGTH)}...`;
94
- }
95
- if (property.enum && property.enum?.length > 0) {
96
- property.enum = shortenEnum(property.enum);
97
- }
98
- if (property.items?.enum && property.items.enum.length > 0) {
99
- property.items.enum = shortenEnum(property.items.enum);
100
- }
101
- }
102
- return properties;
103
- }
104
- /** Prune Actor README if it is too long
105
- * If the README is too long
106
- * - We keep the README as it is up to the limit.
107
- * - After the limit, we keep heading only
108
- * - We add a note that the README was truncated because it was too long.
109
- */
110
- export function truncateActorReadme(readme, limit = ACTOR_README_MAX_LENGTH) {
111
- if (readme.length <= limit) {
112
- return readme;
113
- }
114
- const readmeFirst = readme.slice(0, limit);
115
- const readmeRest = readme.slice(limit);
116
- const lines = readmeRest.split('\n');
117
- const prunedReadme = lines.filter((line) => line.startsWith('#'));
118
- return `${readmeFirst}\n\nREADME was truncated because it was too long. Remaining headers:\n${prunedReadme.join(', ')}`;
119
- }
120
- /**
121
- * Helps determine the type of items in an array schema property.
122
- * Priority order: explicit type in items > prefill type > default value type > editor type.
123
- *
124
- * Based on JSON schema, the array needs a type, and most of the time Actor input schema does not have this, so we need to infer that.
125
- *
126
- */
127
- export function inferArrayItemType(property) {
128
- return property.items?.type
129
- || (Array.isArray(property.prefill) && property.prefill.length > 0 && typeof property.prefill[0])
130
- || (Array.isArray(property.default) && property.default.length > 0 && typeof property.default[0])
131
- || (property.editor && getEditorItemType(property.editor))
132
- || null;
133
- function getEditorItemType(editor) {
134
- const editorTypeMap = {
135
- requestListSources: 'object',
136
- stringList: 'string',
137
- json: 'object',
138
- globs: 'object',
139
- };
140
- return editorTypeMap[editor] || null;
141
- }
142
- }
143
- /**
144
- * Add enum values as string to property descriptions.
145
- *
146
- * This is done as a preventive measure to prevent cases where library or agent framework
147
- * does not handle enums or examples based on JSON schema definition.
148
- *
149
- * https://json-schema.org/understanding-json-schema/reference/enum
150
- * https://json-schema.org/understanding-json-schema/reference/annotations
151
- *
152
- * @param properties
153
- */
154
- function addEnumsToDescriptionsWithExamples(properties) {
155
- for (const property of Object.values(properties)) {
156
- if (property.enum && property.enum.length > 0) {
157
- property.description = `${property.description}\nPossible values: ${property.enum.slice(0, 20).join(',')}`;
158
- }
159
- const value = property.prefill ?? property.default;
160
- if (value && !(Array.isArray(value) && value.length === 0)) {
161
- property.examples = Array.isArray(value) ? value : [value];
162
- property.description = `${property.description}\nExample values: ${JSON.stringify(value)}`;
163
- }
164
- }
165
- return properties;
166
- }
167
- /**
168
- * Filters schema properties to include only the necessary fields.
169
- *
170
- * This is done to reduce the size of the input schema and to make it more readable.
171
- *
172
- * @param properties
173
- */
174
- export function filterSchemaProperties(properties) {
175
- const filteredProperties = {};
176
- for (const [key, property] of Object.entries(properties)) {
177
- filteredProperties[key] = {
178
- title: property.title,
179
- description: property.description,
180
- enum: property.enum,
181
- type: property.type,
182
- default: property.default,
183
- prefill: property.prefill,
184
- properties: property.properties,
185
- items: property.items,
186
- required: property.required,
187
- };
188
- if (property.type === 'array' && !property.items?.type) {
189
- const itemsType = inferArrayItemType(property);
190
- if (itemsType) {
191
- filteredProperties[key].items = {
192
- ...filteredProperties[key].items,
193
- title: filteredProperties[key].title ?? 'Item',
194
- description: filteredProperties[key].description ?? 'Item',
195
- type: itemsType,
196
- };
197
- }
198
- }
199
- }
200
- return filteredProperties;
201
- }
202
- /**
203
- * Marks input properties as required by adding a "REQUIRED" prefix to their descriptions.
204
- * Takes an IActorInput object and returns a modified Record of SchemaProperties.
205
- *
206
- * This is done for maximum compatibility in case where library or agent framework does not consider
207
- * required fields and does not handle the JSON schema properly: we are prepending this to the description
208
- * as a preventive measure.
209
- * @param {IActorInputSchema} input - Actor input object containing properties and required fields
210
- * @returns {Record<string, ISchemaProperties>} - Modified properties with required fields marked
211
- */
212
- function markInputPropertiesAsRequired(input) {
213
- const { required = [], properties } = input;
214
- for (const property of Object.keys(properties)) {
215
- if (required.includes(property)) {
216
- properties[property] = {
217
- ...properties[property],
218
- description: `**REQUIRED** ${properties[property].description}`,
219
- };
220
- }
221
- }
222
- return properties;
223
- }
224
- /**
225
- * Builds nested properties for object types in the schema.
226
- *
227
- * Specifically handles special cases like proxy configuration and request list sources
228
- * by adding predefined nested properties to these object types.
229
- * This is necessary for the agent to correctly infer how to structure object inputs
230
- * when passing arguments to the Actor.
231
- *
232
- * For proxy objects (type='object', editor='proxy'), adds 'useApifyProxy' property.
233
- * For request list sources (type='array', editor='requestListSources'), adds URL structure to items.
234
- *
235
- * @param {Record<string, ISchemaProperties>} properties - The input schema properties
236
- * @returns {Record<string, ISchemaProperties>} Modified properties with nested properties
237
- */
238
- function buildNestedProperties(properties) {
239
- const clonedProperties = { ...properties };
240
- for (const [propertyName, property] of Object.entries(clonedProperties)) {
241
- if (property.type === 'object' && property.editor === 'proxy') {
242
- clonedProperties[propertyName] = {
243
- ...property,
244
- properties: {
245
- ...property.properties,
246
- useApifyProxy: {
247
- title: 'Use Apify Proxy',
248
- type: 'boolean',
249
- description: 'Whether to use Apify Proxy - ALWAYS SET TO TRUE.',
250
- default: true,
251
- examples: [true],
252
- },
253
- },
254
- required: ['useApifyProxy'],
255
- };
256
- }
257
- else if (property.type === 'array' && property.editor === 'requestListSources') {
258
- clonedProperties[propertyName] = {
259
- ...property,
260
- items: {
261
- ...property.items,
262
- type: 'object',
263
- title: 'Request list source',
264
- description: 'Request list source',
265
- properties: {
266
- url: {
267
- title: 'URL',
268
- type: 'string',
269
- description: 'URL of the request list source',
270
- },
271
- },
272
- },
273
- };
274
- }
275
- }
276
- return clonedProperties;
277
- }
278
- /**
279
- * Fetches actor input schemas by Actor IDs or Actor full names and creates MCP tools.
280
- *
281
- * This function retrieves the input schemas for the specified actors and compiles them into MCP tools.
282
- * It uses the AJV library to validate the input schemas.
283
- *
284
- * Tool name can't contain /, so it is replaced with _
285
- *
286
- * The input schema processing workflow:
287
- * 1. Properties are marked as required using markInputPropertiesAsRequired() to add "REQUIRED" prefix to descriptions
288
- * 2. Nested properties are built by analyzing editor type (proxy, requestListSources) using buildNestedProperties()
289
- * 3. Properties are filtered using filterSchemaProperties()
290
- * 4. Properties are shortened using shortenProperties()
291
- * 5. Enums are added to descriptions with examples using addEnumsToDescriptionsWithExamples()
292
- *
293
- * @param {string[]} actors - An array of actor IDs or Actor full names.
294
- * @returns {Promise<Tool[]>} - A promise that resolves to an array of MCP tools.
295
- */
296
- export async function getActorsAsTools(actors) {
297
- const ajv = new Ajv({ coerceTypes: 'array', strict: false });
298
- const results = await Promise.all(actors.map(getActorDefinition));
299
- const tools = [];
300
- for (const result of results) {
301
- if (result) {
302
- if (result.input && 'properties' in result.input && result.input) {
303
- result.input.properties = markInputPropertiesAsRequired(result.input);
304
- result.input.properties = buildNestedProperties(result.input.properties);
305
- result.input.properties = filterSchemaProperties(result.input.properties);
306
- result.input.properties = shortenProperties(result.input.properties);
307
- result.input.properties = addEnumsToDescriptionsWithExamples(result.input.properties);
308
- }
309
- try {
310
- const memoryMbytes = result.defaultRunOptions?.memoryMbytes || defaults.maxMemoryMbytes;
311
- tools.push({
312
- name: actorNameToToolName(result.actorFullName),
313
- actorFullName: result.actorFullName,
314
- description: `${result.description} Instructions: ${ACTOR_ADDITIONAL_INSTRUCTIONS}`,
315
- inputSchema: result.input || {},
316
- ajvValidate: ajv.compile(result.input || {}),
317
- memoryMbytes: memoryMbytes > defaults.maxMemoryMbytes ? defaults.maxMemoryMbytes : memoryMbytes,
318
- });
319
- }
320
- catch (validationError) {
321
- log.error(`Failed to compile AJV schema for Actor: ${result.actorFullName}. Error: ${validationError}`);
322
- }
323
- }
324
- }
325
- return tools;
326
- }
327
- //# sourceMappingURL=actors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actors.js","sourceRoot":"","sources":["../src/actors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,QAAQ,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC7I,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACjD,OAAO,SAAS;SACX,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;SACzB,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,aAAqB,EAAE,QAAgB,uBAAuB;IACnG,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,KAAK,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C,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC5C,YAAY,EAAE,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;iBAClG,CAAC,CAAC;YACP,CAAC;YAAC,OAAO,eAAe,EAAE,CAAC;gBACvB,GAAG,CAAC,KAAK,CAAC,2CAA2C,MAAM,CAAC,aAAa,YAAY,eAAe,EAAE,CAAC,CAAC;YAC5G,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
package/dist/logger.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { log } from 'apify';
2
- export { log };
3
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B,OAAO,EAAE,GAAG,EAAE,CAAC"}
package/dist/logger.js DELETED
@@ -1,4 +0,0 @@
1
- import { log } from 'apify';
2
- log.setLevel(log.LEVELS.DEBUG);
3
- export { log };
4
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,CAAC"}