@apify/actors-mcp-server 0.10.5-beta.0 → 0.10.5-beta.10

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 (107) hide show
  1. package/dist/apify_client.d.ts.map +1 -1
  2. package/dist/apify_client.js +16 -1
  3. package/dist/apify_client.js.map +1 -1
  4. package/dist/const.d.ts +1 -1
  5. package/dist/const.d.ts.map +1 -1
  6. package/dist/const.js +1 -3
  7. package/dist/const.js.map +1 -1
  8. package/dist/dev_server.d.ts.map +1 -1
  9. package/dist/dev_server.js +24 -5
  10. package/dist/dev_server.js.map +1 -1
  11. package/dist/mcp/server.d.ts +3 -2
  12. package/dist/mcp/server.d.ts.map +1 -1
  13. package/dist/mcp/server.js +96 -51
  14. package/dist/mcp/server.js.map +1 -1
  15. package/dist/mcp/utils.d.ts +1 -1
  16. package/dist/mcp/utils.js +1 -1
  17. package/dist/tools/actor_executor.d.ts +10 -0
  18. package/dist/tools/actor_executor.d.ts.map +1 -0
  19. package/dist/tools/actor_executor.js +79 -0
  20. package/dist/tools/actor_executor.js.map +1 -0
  21. package/dist/tools/apps/call_actor.d.ts +0 -1
  22. package/dist/tools/apps/call_actor.d.ts.map +1 -1
  23. package/dist/tools/apps/call_actor.js +8 -54
  24. package/dist/tools/apps/call_actor.js.map +1 -1
  25. package/dist/tools/apps/call_actor_widget.d.ts.map +1 -1
  26. package/dist/tools/apps/call_actor_widget.js +8 -32
  27. package/dist/tools/apps/call_actor_widget.js.map +1 -1
  28. package/dist/tools/apps/get_actor_run_widget.d.ts.map +1 -1
  29. package/dist/tools/apps/get_actor_run_widget.js +15 -9
  30. package/dist/tools/apps/get_actor_run_widget.js.map +1 -1
  31. package/dist/tools/categories.d.ts +6 -0
  32. package/dist/tools/categories.d.ts.map +1 -1
  33. package/dist/tools/categories.js +7 -1
  34. package/dist/tools/categories.js.map +1 -1
  35. package/dist/tools/core/actor_run_response.d.ts +127 -0
  36. package/dist/tools/core/actor_run_response.d.ts.map +1 -0
  37. package/dist/tools/core/actor_run_response.js +551 -0
  38. package/dist/tools/core/actor_run_response.js.map +1 -0
  39. package/dist/tools/core/actor_tools_factory.d.ts +8 -3
  40. package/dist/tools/core/actor_tools_factory.d.ts.map +1 -1
  41. package/dist/tools/core/actor_tools_factory.js +39 -15
  42. package/dist/tools/core/actor_tools_factory.js.map +1 -1
  43. package/dist/tools/core/call_actor_common.d.ts +19 -39
  44. package/dist/tools/core/call_actor_common.d.ts.map +1 -1
  45. package/dist/tools/core/call_actor_common.js +196 -129
  46. package/dist/tools/core/call_actor_common.js.map +1 -1
  47. package/dist/tools/core/fetch_actor_details_common.d.ts.map +1 -1
  48. package/dist/tools/core/fetch_actor_details_common.js +1 -0
  49. package/dist/tools/core/fetch_actor_details_common.js.map +1 -1
  50. package/dist/tools/core/get_actor_run_common.d.ts +10 -49
  51. package/dist/tools/core/get_actor_run_common.d.ts.map +1 -1
  52. package/dist/tools/core/get_actor_run_common.js +51 -86
  53. package/dist/tools/core/get_actor_run_common.js.map +1 -1
  54. package/dist/tools/default/call_actor.d.ts +0 -2
  55. package/dist/tools/default/call_actor.d.ts.map +1 -1
  56. package/dist/tools/default/call_actor.js +5 -85
  57. package/dist/tools/default/call_actor.js.map +1 -1
  58. package/dist/tools/default/get_actor_run.d.ts +1 -2
  59. package/dist/tools/default/get_actor_run.d.ts.map +1 -1
  60. package/dist/tools/default/get_actor_run.js +12 -6
  61. package/dist/tools/default/get_actor_run.js.map +1 -1
  62. package/dist/tools/index.d.ts +1 -2
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +1 -2
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/structured_output_schemas.d.ts +258 -51
  67. package/dist/tools/structured_output_schemas.d.ts.map +1 -1
  68. package/dist/tools/structured_output_schemas.js +128 -68
  69. package/dist/tools/structured_output_schemas.js.map +1 -1
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/dist/types.d.ts +26 -1
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/types.js.map +1 -1
  74. package/dist/utils/mcp.d.ts +6 -0
  75. package/dist/utils/mcp.d.ts.map +1 -1
  76. package/dist/utils/mcp.js +30 -0
  77. package/dist/utils/mcp.js.map +1 -1
  78. package/dist/utils/progress.d.ts +1 -0
  79. package/dist/utils/progress.d.ts.map +1 -1
  80. package/dist/utils/progress.js +2 -2
  81. package/dist/utils/progress.js.map +1 -1
  82. package/dist/utils/server-instructions/index.d.ts.map +1 -1
  83. package/dist/utils/server-instructions/index.js +6 -7
  84. package/dist/utils/server-instructions/index.js.map +1 -1
  85. package/dist/utils/tools_loader.d.ts.map +1 -1
  86. package/dist/utils/tools_loader.js +9 -3
  87. package/dist/utils/tools_loader.js.map +1 -1
  88. package/dist/web/dist/actor-detail-widget.js +3 -0
  89. package/dist/web/dist/actor-run-widget.js +219 -216
  90. package/dist/web/dist/search-actors-widget.js +3 -0
  91. package/package.json +7 -7
  92. package/dist/tools/apps/actor_executor.d.ts +0 -8
  93. package/dist/tools/apps/actor_executor.d.ts.map +0 -1
  94. package/dist/tools/apps/actor_executor.js +0 -29
  95. package/dist/tools/apps/actor_executor.js.map +0 -1
  96. package/dist/tools/core/actor_execution.d.ts +0 -39
  97. package/dist/tools/core/actor_execution.d.ts.map +0 -1
  98. package/dist/tools/core/actor_execution.js +0 -135
  99. package/dist/tools/core/actor_execution.js.map +0 -1
  100. package/dist/tools/core/actor_response.d.ts +0 -37
  101. package/dist/tools/core/actor_response.d.ts.map +0 -1
  102. package/dist/tools/core/actor_response.js +0 -94
  103. package/dist/tools/core/actor_response.js.map +0 -1
  104. package/dist/tools/default/actor_executor.d.ts +0 -7
  105. package/dist/tools/default/actor_executor.d.ts.map +0 -1
  106. package/dist/tools/default/actor_executor.js +0 -31
  107. package/dist/tools/default/actor_executor.js.map +0 -1
