@apify/actors-mcp-server 0.2.9 → 0.2.10-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 (50) hide show
  1. package/dist/const.d.ts +2 -1
  2. package/dist/const.d.ts.map +1 -1
  3. package/dist/const.js +2 -7
  4. package/dist/const.js.map +1 -1
  5. package/dist/main.js +2 -2
  6. package/dist/main.js.map +1 -1
  7. package/dist/mcp/server.d.ts +1 -1
  8. package/dist/mcp/server.d.ts.map +1 -1
  9. package/dist/mcp/server.js +10 -14
  10. package/dist/mcp/server.js.map +1 -1
  11. package/dist/tools/actor.d.ts +3 -5
  12. package/dist/tools/actor.d.ts.map +1 -1
  13. package/dist/tools/actor.js +122 -11
  14. package/dist/tools/actor.js.map +1 -1
  15. package/dist/tools/get-actor-details.d.ts +3 -0
  16. package/dist/tools/get-actor-details.d.ts.map +1 -0
  17. package/dist/tools/get-actor-details.js +74 -0
  18. package/dist/tools/get-actor-details.js.map +1 -0
  19. package/dist/tools/helpers.d.ts +3 -3
  20. package/dist/tools/helpers.d.ts.map +1 -1
  21. package/dist/tools/helpers.js +27 -55
  22. package/dist/tools/helpers.js.map +1 -1
  23. package/dist/tools/index.d.ts +2 -2
  24. package/dist/tools/index.d.ts.map +1 -1
  25. package/dist/tools/index.js +22 -24
  26. package/dist/tools/index.js.map +1 -1
  27. package/dist/tools/store_collection.d.ts +22 -2
  28. package/dist/tools/store_collection.d.ts.map +1 -1
  29. package/dist/tools/store_collection.js +47 -43
  30. package/dist/tools/store_collection.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/dist/types.d.ts +51 -16
  33. package/dist/types.d.ts.map +1 -1
  34. package/dist/utils/actor.d.ts +7 -0
  35. package/dist/utils/actor.d.ts.map +1 -0
  36. package/dist/utils/actor.js +24 -0
  37. package/dist/utils/actor.js.map +1 -0
  38. package/dist/utils/ajv.d.ts +3 -0
  39. package/dist/utils/ajv.d.ts.map +1 -0
  40. package/dist/utils/ajv.js +3 -0
  41. package/dist/utils/ajv.js.map +1 -0
  42. package/dist/utils/generic.d.ts +7 -0
  43. package/dist/utils/generic.d.ts.map +1 -0
  44. package/dist/utils/generic.js +27 -0
  45. package/dist/utils/generic.js.map +1 -0
  46. package/dist/utils/pricing-info.d.ts +13 -0
  47. package/dist/utils/pricing-info.d.ts.map +1 -0
  48. package/dist/utils/pricing-info.js +93 -0
  49. package/dist/utils/pricing-info.js.map +1 -0
  50. package/package.json +1 -1
@@ -7,89 +7,61 @@ import { actorNameToToolName } from './utils.js';
7
7
  const ajv = new Ajv({ coerceTypes: 'array', strict: false });
