@apify/actors-mcp-server 0.10.12-beta.2 → 0.10.12-beta.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,UAA+B,GAAG,MAAM,CAsEnF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,UAA+B,GAAG,MAAM,CAoEnF"}
@@ -62,8 +62,6 @@ Some clients render widget-backed Actor tools: the response includes a live UI t
62
62
  - \`waitSecs > 0\`: waits up to that many seconds for the run to complete, then returns the result.
63
63
 
64
64
  ### Tool disambiguation
65
- - **\`${HelperTools.ACTOR_OUTPUT_GET}\` vs \`${HelperTools.DATASET_GET_ITEMS}\`:**
66
- Use \`${HelperTools.ACTOR_OUTPUT_GET}\` for Actor run outputs and \`${HelperTools.DATASET_GET_ITEMS}\` for direct dataset access.
67
65
  - **\`${HelperTools.STORE_SEARCH}\` vs \`${HelperTools.ACTOR_GET_DETAILS}\`:**
68
66
  \`${HelperTools.STORE_SEARCH}\` finds Actors; \`${HelperTools.ACTOR_GET_DETAILS}\` retrieves detailed info, README, and schema for a specific Actor.
69
67
  ${isApps
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EA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Ae,UAAU,WAAW,CAAC,UAAU;iDAChC,WAAW,CAAC,UAAU;CACtE,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/actors-mcp-server",
3
- "version": "0.10.12-beta.2",
3
+ "version": "0.10.12-beta.3",
4
4
  "type": "module",
5
5
  "description": "Apify MCP Server",
6
6
  "mcpName": "com.apify/apify-mcp-server",
@@ -1,7 +0,0 @@
1
- import type { ToolEntry } from '../../types.js';
2
- /**
3
- * This tool is used specifically for retrieving Actor output.
4
- * It is a simplified version of the get-dataset-items tool.
5
- */
6
- export declare const getActorOutput: ToolEntry;
7
- //# sourceMappingURL=get_actor_output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_actor_output.d.ts","sourceRoot":"","sources":["../../../src/tools/common/get_actor_output.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAuBnF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SA0FlB,CAAC"}
@@ -1,109 +0,0 @@
1
- import dedent from 'dedent';
2
- import { z } from 'zod';
3
- import { FAILURE_CATEGORY, HelperTools, TOOL_MAX_OUTPUT_CHARS, TOOL_STATUS } from '../../const.js';
4
- import { TOOL_TYPE } from '../../types.js';
5
- import { compileSchema } from '../../utils/ajv.js';
6
- import { getValuesByDotKeys, parseCommaSeparatedList } from '../../utils/generic.js';
7
- import { buildMCPResponse } from '../../utils/mcp.js';
8
- import { cleanEmptyProperties } from '../../utils/schema_generation.js';
9
- import { datasetItemsOutputSchema } from '../structured_output_schemas.js';
10
- /**
11
- * Zod schema for get-actor-output tool arguments
12
- */
13
- const getActorOutputArgs = z.object({
14
- datasetId: z.string().min(1).describe('Actor output dataset ID to retrieve from.'),
15
- fields: z
16
- .string()
17
- .optional()
18
- .describe('Comma-separated list of fields to include (supports dot notation like "crawl.statusCode"). For example: "crawl.statusCode,text,metadata"'),
19
- offset: z.number().optional().default(0).describe('Number of items to skip (default: 0).'),
20
- limit: z.number().optional().default(100).describe('Maximum number of items to return (default: 100).'),
21
- });
22
- /**
23
- * This tool is used specifically for retrieving Actor output.
24
- * It is a simplified version of the get-dataset-items tool.
25
- */
26
- export const getActorOutput = Object.freeze({
27
- type: TOOL_TYPE.INTERNAL,
28
- name: HelperTools.ACTOR_OUTPUT_GET,
29
- description: dedent `
30
- DEPRECATED: Use \`${HelperTools.DATASET_GET_ITEMS}\` instead.
31
- \`${HelperTools.DATASET_GET_ITEMS}\` auto-flattens dot-notation \`fields\` and defaults limit to 20.
32
-
33
- Retrieve the output dataset items of a specific Actor run using its datasetId.
34
- You can select specific fields to return (supports dot notation like "crawl.statusCode") and paginate results with offset and limit.
35
-
36
- The results will include the dataset items from the specified dataset. If you provide fields, only those fields will be included (nested fields supported via dot notation).
37
-
38
- You can obtain the datasetId from an Actor run (e.g., after calling an Actor with the call-actor tool) or from the Apify Console (Runs → Run details → Dataset ID).
39
-
40
- USAGE:
41
- - Prefer \`${HelperTools.DATASET_GET_ITEMS}\` for new code.
42
-
43
- USAGE EXAMPLES:
44
- - user_input: Get data of my last Actor run
45
- - user_input: Get number_of_likes from my dataset
46
- - user_input: Return only crawl.statusCode and url from dataset aab123`,
47
- inputSchema: z.toJSONSchema(getActorOutputArgs),
48
- outputSchema: datasetItemsOutputSchema,
49
- ajvValidate: compileSchema(z.toJSONSchema(getActorOutputArgs)),
50
- paymentRequired: true,
51
- annotations: {
52
- title: 'Get Actor output',
53
- readOnlyHint: true,
54
- destructiveHint: false,
55
- idempotentHint: true,
56
- openWorldHint: false,
57
- },
58
- call: async (toolArgs) => {
59
- const { args, apifyClient } = toolArgs;
60
- const parsed = getActorOutputArgs.parse(args);
61
- // Parse fields into array
62
- const fieldsArray = parseCommaSeparatedList(parsed.fields);
63
- // TODO: we can optimize the API level field filtering in future
64
- /**
65
- * Only top-level fields can be filtered.
66
- * If a dot is present, filtering is done here and not at the API level.
67
- */
68
- const hasDot = fieldsArray.some((field) => field.includes('.'));
69
- const response = await apifyClient.dataset(parsed.datasetId).listItems({
70
- offset: parsed.offset,
71
- limit: parsed.limit,
72
- fields: fieldsArray.length > 0 && !hasDot ? fieldsArray : undefined,
73
- clean: true,
74
- });
75
- if (!response) {
76
- return buildMCPResponse({
77
- texts: [`Dataset '${parsed.datasetId}' not found.`],
78
- isError: true,
79
- telemetry: { toolStatus: TOOL_STATUS.SOFT_FAIL, failureCategory: FAILURE_CATEGORY.INVALID_INPUT },
80
- });
81
- }
82
- let { items } = response;
83
- // Apply field selection if specified
84
- if (fieldsArray.length > 0) {
85
- items = items.map((item) => getValuesByDotKeys(item, fieldsArray));
86
- }
87
- // Clean empty properties
88
- const cleanedItems = items.map((item) => cleanEmptyProperties(item)).filter((item) => item !== undefined);
89
- let outputText = `\`\`\`json\n${JSON.stringify(cleanedItems)}\n\`\`\``;
90
- let truncated = false;
91
- if (outputText.length > TOOL_MAX_OUTPUT_CHARS) {
92
- outputText = outputText.slice(0, TOOL_MAX_OUTPUT_CHARS);
93
- truncated = true;
94
- }
95
- if (truncated) {
96
- outputText += `\n\n[Output was truncated to ${TOOL_MAX_OUTPUT_CHARS} characters to comply with the tool output limits.]`;
97
- }
98
- const structuredContent = {
99
- datasetId: parsed.datasetId,
100
- items: cleanedItems,
101
- itemCount: cleanedItems.length,
102
- totalItemCount: response.total,
103
- offset: parsed.offset,
104
- limit: parsed.limit,
105
- };
106
- return { content: [{ type: 'text', text: outputText }], structuredContent };
107
- },
108
- });
109
- //# sourceMappingURL=get_actor_output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_actor_output.js","sourceRoot":"","sources":["../../../src/tools/common/get_actor_output.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,gBAA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