@@ -1,42 +1,57 @@
1
1
  import dedent from 'dedent';
2
2
  import { z } from 'zod';
3
- import log from '@apify/log';
4
- import { FAILURE_CATEGORY, HelperTools, TOOL_STATUS } from '../../const.js';
3
+ import { HelperTools, TOOL_STATUS } from '../../const.js';
5
4
  import { getWidgetConfig, WIDGET_URIS } from '../../resources/widgets.js';
6
- import { compileSchema } from '../../utils/ajv.js';
5
+ import { compileSchema, fixZodSchemaRequired } from '../../utils/ajv.js';
7
6
  import { buildMCPResponse, buildUsageMeta } from '../../utils/mcp.js';
8
- import { generateSchemaFromItems } from '../../utils/schema_generation.js';
9
7
  import { getActorRunOutputSchema } from '../structured_output_schemas.js';
8
+ import { WAIT_SECS_MAX, WIDGET_NO_POLL_NEXT_STEP } from './actor_run_response.js';
9
+ /** Default `waitSecs` for `get-actor-run`. Intentionally non-zero so polling callers wait briefly by default. */
10
+ export const WAIT_SECS_DEFAULT = 30;
10
11
  /**
11
- * Zod schema for get-actor-run arguments — shared between default and widget variants.
12
+ * Zod schema for `get-actor-run` arguments — shared between default and widget variants.
12
13
  */