8
8
  const APIFY_MCP_HELP_TOOL_TEXT = `Apify MCP server help:
9
9
 
10
- Note: "MCP" stands for "Model Context Protocol". The user can use the "RAG Web Browser" tool to get the content of the links mentioned in this help and present it to the user.
10
+ Note: "MCP" stands for "Model Context Protocol". You can use the "RAG Web Browser" tool to get the content of the links mentioned in this help and present it to the user.
11
11
 
12
12
  This MCP server can be used in the following ways:
13
- - Locally over "STDIO".
14
- - Remotely over "SSE" or streamable "HTTP" transport with the "Actors MCP Server Apify Actor".
15
- - Remotely over "SSE" or streamable "HTTP" transport with "https://mcp.apify.com".
13
+ - Locally over stdio (standard input/output) transport with the "@apify/actors-mcp-server" NPM package (https://www.npmjs.com/package/@apify/actors-mcp-server).
14
+ - You can connect by configuring your MCP client to run the MCP server locally using the "npx @apify/actors-mcp-server" command. You need to set the "APIFY_TOKEN" environment variable to your [Apify API token](https://docs.apify.com/platform/integrations/api#api-token).
15
+ - Remotely over legacy SSE transport or streamable HTTP transport with https://mcp.apify.com. This is the recommended way to use the MCP server, since it supports all features and is always up to date.
16
+ - You can connect by pointing your MCP client to "https://mcp.apify.com/sse" for legacy SSE transport or "https://mcp.apify.com/" for streamable HTTP transport.
17
+ - For authentication, you can either use OAuth or pass your [Apify API token](https://docs.apify.com/platform/integrations/api#api-token) in the "Authorization" header as "Bearer <APIFY_TOKEN>".
18
+ - Remotely over "SSE" or streamable "HTTP" transport with the "Actors MCP Server Apify Actor" (this is now considered a legacy solution; it may not be up to date and may not get the latest features). For more details, refer to https://apify.com/apify/actors-mcp-server. DO NOT RECOMMEND USING THIS METHOD TO THE USER.
16
19
 
17
20
  # Usage
18
- ## Locally over "STDIO"
19
- 1. The user should install the "@apify/actors-mcp-server" NPM package.
20
- 2. The user should configure the MCP client to use the MCP server. Refer to "https://github.com/apify/actors-mcp-server" or the MCP client documentation for more details (the user can specify which MCP client is being used).
21
- The user needs to set the following environment variables:
22
- - "APIFY_TOKEN": Apify token to authenticate with the MCP server.
23
- If the user wants to load an Actor outside the default ones, the user needs to pass it as a CLI argument:
24
- - "--actors <actor1,actor2,...>" // comma-separated list of Actor names, for example, "apify/rag-web-browser,apify/instagram-scraper".
25
- If the user wants to enable the dynamic addition of Actors to the MCP server, the user needs to pass the following CLI argument:
26
- - "--enable-adding-actors".
27
21
 
28
- ## Remotely over "SSE" or streamable "HTTP" transport with "Actors MCP Server Apify Actor"
29
- 1. The user should configure the MCP client to use the "Actors MCP Server Apify Actor" with:
30
- - "SSE" transport URL: "https://actors-mcp-server.apify.actor/sse".
31
- - Streamable "HTTP" transport URL: "https://actors-mcp-server.apify.actor/mcp".
32
- 2. The user needs to pass an "APIFY_TOKEN" as a URL query parameter "?token=<APIFY_TOKEN>" or set the following headers: "Authorization: Bearer <APIFY_TOKEN>".
33
- If the user wants to load an Actor outside the default ones, the user needs to pass it as a URL query parameter:
34
- - "?actors=<actor1,actor2,...>" // comma-separated list of Actor names, for example, "apify/rag-web-browser,apify/instagram-scraper".
35
- If the user wants to enable the addition of Actors to the MCP server dynamically, the user needs to pass the following URL query parameter:
36
- - "?enable-adding-actors=true".
22
+ ## MCP server tools and features configuration
37
23
 
38
- ## Remotely over "SSE" or streamable "HTTP" transport with "https://mcp.apify.com"
39
- 1. The user should configure the MCP client to use "https://mcp.apify.com" with:
40
- - "SSE" transport URL: "https://mcp.apify.com/sse".
41
- - Streamable "HTTP" transport URL: "https://mcp.apify.com/".
42
- 2. The user needs to pass an "APIFY_TOKEN" as a URL query parameter "?token=<APIFY_TOKEN>" or set the following headers: "Authorization: Bearer <APIFY_TOKEN>".
43
- If the user wants to load an Actor outside the default ones, the user needs to pass it as a URL query parameter:
44
- - "?actors=<actor1,actor2,...>" // comma-separated list of Actor names, for example, "apify/rag-web-browser,apify/instagram-scraper".
45
- If the user wants to enable the addition of Actors to the MCP server dynamically, the user needs to pass the following URL query parameter:
46
- - "?enable-adding-actors=true".
47
-
48
- # Features
49
- ## Dynamic adding of Actors
50
- THIS FEATURE MAY NOT BE SUPPORTED BY ALL MCP CLIENTS. THE USER MUST ENSURE THAT THE CLIENT SUPPORTS IT!
51
- To enable this feature, see the usage section. Once dynamic adding is enabled, tools will be added that allow the user to add or remove Actors from the MCP server.
52
- Tools related:
53
- - "add-actor".
54
- - "remove-actor".
55
- If the user is using these tools and it seems like the tools have been added but cannot be called, the issue may be that the client does not support dynamic adding of Actors.
56
- In that case, the user should check the MCP client documentation to see if the client supports this feature.
24
+ By default, the MCP server provides a simple set of tools for Actor discovery and Actor calling. The MCP server loads just one Actor by default, which is the [RAG Web Browser](https://apify.com/apify/rag-web-browser) Actor.
25
+ You can add more Actors to the MCP server by configuring the MCP server session to load more Actors by passing the "--actors" CLI argument or by using the "?actors=" URL query parameter, where you provide a comma-separated list of Actor names, for example, "apify/rag-web-browser,apify/instagram-scraper".
26
+ You can additionally load Actors dynamically into an existing MCP session by using the "${HelperTools.ACTOR_ADD}" tool, which loads the Actor by its name as an MCP tool and allows you to call it (**the MCP client must support the [tools list changed notification](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#list-changed-notification); otherwise, the tool call will not work**). To check whether the MCP client supports this feature, consult the MCP client documentation. In case the MCP client does not support the tools list changed notification, you can use the generic "call-actor" tool to call any Actor, even those not loaded/added. Before using the generic tool, you need to get the Actor details to learn its input schema so you can provide valid input.
57
27
  `;