13
14
  export const getActorRunArgs = z.object({
14
15
  runId: z.string()
15
16
  .min(1)
16
17
  .describe('The ID of the Actor run.'),
18
+ waitSecs: z.number()
19
+ .int()
20
+ .min(0)
21
+ .max(WAIT_SECS_MAX)
22
+ .optional()
23
+ .default(WAIT_SECS_DEFAULT)
24
+ .describe(dedent `
25
+ Maximum seconds to wait for the run to reach a terminal state (SUCCEEDED, FAILED, ABORTED, TIMED-OUT).
26
+ 0 returns immediately with the current status. Cap: ${WAIT_SECS_MAX}. Default: ${WAIT_SECS_DEFAULT}.
27
+ `),
17
28
  });
18
- const GET_ACTOR_RUN_DESCRIPTION = `Get detailed information about a specific Actor run by runId.
19
- The results will include run metadata (status, timestamps), performance stats, and resource IDs (datasetId, keyValueStoreId, requestQueueId).
29
+ const GET_ACTOR_RUN_DESCRIPTION = `Get detailed information about a specific Actor run.
30
+
31
+ Returns run result: status, storages (datasets/keyValueStores alias map), stats, summary, nextStep.
32
+ - summary describes the past (e.g. "SUCCEEDED in 22s. 47 items; 3 fields available.").
33
+ - nextStep prescribes one primary follow-up action with identifiers interpolated (e.g. "Use get-dataset-items with datasetId=...").
34
+ - waitSecs (0–${WAIT_SECS_MAX}, default ${WAIT_SECS_DEFAULT}) waits up to that many seconds for terminal status before returning.
20
35
 
21
36
  USAGE:
22
- - Use when the user asks about a specific run's status or details.
23
- - Use to check the status of a run started with call-actor (e.g., before fetching output).
24
- - Returns pure data with no UI.
25
- - If \`${HelperTools.ACTOR_CALL_WIDGET}\` or \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\` are available in this session, do NOT call this after them — those render self-polling widgets, additional polling here is forbidden duplicate work.
37
+ - Use to check the status of a run started with ${HelperTools.ACTOR_CALL}.
38
+ - Pass waitSecs > 0 to block until terminal (or until the cap elapses).
39
+ - If \`${HelperTools.ACTOR_CALL_WIDGET}\` or \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\` rendered a widget for this run, do NOT poll here — the widget self-polls.
26
40
 
27
41
  USAGE EXAMPLES:
28
- - user_input: Show details of run y2h7sK3Wc (where y2h7sK3Wc is an existing run)
29
- - user_input: What is the datasetId for run y2h7sK3Wc?`;
42
+ - user_input: Show details of run y2h7sK3Wc
43
+ - user_input: Wait for run y2h7sK3Wc to finish`;
30
44
  /**
31
- * Shared tool metadata for get-actor-run — everything except the `call` handler.
32
- * Mode-independent, data-only. No widget _meta here; the widget variant in
33
- * `src/tools/apps/get_actor_run_widget.ts` owns UI rendering.
45
+ * Shared tool metadata for `get-actor-run` — everything except the `call` handler.
46
+ * Mode-independent. Widget `_meta` lives in the widget variant.
34
47
  */
35
48
  export const getActorRunMetadata = {
36
49
  type: 'internal',
37
50
  name: HelperTools.ACTOR_RUNS_GET,
38
51
  description: GET_ACTOR_RUN_DESCRIPTION,
39
- inputSchema: z.toJSONSchema(getActorRunArgs),
52
+ // `fixZodSchemaRequired` strips fields with a real `default` from `required` so MCP clients
53
+ // that read `tools/list` see `waitSecs` as optional (matching its runtime behavior).
54
+ inputSchema: fixZodSchemaRequired(z.toJSONSchema(getActorRunArgs)),
40
55
  outputSchema: getActorRunOutputSchema,
41
56
  ajvValidate: compileSchema(z.toJSONSchema(getActorRunArgs)),
42
57
  paymentRequired: true,
@@ -48,13 +63,14 @@ export const getActorRunMetadata = {
48
63
  openWorldHint: false,
49
64
  },
50
65
  };
51
- /**
52
- * Builds the standard tool error response for get-actor-run.
53
- */
66
+ // -----------------------------------------------------------------------------
67
+ // Response builders
68
+ // -----------------------------------------------------------------------------
54
69
  export function buildGetActorRunError(runId, error) {
70
+ const errMsg = error instanceof Error ? error.message : String(error);
55
71
  return buildMCPResponse({
56
72
  texts: [dedent `
57
- Failed to get Actor run '${runId}': ${error instanceof Error ? error.message : String(error)}.
73
+ Failed to get Actor run '${runId}': ${errMsg}.
58
74
  Please verify the run ID and ensure that the run exists.
59
75
  `],
60
76
  isError: true,
@@ -62,24 +78,31 @@ export function buildGetActorRunError(runId, error) {
62
78
  });
63
79
  }
64
80
  /**
65
- * Builds the tool success response for get-actor-run in default or widget mode.
81
+ * Build the success response. `content[0]` is the JSON-stringified `structuredContent`
82
+ * mirror (per MCP spec); `content[1]` carries an LLM-readable narrative — `summary` +
83
+ * `nextStep` in default mode, a short pointer in widget mode.
66
84
  */
67
85
  export function buildGetActorRunSuccessResponse(params) {
68
86
  var _a, _b, _c, _d;
69
87
  const { run, structuredContent, widget } = params;
70
88
  if (!widget) {
71
89
  return buildMCPResponse({
72
- texts: [`# Actor Run Information\n\`\`\`json\n${JSON.stringify(run)}\n\`\`\``],
90
+ texts: [
91
+ JSON.stringify(structuredContent),
92
+ `${structuredContent.summary}\n${structuredContent.nextStep}`,
93
+ ],
73
94
  structuredContent,
74
95
  _meta: buildUsageMeta(run),
75
96
  });
76
97
  }
77
- const statusText = structuredContent.status === 'SUCCEEDED' && structuredContent.dataset
78
- ? `Actor run ${structuredContent.runId} completed successfully with ${structuredContent.dataset.totalItemCount} items. A widget has been rendered with the details.`
79
- : `Actor run ${structuredContent.runId} status: ${structuredContent.status}. A progress widget has been rendered.`;
98
+ // Override nextStep so the model reading structuredContent (content[0]) also sees no-poll guidance.
99
+ const widgetContent = { ...structuredContent, nextStep: WIDGET_NO_POLL_NEXT_STEP };
80
100
  return buildMCPResponse({
81
- texts: [statusText],
82
- structuredContent,
101
+ texts: [
102
+ JSON.stringify(widgetContent),
103
+ `Actor run ${structuredContent.runId} status: ${structuredContent.status}. A run widget has been rendered.`,
104
+ ],
105
+ structuredContent: widgetContent,
83
106
  _meta: {
84
107
  ...((_b = (_a = getWidgetConfig(WIDGET_URIS.ACTOR_RUN)) === null || _a === void 0 ? void 0 : _a.meta) !== null && _b !== void 0 ? _b : {}),
85
108
  ...((_c = buildUsageMeta(run)) !== null && _c !== void 0 ? _c : {}),
@@ -87,62 +110,4 @@ export function buildGetActorRunSuccessResponse(params) {
87
110
  },
88
111
  });
89
112
  }