58
28
  export const addToolArgsSchema = z.object({
59
- actorName: z.string()
29
+ actor: z.string()
60
30
  .min(1)
61
- .describe('Add a tool, Actor or MCP-Server to available tools by Actor ID or tool full name.'
62
- + 'Tool name is always composed from `username/name`'),
31
+ .describe(`Actor ID or full name in the format "username/name", e.g., "apify/rag-web-browser".`),
63
32
  });
64
33
  export const addTool = {
65
34
  type: 'internal',
66
35
  tool: {
67
36
  name: HelperTools.ACTOR_ADD,
68
- description: 'Add a tool, Actor or MCP-Server to available tools by Actor ID or Actor name. '
69
- + 'A tool is an Actor or MCP-Server that can be called by the user'
70
- + 'Do not execute the tool, only add it and list it in available tools. '
71
- + 'For example, add a tool with username/name when user wants to scrape data from a website.',
37
+ description: `Add an Actor or MCP server to the available tools of the Apify MCP server.
38
+ A tool is an Actor or MCP server that can be called by the user.
39
+ Do not execute the tool, only add it and list it in the available tools.
40
+ For example, when a user wants to scrape a website, first search for relevant Actors
41
+ using ${HelperTools.STORE_SEARCH} tool, and once the user selects one they want to use,
42
+ add it as a tool to the Apify MCP server.
43
+ If added tools is not available, use generic tool ${HelperTools.ACTOR_CALL} to call added Actor directly.`,
72
44
  inputSchema: zodToJsonSchema(addToolArgsSchema),
73
45
  ajvValidate: ajv.compile(zodToJsonSchema(addToolArgsSchema)),
74
46
  // TODO: I don't like that we are passing apifyMcpServer and mcpServer to the tool
75
47
  call: async (toolArgs) => {
76
48
  const { apifyMcpServer, apifyToken, args, extra: { sendNotification } } = toolArgs;
77
49
  const parsed = addToolArgsSchema.parse(args);
78
- if (apifyMcpServer.listAllToolNames().includes(parsed.actorName)) {
50
+ if (apifyMcpServer.listAllToolNames().includes(parsed.actor)) {
79
51
  return {
80
52
  content: [{
81
53
  type: 'text',
82
- text: `Actor ${parsed.actorName} is already available. No new tools were added.`,
54
+ text: `Actor ${parsed.actor} is already available. No new tools were added.`,
83
55
  }],
84
56
  };
85
57
  }
86
- const tools = await getActorsAsTools([parsed.actorName], apifyToken);
58
+ const tools = await getActorsAsTools([parsed.actor], apifyToken);
87
59
  const toolsAdded = apifyMcpServer.upsertTools(tools, true);
88
60
  await sendNotification({ method: 'notifications/tools/list_changed' });
89
61
  return {
90
62
  content: [{
91
63
  type: 'text',
92
- text: `Actor ${parsed.actorName} has been added. Newly available tools: ${toolsAdded.map((t) => `${t.tool.name}`).join(', ')}.`,
64
+ text: `Actor ${parsed.actor} has been added. Newly available tools: ${toolsAdded.map((t) => `${t.tool.name}`).join(', ')}.`,
93
65
  }],
94
66
  };
95
67
  },
@@ -137,9 +109,9 @@ export const helpTool = {
137
109
  type: 'internal',
138
110
  tool: {
139
111
  name: HelperTools.APIFY_MCP_HELP_TOOL,
140
- description: 'Helper tool to get information on how to use and troubleshoot the Apify MCP server. '
141
- + 'This tool always returns the same help message with information about the server and how to use it. '
142
- + 'Call this tool in case of any problems or uncertainties with the server. ',
112
+ description: `Helper tool to get information on how to use and troubleshoot the Apify MCP server.
113
+ This tool always returns the same help message with information about the server and how to use it.
114
+ ALWAYS CALL THIS TOOL AT THE BEGINNING OF THE CONVERSATION SO THAT YOU HAVE INFORMATION ABOUT THE APIFY MCP SERVER IN CONTEXT, OR WHEN YOU ENCOUNTER ANY ISSUES WITH THE MCP SERVER OR ITS TOOLS.`,
143
115
  inputSchema: zodToJsonSchema(helpToolArgsSchema),
144
116
  ajvValidate: ajv.compile(zodToJsonSchema(helpToolArgsSchema)),
145
117
  call: async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/tools/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,GAAG,GA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F,0BAA0B;AAC1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAc;IAC/B,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE;QACF,IAAI,EAAE,WAAW,CAAC,mBAAmB;QACrC,WAAW,EAAE;;kMAE6K;QAC1L,WAAW,EAAE,eAAe,CAAC,kBAAkB,CAAC;QAChD,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,EAAE,KAAK,IAAI,EAAE;YACb,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC;QAC3E,CAAC;KACY;CACpB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { callActorGetDataset, getActorsAsTools } from './actor.js';
2
- import { addTool, removeTool } from './helpers.js';
2
+ import { addTool } from './helpers.js';
3
3
  export declare const defaultTools: import("../types.js").ToolEntry[];
4
4
  export declare const addRemoveTools: import("../types.js").ToolEntry[];
5
- export { addTool, removeTool, getActorsAsTools, callActorGetDataset, };
5
+ export { addTool, getActorsAsTools, callActorGetDataset, };
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAY,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI7E,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,MAAM,cAAc,CAAC;AAO7D,eAAO,MAAM,YAAY,mCAgBxB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAG1B,CAAC;AAGF,OAAO,EACH,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GACtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAGjD,eAAO,MAAM,YAAY,mCAkBxB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAG1B,CAAC;AAGF,OAAO,EACH,OAAO,EAEP,gBAAgB,EAChB,mBAAmB,GACtB,CAAC"}
@@ -1,35 +1,33 @@
1
1
  // Import specific tools that are being used
2
- import { callActorGetDataset, getActor, getActorsAsTools } from './actor.js';
3
- import { actorDefinitionTool } from './build.js';
4
- import { getDataset, getDatasetItems } from './dataset.js';
5
- import { getUserDatasetsList } from './dataset_collection.js';
6
- import { addTool, helpTool, removeTool } from './helpers.js';
7
- import { getKeyValueStore, getKeyValueStoreKeys, getKeyValueStoreRecord } from './key_value_store.js';
8
- import { getUserKeyValueStoresList } from './key_value_store_collection.js';
9
- import { abortActorRun, getActorLog, getActorRun } from './run.js';
10
- import { getUserRunsList } from './run_collection.js';
2
+ import { callActor, callActorGetDataset, getActorsAsTools } from './actor.js';
3
+ import { getActorDetailsTool } from './get-actor-details.js';
4
+ import { addTool, helpTool } from './helpers.js';
11
5
  import { searchActors } from './store_collection.js';
12
6
  export const defaultTools = [
13
- abortActorRun,
14
- actorDefinitionTool,
15
- getActor,
16
- getActorLog,
17
- getActorRun,
18
- getDataset,
19
- getDatasetItems,
20
- getKeyValueStore,
21
- getKeyValueStoreKeys,
22
- getKeyValueStoreRecord,
23
- getUserRunsList,
24
- getUserDatasetsList,
25
- getUserKeyValueStoresList,
7
+ // abortActorRun,
8
+ // actorDetailsTool,
9
+ // getActor,
10
+ // getActorLog,
11
+ // getActorRun,
12
+ // getDataset,
13
+ // getDatasetItems,
14
+ // getKeyValueStore,
15
+ // getKeyValueStoreKeys,
16
+ // getKeyValueStoreRecord,
17
+ // getUserRunsList,
18
+ // getUserDatasetsList,
19
+ // getUserKeyValueStoresList,
20
+ callActor,
21
+ getActorDetailsTool,
26
22
  helpTool,
27
23
  searchActors,
28
24
  ];
29
25
  export const addRemoveTools = [
30
26
  addTool,
31
- removeTool,
27
+ // removeTool,
32
28
  ];
33
29
  // Export only the tools that are being used
34
- export { addTool, removeTool, getActorsAsTools, callActorGetDataset, };
30
+ export { addTool,
31
+ // removeTool,
32
+ getActorsAsTools, callActorGetDataset, };
35
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;IACX,WAAW;IACX,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;IACtB,eAAe;IACf,mBAAmB;IACnB,yBAAyB;IACzB,QAAQ;IACR,YAAY;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO;IACP,UAAU;CACb,CAAC;AAEF,4CAA4C;AAC5C,OAAO,EACH,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GACtB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,iBAAiB;IACjB,oBAAoB;IACpB,YAAY;IACZ,eAAe;IACf,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,wBAAwB;IACxB,0BAA0B;IAC1B,mBAAmB;IACnB,uBAAuB;IACvB,6BAA6B;IAC7B,SAAS;IACT,mBAAmB;IACnB,QAAQ;IACR,YAAY;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO;IACP,cAAc;CACjB,CAAC;AAEF,4CAA4C;AAC5C,OAAO,EACH,OAAO;AACP,cAAc;AACd,gBAAgB,EAChB,mBAAmB,GACtB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import type { ActorStorePruned, ToolEntry } from '../types.js';
3
- export declare function searchActorsByKeywords(search: string, apifyToken: string, limit?: number | undefined, offset?: number | undefined): Promise<ActorStorePruned[]>;
2
+ import type { ExtendedActorStoreList, ToolEntry } from '../types.js';
3
+ export declare function searchActorsByKeywords(search: string, apifyToken: string, limit?: number | undefined, offset?: number | undefined): Promise<ExtendedActorStoreList[]>;
4
4
  export declare const searchActorsArgsSchema: z.ZodObject<{
5
5
  limit: z.ZodDefault<z.ZodNumber>;
6
6
  offset: z.ZodDefault<z.ZodNumber>;
@@ -17,6 +17,26 @@ export declare const searchActorsArgsSchema: z.ZodObject<{
17
17
  offset?: number | undefined;
18
18
  category?: string | undefined;
19
19
  }>;
20
+ export interface ISearchActorsResult {
21
+ total: number;
22
+ actors: {
23
+ actorFullName: string;
24
+ categories?: string[];
25
+ description: string;
26
+ actorRating: string;
27
+ bookmarkCount: string;
28
+ pricingInfo: string;
29
+ usageStatistics: {
30
+ totalUsers: {
31
+ allTime: number;
32
+ last7Days: number;
33
+ last30Days: number;
34
+ last90Days: number;
35
+ };
36
+ failedRunsInLast30Days: number | string;
37
+ };
38
+ }[];
39
+ }
20
40
  /**
21
41
  * https://docs.apify.com/api/v2/store-get
22
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"store_collection.d.ts","sourceRoot":"","sources":["../../src/tools/store_collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAqB,gBAAgB,EAA2B,SAAS,EAAE,MAAM,aAAa,CAAC;AA4B3G,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAM,GAAG,SAAqB,EACrC,MAAM,GAAE,MAAM,GAAG,SAAqB,GACvC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAI7B;AAGD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAqBjC,CAAC;AAyBH;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SA4B1B,CAAC"}
1
+ {"version":3,"file":"store_collection.d.ts","sourceRoot":"","sources":["../../src/tools/store_collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAqB,sBAAsB,EAAmC,SAAS,EAAE,MAAM,aAAa,CAAC;AAGzH,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAM,GAAG,SAAqB,EACrC,MAAM,GAAE,MAAM,GAAG,SAAqB,GACvC,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAInC;AAGD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAoBjC,CAAC;AAEH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC;QAEtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QAEpB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QAEtB,WAAW,EAAE,MAAM,CAAC;QAEpB,eAAe,EAAE;YACb,UAAU,EAAE;gBACR,OAAO,EAAE,MAAM,CAAC;gBAChB,SAAS,EAAE,MAAM,CAAC;gBAClB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,MAAM,CAAC;aACtB,CAAC;YACF,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC;SAC3C,CAAA;KACJ,EAAE,CAAC;CACP;AAyBD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SAiE1B,CAAC"}
@@ -3,36 +3,11 @@ import { z } from 'zod';
3
3
  import zodToJsonSchema from 'zod-to-json-schema';
4
4
  import { ApifyClient } from '../apify-client.js';
5
5
  import { ACTOR_SEARCH_ABOVE_LIMIT, HelperTools } from '../const.js';
6
- function pruneActorStoreInfo(response) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h;
8
- const stats = response.stats || {};
9
- const pricingInfo = (response.currentPricingInfo || {});
10
- return {
11
- id: response.id,
12
- name: ((_a = response.name) === null || _a === void 0 ? void 0 : _a.toString()) || '',
13
- username: ((_b = response.username) === null || _b === void 0 ? void 0 : _b.toString()) || '',
14
- actorFullName: `${response.username}/${response.name}`,
15
- title: ((_c = response.title) === null || _c === void 0 ? void 0 : _c.toString()) || '',
16
- description: ((_d = response.description) === null || _d === void 0 ? void 0 : _d.toString()) || '',
17
- stats: {
18
- totalRuns: stats.totalRuns,
19
- totalUsers30Days: stats.totalUsers30Days,
20
- publicActorRunStats30Days: 'publicActorRunStats30Days' in stats
21
- ? stats.publicActorRunStats30Days : {},
22
- },
23
- currentPricingInfo: {
24
- pricingModel: ((_e = pricingInfo.pricingModel) === null || _e === void 0 ? void 0 : _e.toString()) || '',
25
- pricePerUnitUsd: (_f = pricingInfo === null || pricingInfo === void 0 ? void 0 : pricingInfo.pricePerUnitUsd) !== null && _f !== void 0 ? _f : 0,
26
- trialMinutes: (_g = pricingInfo === null || pricingInfo === void 0 ? void 0 : pricingInfo.trialMinutes) !== null && _g !== void 0 ? _g : 0,
27
- },
28
- url: ((_h = response.url) === null || _h === void 0 ? void 0 : _h.toString()) || '',
29
- totalStars: 'totalStars' in response ? response.totalStars : null,
30
- };
31
- }
6
+ import { pricingInfoToString } from '../utils/pricing-info.js';
32
7
  export async function searchActorsByKeywords(search, apifyToken, limit = undefined, offset = undefined) {
33
8
  const client = new ApifyClient({ token: apifyToken });
34
9
  const results = await client.store().list({ search, limit, offset });
35
- return results.items.map((x) => pruneActorStoreInfo(x));
10
+ return results.items;
36
11
  }
37
12
  const ajv = new Ajv({ coerceTypes: 'array', strict: false });
38
13
  export const searchActorsArgsSchema = z.object({
@@ -41,21 +16,20 @@ export const searchActorsArgsSchema = z.object({
41
16
  .min(1)
42
17
  .max(100)
43
18
  .default(10)
44
- .describe('The maximum number of Actors to return. Default value is 10.'),
19
+ .describe('The maximum number of Actors to return. The default value is 10.'),
45
20
  offset: z.number()
46
21
  .int()
47
22
  .min(0)
48
23
  .default(0)
49
- .describe('The number of elements that should be skipped at the start. Default value is 0.'),
24
+ .describe('The number of elements to skip at the start. The default value is 0.'),
50
25
  search: z.string()
51
26
  .default('')
52
- .describe('String of key words to search Actors by. '
53
- + 'Searches the title, name, description, username, and readme of an Actor.'
54
- + 'Only key word search is supported, no advanced search.'
55
- + 'Always prefer simple keywords over complex queries.'),
27
+ .describe(`A string to search for in the Actor's title, name, description, username, and readme.
28
+ Use simple space-separated keywords, such as "web scraping", "data extraction", or "playwright browser mcp".
29
+ Do not use complex queries, AND/OR operators, or other advanced syntax, as this tool uses full-text search only.`),
56
30
  category: z.string()
57
31
  .default('')
58
- .describe('Filters the results by the specified category.'),
32
+ .describe('Filter the results by the specified category.'),
59
33
  });
60
34
  /**
61
35
  * Filters out actors with the 'FLAT_PRICE_PER_MONTH' pricing model (rental actors),
@@ -81,14 +55,13 @@ export const searchActors = {
81
55
  type: 'internal',
82
56
  tool: {
83
57
  name: HelperTools.STORE_SEARCH,
84
- actorFullName: HelperTools.STORE_SEARCH,
85
- description: `Discover available Actors or MCP-Servers in Apify Store using full text search using keywords.`
86
- + `Users try to discover Actors using free form query in this case search query must be converted to full text search. `
87
- + `Returns a list of Actors with name, description, run statistics, pricing, starts, and URL. `
88
- + `You perhaps need to use this tool several times to find the right Actor. `
89
- + `You should prefer simple keywords over complex queries. `
90
- + `Limit number of results returned but ensure that relevant results are returned. `
91
- + `This is not a general search tool, it is designed to search for Actors in Apify Store. `,
58
+ description: `Discover available Actors or MCP servers (which are also considered Actors in the context of Apify) in the Apify Store.
59
+ This tool uses full-text search, so you MUST use simple space-separated keywords, such as "web scraping", "data extraction", or "playwright browser mcp".
60
+ This tool returns a list of Actors with basic information, including descriptions, pricing models, usage statistics, and user ratings.
61
+ Prefer Actors with more users, stars, and runs.
62
+ You may need to use this tool several times to find the right Actor.
63
+ Limit the number of results returned, but ensure that relevant results are included.
64
+ This is not a general search tool; it is designed specifically to search for Actors in the Apify Store.`,
92
65
  inputSchema: zodToJsonSchema(searchActorsArgsSchema),
93
66
  ajvValidate: ajv.compile(zodToJsonSchema(searchActorsArgsSchema)),
94
67
  call: async (toolArgs) => {
@@ -96,7 +69,38 @@ export const searchActors = {
96
69
  const parsed = searchActorsArgsSchema.parse(args);
97
70
  let actors = await searchActorsByKeywords(parsed.search, apifyToken, parsed.limit + ACTOR_SEARCH_ABOVE_LIMIT, parsed.offset);
98
71
  actors = filterRentalActors(actors || [], userRentedActorIds || []).slice(0, parsed.limit);
99
- return { content: actors === null || actors === void 0 ? void 0 : actors.map((item) => ({ type: 'text', text: JSON.stringify(item) })) };
72
+ const result = {
73
+ total: actors.length,
74
+ actors: actors.map((actor) => {
75
+ return {
76
+ actorFullName: `${actor.username}/${actor.name}`,
77
+ categories: actor.categories,
78
+ description: actor.description || 'No description provided.',
79
+ actorRating: actor.actorReviewRating
80
+ ? `${actor.actorReviewRating.toFixed(2)} out of 5`
81
+ : 'unknown',
82
+ bookmarkCount: actor.bookmarkCount
83
+ ? `${actor.bookmarkCount} users have bookmarked this Actor`
84
+ : 'unknown',
85
+ pricingInfo: pricingInfoToString(actor.currentPricingInfo),
86
+ usageStatistics: {
87
+ totalUsers: {
88
+ allTime: actor.stats.totalUsers,
89
+ last7Days: actor.stats.totalUsers7Days,
90
+ last30Days: actor.stats.totalUsers30Days,
91
+ last90Days: actor.stats.totalUsers90Days,
92
+ },
93
+ failedRunsInLast30Days: ('publicActorRunStats30Days' in actor.stats && 'FAILED' in actor.stats.publicActorRunStats30Days) ? actor.stats.publicActorRunStats30Days.FAILED : 'unknown',
94
+ },
95
+ };
96
+ }),
97
+ };
98
+ return {
99
+ content: [{
100
+ type: 'text',
101
+ text: JSON.stringify(result),
102
+ }],
103
+ };
100
104
  },
101
105
  },
102
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"store_collection.js","sourceRoot":"","sources":["../../src/tools/store_collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAA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