90
- /**
91
- * Fetches actor run data, resolves actor name, and fetches dataset results if completed.
92
- * Shared data-fetching logic used by both default and apps variants.
93
- *
94
- * Returns the run data and structured content, or an early error response.
95
- */
96
- export async function fetchActorRunData(params) {
97
- var _a, _b;
98
- const { runId, client, mcpSessionId } = params;
99
- const run = await client.run(runId).get();
100
- if (!run) {
101
- return {
102
- error: buildMCPResponse({
103
- texts: [`Run with ID '${runId}' not found.`],
104
- isError: true,
105
- telemetry: { toolStatus: TOOL_STATUS.SOFT_FAIL, failureCategory: FAILURE_CATEGORY.INVALID_INPUT },
106
- }),
107
- };
108
- }
109
- log.debug('Get actor run', { runId, status: run.status, mcpSessionId });
110
- let actorName;
111
- if (run.actId) {
112
- try {
113
- const actor = await client.actor(run.actId).get();
114
- if (actor) {
115
- actorName = `${actor.username}/${actor.name}`;
116
- }
117
- }
118
- catch (error) {
119
- log.warning(`Failed to fetch actor name for run ${runId}`, { mcpSessionId, error });
120
- }
121
- }
122
- const structuredContent = {
123
- runId: run.id,
124
- actorName,
125
- status: run.status,
126
- startedAt: ((_a = run.startedAt) === null || _a === void 0 ? void 0 : _a.toISOString()) || '',
127
- finishedAt: (_b = run.finishedAt) === null || _b === void 0 ? void 0 : _b.toISOString(),
128
- stats: run.stats,
129
- };
130
- // If completed, fetch dataset results
131
- if (run.status === 'SUCCEEDED' && run.defaultDatasetId) {
132
- const dataset = client.dataset(run.defaultDatasetId);
133
- const datasetItems = await dataset.listItems({ limit: 5 });
134
- const generatedSchema = generateSchemaFromItems(datasetItems.items, {
135
- clean: true,
136
- arrayMode: 'all',
137
- });
138
- structuredContent.dataset = {
139
- datasetId: run.defaultDatasetId,
140
- totalItemCount: datasetItems.total,
141
- previewItemCount: datasetItems.items.length,
142
- schema: generatedSchema || { type: 'object', properties: {} },
143
- previewItems: datasetItems.items,
144
- };
145
- }
146
- return { result: { run: run, structuredContent } };
147
- }
148
113
  //# sourceMappingURL=get_actor_run_common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get_actor_run_common.js","sourceRoot":"","sources":["../../../src/tools/core/get_actor_run_common.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,GAAG,MAAM,YAAY,CAAC;AAG7B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;SACZ,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,0BA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,8 +1,6 @@
1
1
  import type { ToolEntry } from '../../types.js';
2
2
  /**
3
3
  * Default mode call-actor tool.
4
- * Supports both sync (default) and async execution.
5
- * Does not include widget metadata in responses.
6
4
  */
7
5
  export declare const defaultCallActor: ToolEntry;
8
6
  //# sourceMappingURL=call_actor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"call_actor.d.ts","sourceRoot":"","sources":["../../../src/tools/default/call_actor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAqBlE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAiGpB,CAAC"}
1
+ {"version":3,"file":"call_actor.d.ts","sourceRoot":"","sources":["../../../src/tools/default/call_actor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAWlE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAoBpB,CAAC"}
@@ -1,26 +1,16 @@
1
- import log from '@apify/log';
2
1
  import { HelperTools } from '../../const.js';
3
- import { buildUsageMeta } from '../../utils/mcp.js';
4
- import { extractActorId } from '../../utils/tools.js';
5
- import { callActorGetDataset } from '../core/actor_execution.js';
6
- import { buildActorResponseContent } from '../core/actor_response.js';
7
- import { buildCallActorDescription, buildCallActorErrorResponse, buildStartAsyncResponse, callActorAjvValidate, callActorInputSchema, callActorPreExecute, resolveAndValidateActor, } from '../core/call_actor_common.js';
8
- import { callActorOutputSchema } from '../structured_output_schemas.js';
9
- const CALL_ACTOR_DEFAULT_DESCRIPTION = buildCallActorDescription({
10
- actorGetDetailsTool: HelperTools.ACTOR_GET_DETAILS,
11
- alwaysAsync: false,
12
- });
2
+ import { buildCallActorDescription, callActorAjvValidate, callActorInputSchema, executeCallActor, } from '../core/call_actor_common.js';
3
+ import { getActorRunOutputSchema } from '../structured_output_schemas.js';
4
+ const CALL_ACTOR_DEFAULT_DESCRIPTION = buildCallActorDescription();
13
5
  /**
14
6
  * Default mode call-actor tool.
15
- * Supports both sync (default) and async execution.
16
- * Does not include widget metadata in responses.
17
7
  */
18
8
  export const defaultCallActor = Object.freeze({
19
9
  type: 'internal',
20
10
  name: HelperTools.ACTOR_CALL,
21
11
  description: CALL_ACTOR_DEFAULT_DESCRIPTION,
22
12
  inputSchema: callActorInputSchema,
23
- outputSchema: callActorOutputSchema,
13
+ outputSchema: getActorRunOutputSchema,
24
14
  ajvValidate: callActorAjvValidate,
25
15
  paymentRequired: true,
26
16
  annotations: {
@@ -34,76 +24,6 @@ export const defaultCallActor = Object.freeze({
34
24
  // Support long-running tasks
35
25
  taskSupport: 'optional',
36
26
  },
37
- call: async (toolArgs) => {
38
- const preResult = await callActorPreExecute(toolArgs, { route: HelperTools.ACTOR_CALL });
39
- if ('earlyResponse' in preResult) {
40
- return preResult.earlyResponse;
41
- }
42
- const { parsed, baseActorName } = preResult;
43
- const { input, async: isAsync = false, previewOutput = true, callOptions } = parsed;
44
- let resolvedActorId;
45
- try {
46
- const resolution = await resolveAndValidateActor({
47
- actorName: baseActorName,
48
- input: input,
49
- toolArgs,
50
- });
51
- if ('error' in resolution) {
52
- return resolution.error;
53
- }
54
- resolvedActorId = extractActorId(resolution.actor);
55
- const { apifyClient } = toolArgs;
56
- // Async mode: start run and return immediately with runId
57
- if (isAsync) {
58
- const actorClient = apifyClient.actor(baseActorName);
59
- const actorRun = await actorClient.start(input, callOptions);
60
- log.debug('Started Actor run (async)', { actorName: baseActorName, runId: actorRun.id, mcpSessionId: toolArgs.mcpSessionId });
61
- const response = buildStartAsyncResponse({
62
- actorName: baseActorName,
63
- actorRun,
64
- input,
65
- widget: false,
66
- });
67
- return {
68
- ...response,
69
- toolTelemetry: { actorId: resolvedActorId },
70
- };
71
- }
72
- // Sync mode: wait for completion and return results
73
- const callResult = await callActorGetDataset({
74
- actorName: baseActorName,
75
- input,
76
- apifyClient,
77
- callOptions,
78
- progressTracker: toolArgs.progressTracker,
79
- abortSignal: toolArgs.extra.signal,
80
- previewOutput,
81
- mcpSessionId: toolArgs.mcpSessionId,
82
- });
83
- if (!callResult) {
84
- // Receivers of cancellation notifications SHOULD NOT send a response for the cancelled request
85
- // https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation#behavior-requirements
86
- return {};
87
- }
88
- const { content, structuredContent } = buildActorResponseContent(baseActorName, callResult, previewOutput);
89
- const _meta = buildUsageMeta(callResult);
90
- return {
91
- content,
92
- structuredContent,
93
- ...(_meta && { _meta }),
94
- toolTelemetry: { actorId: resolvedActorId },
95
- };
96
- }
97
- catch (error) {
98
- return buildCallActorErrorResponse({
99
- actorName: baseActorName,
100
- error,
101
- actorId: resolvedActorId,
102
- isAsync,
103
- mcpSessionId: toolArgs.mcpSessionId,
104
- actorGetDetailsTool: HelperTools.ACTOR_GET_DETAILS,
105
- });
106
- }
107
- },
27
+ call: async (toolArgs) => executeCallActor(toolArgs),
108
28
  });
109
29
  //# sourceMappingURL=call_actor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"call_actor.js","sourceRoot":"","sources":["../../../src/tools/default/call_actor.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACH,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;IAC7D,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AAK,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;YACzC,OAAO;gBACH,OAAO;gBACP,iBAAiB;gBACjB,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;gBACvB,aAAa,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;aAC9C,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,2BAA2B,CAAC;gBAC/B,SAAS,EAAE,aAAa;gBACxB,KAAK;gBACL,OAAO,EAAE,eAAe;gBACxB,OAAO;gBACP,YAAY,EAAE,QAAQ,CAAC,YAAY;gBACnC,mBAAmB,EAAE,WAAW,CAAC,iBAAiB;aACrD,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACK,CAAC,CAAC"}
1
+ {"version":3,"file":"call_actor.js","sourceRoot":"","sources":["../../../src/tools/default/call_actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,8BAA8B,GAAG,yBAAyB,EAAE,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAc,MAAM,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,oBAAoB;IACjC,YAAY,EAAE,uBAAuB;IACrC,WAAW,EAAE,oBAAoB;IACjC,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE;QACT,KAAK,EAAE,YAAY;QACnB,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KACtB;IACD,SAAS,EAAE;QACP,6BAA6B;QAC7B,WAAW,EAAE,UAAU;KAC1B;IACD,IAAI,EAAE,KAAK,EAAE,QAA0B,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC;CAChE,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import type { ToolEntry } from '../../types.js';
2
2
  /**
3
- * Default mode get-actor-run tool.
4
- * Returns full JSON dump of the run without widget metadata.
3
+ * Default mode `get-actor-run` — returns without any widget metadata.
5
4
  */
6
5
  export declare const defaultGetActorRun: ToolEntry;
7
6
  //# sourceMappingURL=get_actor_run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get_actor_run.d.ts","sourceRoot":"","sources":["../../../src/tools/default/get_actor_run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUlE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAuBtB,CAAC"}
1
+ {"version":3,"file":"get_actor_run.d.ts","sourceRoot":"","sources":["../../../src/tools/default/get_actor_run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUlE;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SA2BtB,CAAC"}
@@ -1,23 +1,29 @@
1
1
  import { logHttpError } from '../../utils/logging.js';
2
- import { buildGetActorRunError, buildGetActorRunSuccessResponse, fetchActorRunData, getActorRunArgs, getActorRunMetadata, } from '../core/get_actor_run_common.js';
2
+ import { fetchActorRunData } from '../core/actor_run_response.js';
3
+ import { buildGetActorRunError, buildGetActorRunSuccessResponse, getActorRunArgs, getActorRunMetadata, } from '../core/get_actor_run_common.js';
3
4
  /**
4
- * Default mode get-actor-run tool.
5
- * Returns full JSON dump of the run without widget metadata.
5
+ * Default mode `get-actor-run` — returns without any widget metadata.
6
6
  */
7
7
  export const defaultGetActorRun = Object.freeze({
8
8
  ...getActorRunMetadata,
9
9
  call: async (toolArgs) => {
10
- const { args, apifyClient: client, mcpSessionId } = toolArgs;
10
+ const { args, apifyClient: client, progressTracker, mcpSessionId, extra } = toolArgs;
11
11
  const parsed = getActorRunArgs.parse(args);
12
12
  try {
13
13
  const fetchResult = await fetchActorRunData({
14
14
  runId: parsed.runId,
15
+ waitSecs: parsed.waitSecs,
15
16
  client,
17
+ progressTracker,
18
+ abortSignal: extra === null || extra === void 0 ? void 0 : extra.signal,
16
19
  mcpSessionId,
17
20
  });
18
- if ('error' in fetchResult) {
21
+ // Per MCP spec, receivers SHOULD NOT send a response for a cancelled request:
22
+ // https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation
23
+ if ('aborted' in fetchResult)
24
+ return {};
25
+ if ('error' in fetchResult)
19
26
  return fetchResult.error;
20
- }
21
27
  return buildGetActorRunSuccessResponse({ ...fetchResult.result, widget: false });
22
28
  }
23
29
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"get_actor_run.js","sourceRoot":"","sources":["../../../src/tools/default/get_actor_run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACH,qBAAqB,EACrB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAc,MAAM,CAAC,MAAM,CAAC;IACvD,GAAG,mBAAmB;IACtB,IAAI,EAAE,KAAK,EAAE,QAA0B,EAAE,EAAE;QACvC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;QAC7D,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC;YACD,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC;gBACxC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM;gBACN,YAAY;aACf,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,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM;gBAC1B,YAAY;aACf,CAAC,CAAC;YAEH,8EAA8E;YAC9E,wFAAwF;YACxF,IAAI,SAAS,IAAI,WAAW;gBAAE,OAAO,EAAE,CAAC;YACxC,IAAI,OAAO,IAAI,WAAW;gBAAE,OAAO,WAAW,CAAC,KAAK,CAAC;YAErD,OAAO,+BAA+B,CAAC,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACrF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACxE,OAAO,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;CACK,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import type { ToolCategory, ToolEntry } from '../types.js';
2
2
  import { ServerMode } from '../types.js';
3
3
  import { CATEGORY_NAME_SET, CATEGORY_NAMES, getCategoryTools, toolCategories, toolCategoriesEnabledByDefault } from './categories.js';
4
- import { callActorGetDataset } from './core/actor_execution.js';
5
4
  import { getActorsAsTools } from './core/actor_tools_factory.js';
6
5
  export declare const unauthEnabledTools: string[];
7
6
  export { CATEGORY_NAME_SET, CATEGORY_NAMES, getCategoryTools, toolCategories, toolCategoriesEnabledByDefault };
@@ -16,5 +15,5 @@ export declare function getDefaultTools(mode?: ServerMode): ToolEntry[];
16
15
  * Tool names are identical across all server modes, so no mode parameter is needed.
17
16
  */
18
17
  export declare function getUnauthEnabledToolCategories(): ToolCategory[];
19
- export { callActorGetDataset, getActorsAsTools };
18
+ export { getActorsAsTools };
20
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAA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AElF;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,YAAY,EAAE,CAM/D;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -2,7 +2,6 @@ import { HelperTools } from '../const.js';
2
2
  import { ServerMode } from '../types.js';
3
3
  import { getExpectedToolsByCategories } from '../utils/tool_categories_helpers.js';
4
4
  import { CATEGORY_NAME_SET, CATEGORY_NAMES, getCategoryTools, toolCategories, toolCategoriesEnabledByDefault } from './categories.js';
5
- import { callActorGetDataset } from './core/actor_execution.js';
6
5
  import { getActorsAsTools } from './core/actor_tools_factory.js';
7
6
  // Use string constants instead of importing tool objects to avoid circular dependency
8
7
  export const unauthEnabledTools = [
@@ -34,5 +33,5 @@ export function getUnauthEnabledToolCategories() {
34
33
  .map(([category]) => category);
35
34
  }
36
35
  // Export actor-related tools
37
- export { callActorGetDataset, getActorsAsTools };
36
+ export { getActorsAsTools };
38
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACtI,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAa;IACxC,WAAW,CAAC,WAAW;IACvB,WAAW,CAAC,UAAU;IACtB,WAAW,CAAC,YAAY;IACxB,WAAW,CAAC,iBAAiB;CAChC,CAAC;AAEF,+BAA+B;AAC/B,8DAA8D;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