@apify/actors-mcp-server 0.11.5-beta.9 → 0.11.6-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.
- package/dist/const.d.ts +40 -25
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +39 -26
- package/dist/const.js.map +1 -1
- package/dist/index_internals.d.ts +30 -3
- package/dist/index_internals.d.ts.map +1 -1
- package/dist/index_internals.js +5 -3
- package/dist/index_internals.js.map +1 -1
- package/dist/mcp/proxy.js +1 -1
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +26 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/utils.d.ts +2 -2
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +2 -2
- package/dist/mcp/utils.js.map +1 -1
- package/dist/payments/const.d.ts +2 -2
- package/dist/payments/const.d.ts.map +1 -1
- package/dist/payments/const.js +11 -11
- package/dist/payments/const.js.map +1 -1
- package/dist/resources/resource_service.d.ts +2 -2
- package/dist/resources/resource_service.d.ts.map +1 -1
- package/dist/resources/resource_service.js +3 -3
- package/dist/resources/resource_service.js.map +1 -1
- package/dist/tools/{utils.d.ts → actor_input_schema.d.ts} +2 -17
- package/dist/tools/actor_input_schema.d.ts.map +1 -0
- package/dist/tools/{utils.js → actor_input_schema.js} +2 -49
- package/dist/tools/actor_input_schema.js.map +1 -0
- package/dist/tools/actor_tool_naming.d.ts +17 -0
- package/dist/tools/actor_tool_naming.d.ts.map +1 -0
- package/dist/tools/actor_tool_naming.js +49 -0
- package/dist/tools/actor_tool_naming.js.map +1 -0
- package/dist/tools/actors/actor_executor.js +1 -1
- package/dist/tools/actors/actor_executor.js.map +1 -1
- package/dist/tools/actors/actor_run_response.d.ts +2 -2
- package/dist/tools/actors/actor_run_response.d.ts.map +1 -1
- package/dist/tools/actors/actor_run_response.js +10 -15
- package/dist/tools/actors/actor_run_response.js.map +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts.map +1 -1
- package/dist/tools/actors/actor_tools_factory.js +6 -5
- package/dist/tools/actors/actor_tools_factory.js.map +1 -1
- package/dist/tools/actors/add_actor.d.ts.map +1 -1
- package/dist/tools/actors/add_actor.js +8 -17
- package/dist/tools/actors/add_actor.js.map +1 -1
- package/dist/tools/actors/call_actor.d.ts +131 -1
- package/dist/tools/actors/call_actor.d.ts.map +1 -1
- package/dist/tools/actors/call_actor.js +484 -3
- package/dist/tools/actors/call_actor.js.map +1 -1
- package/dist/tools/actors/fetch_actor_details.d.ts +88 -1
- package/dist/tools/actors/fetch_actor_details.d.ts.map +1 -1
- package/dist/tools/actors/fetch_actor_details.js +229 -1
- package/dist/tools/actors/fetch_actor_details.js.map +1 -1
- package/dist/tools/actors/search_actors.d.ts +22 -1
- package/dist/tools/actors/search_actors.d.ts.map +1 -1
- package/dist/tools/actors/search_actors.js +123 -8
- package/dist/tools/actors/search_actors.js.map +1 -1
- package/dist/tools/docs/fetch_apify_docs.d.ts.map +1 -1
- package/dist/tools/docs/fetch_apify_docs.js +11 -33
- package/dist/tools/docs/fetch_apify_docs.js.map +1 -1
- package/dist/tools/docs/search_apify_docs.js +6 -6
- package/dist/tools/docs/search_apify_docs.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/registry.d.ts +6 -6
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +9 -9
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runs/abort_actor_run.d.ts.map +1 -1
- package/dist/tools/runs/abort_actor_run.js +4 -7
- package/dist/tools/runs/abort_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run.d.ts +28 -1
- package/dist/tools/runs/get_actor_run.d.ts.map +1 -1
- package/dist/tools/runs/get_actor_run.js +99 -2
- package/dist/tools/runs/get_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run_list.js +2 -2
- package/dist/tools/runs/get_actor_run_list.js.map +1 -1
- package/dist/tools/runs/get_actor_run_log.js +2 -2
- package/dist/tools/runs/get_actor_run_log.js.map +1 -1
- package/dist/tools/storage/get_dataset.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset.js +7 -6
- package/dist/tools/storage/get_dataset.js.map +1 -1
- package/dist/tools/storage/get_dataset_items.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset_items.js +6 -5
- package/dist/tools/storage/get_dataset_items.js.map +1 -1
- package/dist/tools/storage/get_dataset_list.js +4 -4
- package/dist/tools/storage/get_dataset_list.js.map +1 -1
- package/dist/tools/storage/get_dataset_schema.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset_schema.js +9 -13
- package/dist/tools/storage/get_dataset_schema.js.map +1 -1
- package/dist/tools/storage/get_key_value_store.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store.js +6 -5
- package/dist/tools/storage/get_key_value_store.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_keys.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store_keys.js +5 -4
- package/dist/tools/storage/get_key_value_store_keys.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_list.js +4 -4
- package/dist/tools/storage/get_key_value_store_list.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_record.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store_record.js +5 -4
- package/dist/tools/storage/get_key_value_store_record.js.map +1 -1
- package/dist/tools/storage/storage_helpers.d.ts +0 -15
- package/dist/tools/storage/storage_helpers.d.ts.map +1 -1
- package/dist/tools/storage/storage_helpers.js +9 -22
- package/dist/tools/storage/storage_helpers.js.map +1 -1
- package/dist/tools/widgets/call_actor_widget.d.ts.map +1 -1
- package/dist/tools/widgets/call_actor_widget.js +14 -17
- package/dist/tools/widgets/call_actor_widget.js.map +1 -1
- package/dist/tools/widgets/fetch_actor_details_widget.d.ts.map +1 -1
- package/dist/tools/widgets/fetch_actor_details_widget.js +8 -9
- package/dist/tools/widgets/fetch_actor_details_widget.js.map +1 -1
- package/dist/tools/widgets/get_actor_run_widget.js +4 -4
- package/dist/tools/widgets/get_actor_run_widget.js.map +1 -1
- package/dist/tools/widgets/search_actors_widget.d.ts.map +1 -1
- package/dist/tools/widgets/search_actors_widget.js +8 -10
- package/dist/tools/widgets/search_actors_widget.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/dist/utils/actor_details.js +1 -1
- package/dist/utils/actor_details.js.map +1 -1
- package/dist/utils/apify_docs.d.ts.map +1 -1
- package/dist/utils/apify_docs.js +16 -3
- package/dist/utils/apify_docs.js.map +1 -1
- package/dist/utils/mcp.d.ts +56 -9
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/mcp.js +80 -16
- package/dist/utils/mcp.js.map +1 -1
- package/dist/utils/payment_errors.js +2 -2
- package/dist/utils/payment_errors.js.map +1 -1
- package/dist/utils/server-instructions/index.d.ts +2 -2
- package/dist/utils/server-instructions/index.d.ts.map +1 -1
- package/dist/utils/server-instructions/index.js +19 -19
- package/dist/utils/server-instructions/index.js.map +1 -1
- package/dist/utils/server_mode.d.ts +5 -5
- package/dist/utils/server_mode.d.ts.map +1 -1
- package/dist/utils/server_mode.js +10 -10
- package/dist/utils/server_mode.js.map +1 -1
- package/dist/utils/tool_categories_helpers.d.ts +2 -2
- package/dist/utils/tool_categories_helpers.d.ts.map +1 -1
- package/dist/utils/tool_categories_helpers.js.map +1 -1
- package/dist/utils/tools.d.ts +2 -2
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +2 -2
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/tools_loader.d.ts +3 -3
- package/dist/utils/tools_loader.d.ts.map +1 -1
- package/dist/utils/tools_loader.js +12 -12
- package/dist/utils/tools_loader.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
- package/dist/tools/actors/call_actor_common.d.ts +0 -132
- package/dist/tools/actors/call_actor_common.d.ts.map +0 -1
- package/dist/tools/actors/call_actor_common.js +0 -554
- package/dist/tools/actors/call_actor_common.js.map +0 -1
- package/dist/tools/actors/fetch_actor_details_common.d.ts +0 -89
- package/dist/tools/actors/fetch_actor_details_common.d.ts.map +0 -1
- package/dist/tools/actors/fetch_actor_details_common.js +0 -235
- package/dist/tools/actors/fetch_actor_details_common.js.map +0 -1
- package/dist/tools/actors/search_actors_common.d.ts +0 -25
- package/dist/tools/actors/search_actors_common.d.ts.map +0 -1
- package/dist/tools/actors/search_actors_common.js +0 -125
- package/dist/tools/actors/search_actors_common.js.map +0 -1
- package/dist/tools/runs/get_actor_run_common.d.ts +0 -29
- package/dist/tools/runs/get_actor_run_common.d.ts.map +0 -1
- package/dist/tools/runs/get_actor_run_common.js +0 -111
- package/dist/tools/runs/get_actor_run_common.js.map +0 -1
- package/dist/tools/utils.d.ts.map +0 -1
- package/dist/tools/utils.js.map +0 -1
package/dist/const.d.ts
CHANGED
|
@@ -16,34 +16,35 @@ export declare const KV_RECORD_MAX_INLINE_BYTES: number;
|
|
|
16
16
|
export declare const DATASET_SIZE_HINT_BYTES = 50000;
|
|
17
17
|
/** Shared steer appended to large-output hints so the model narrows instead of refetching everything. */
|
|
18
18
|
export declare const NARROW_OUTPUT_HINT = "narrow with fields= or page with offset";
|
|
19
|
-
/** When `false`, `resolveServerMode('auto', ...)` forces {@link
|
|
19
|
+
/** When `false`, `resolveServerMode('auto', ...)` forces {@link SERVER_MODE.DEFAULT} regardless of client capabilities. */
|
|
20
20
|
export declare const SERVER_MODE_AUTO_DETECTION_ENABLED = true;
|
|
21
21
|
export declare const SERVER_NAME = "apify-mcp-server";
|
|
22
22
|
export declare const SERVER_TITLE = "Apify MCP Server";
|
|
23
|
-
export declare
|
|
24
|
-
ACTOR_ADD
|
|
25
|
-
ACTOR_CALL
|
|
26
|
-
ACTOR_CALL_WIDGET
|
|
27
|
-
ACTOR_GET_DETAILS
|
|
28
|
-
ACTOR_GET_DETAILS_WIDGET
|
|
29
|
-
ACTOR_RUNS_ABORT
|
|
30
|
-
ACTOR_RUNS_GET
|
|
31
|
-
ACTOR_RUNS_GET_WIDGET
|
|
32
|
-
ACTOR_RUNS_LOG
|
|
33
|
-
ACTOR_RUN_LIST_GET
|
|
34
|
-
DATASET_GET
|
|
35
|
-
DATASET_LIST_GET
|
|
36
|
-
DATASET_GET_ITEMS
|
|
37
|
-
DATASET_SCHEMA_GET
|
|
38
|
-
KEY_VALUE_STORE_LIST_GET
|
|
39
|
-
KEY_VALUE_STORE_GET
|
|
40
|
-
KEY_VALUE_STORE_KEYS_GET
|
|
41
|
-
KEY_VALUE_STORE_RECORD_GET
|
|
42
|
-
STORE_SEARCH
|
|
43
|
-
STORE_SEARCH_WIDGET
|
|
44
|
-
DOCS_SEARCH
|
|
45
|
-
DOCS_FETCH
|
|
46
|
-
}
|
|
23
|
+
export declare const HELPER_TOOLS: {
|
|
24
|
+
readonly ACTOR_ADD: "add-actor";
|
|
25
|
+
readonly ACTOR_CALL: "call-actor";
|
|
26
|
+
readonly ACTOR_CALL_WIDGET: "call-actor-widget";
|
|
27
|
+
readonly ACTOR_GET_DETAILS: "fetch-actor-details";
|
|
28
|
+
readonly ACTOR_GET_DETAILS_WIDGET: "fetch-actor-details-widget";
|
|
29
|
+
readonly ACTOR_RUNS_ABORT: "abort-actor-run";
|
|
30
|
+
readonly ACTOR_RUNS_GET: "get-actor-run";
|
|
31
|
+
readonly ACTOR_RUNS_GET_WIDGET: "get-actor-run-widget";
|
|
32
|
+
readonly ACTOR_RUNS_LOG: "get-actor-log";
|
|
33
|
+
readonly ACTOR_RUN_LIST_GET: "get-actor-run-list";
|
|
34
|
+
readonly DATASET_GET: "get-dataset";
|
|
35
|
+
readonly DATASET_LIST_GET: "get-dataset-list";
|
|
36
|
+
readonly DATASET_GET_ITEMS: "get-dataset-items";
|
|
37
|
+
readonly DATASET_SCHEMA_GET: "get-dataset-schema";
|
|
38
|
+
readonly KEY_VALUE_STORE_LIST_GET: "get-key-value-store-list";
|
|
39
|
+
readonly KEY_VALUE_STORE_GET: "get-key-value-store";
|
|
40
|
+
readonly KEY_VALUE_STORE_KEYS_GET: "get-key-value-store-keys";
|
|
41
|
+
readonly KEY_VALUE_STORE_RECORD_GET: "get-key-value-store-record";
|
|
42
|
+
readonly STORE_SEARCH: "search-actors";
|
|
43
|
+
readonly STORE_SEARCH_WIDGET: "search-actors-widget";
|
|
44
|
+
readonly DOCS_SEARCH: "search-apify-docs";
|
|
45
|
+
readonly DOCS_FETCH: "fetch-apify-docs";
|
|
46
|
+
};
|
|
47
|
+
export type HelperToolName = (typeof HELPER_TOOLS)[keyof typeof HELPER_TOOLS];
|
|
47
48
|
export declare const RAG_WEB_BROWSER = "apify/rag-web-browser";
|
|
48
49
|
export declare const RAG_WEB_BROWSER_WHITELISTED_FIELDS: string[];
|
|
49
50
|
export declare const RAG_WEB_BROWSER_ADDITIONAL_DESC = "Use this tool when user wants to GET or RETRIEVE actual data immediately (one-time data retrieval).\nThis tool directly fetches and returns data - it does NOT just find tools.\n\nExamples of when to use:\n- User wants current/immediate data (e.g., \"Get flight prices for tomorrow\", \"What's the weather today?\")\n- User needs to fetch specific content now (e.g., \"Fetch news articles from CNN\", \"Get product info from Amazon\")\n- User has time indicators like \"today\", \"current\", \"latest\", \"recent\", \"now\"\n\nThis is for general web scraping and immediate data needs. For repeated/scheduled scraping of specific platforms (e-commerce, social media), consider suggesting a specialized Actor from the Store for better performance and reliability.";
|
|
@@ -90,6 +91,20 @@ export declare const DOCS_SOURCES: readonly [{
|
|
|
90
91
|
readonly facetFilters: readonly ["language:en", readonly ["docusaurus_tag:docs-default-current"]];
|
|
91
92
|
readonly description: string;
|
|
92
93
|
}];
|
|
94
|
+
/**
|
|
95
|
+
* Word window for Algolia `attributesToSnippet` in `search-apify-docs`. Bounds each hit to a
|
|
96
|
+
* match-centered snippet instead of the full indexed `content` attribute — API-reference records
|
|
97
|
+
* inline the whole OpenAPI schema (~34.5k chars each), so 20 hits returned ~173k tokens. The agent
|
|
98
|
+
* fetches full pages via `fetch-apify-docs`.
|
|
99
|
+
*/
|
|
100
|
+
export declare const DOCS_SNIPPET_MAX_WORDS = 100;
|
|
101
|
+
/**
|
|
102
|
+
* Sentinel used as Algolia `highlightPreTag`/`highlightPostTag` for docs snippets, stripped before
|
|
103
|
+
* returning. An empty-string tag is treated as "unset" and falls back to Algolia's default
|
|
104
|
+
* `<span class="algolia-docsearch-suggestion--highlight">` markup, so we set a private-use
|
|
105
|
+
* character (U+E000) and remove it.
|
|
106
|
+
*/
|
|
107
|
+
export declare const DOCS_SNIPPET_HIGHLIGHT_TAG = "\uE000";
|
|
93
108
|
export declare const ALLOWED_DOC_DOMAINS: readonly ["https://docs.apify.com", "https://crawlee.dev"];
|
|
94
109
|
export declare const APIFY_STORE_URL = "https://apify.com";
|
|
95
110
|
/** Apify Console origin (production). */
|
package/dist/const.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../src/const.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAE7C,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAa,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,yGAAyG;AACzG,eAAO,MAAM,kBAAkB,4CAA4C,CAAC;AAG5E,
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../src/const.ts"],"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sBAAsB,CAAC;AACnD,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAC5D,kGAAkG;AAClG,eAAO,MAAM,wBAAwB,kDAAkD,CAAC;AACxF,2GAA2G;AAC3G,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,eAAO,MAAM,iBAAiB,kCAAmC,CAAC;AAClE,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAClE,eAAO,MAAM,aAAa,0BAA0B,CAAC;AACrD,eAAO,MAAM,kBAAkB,qDAAqD,CAAC;AAGrF,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAAqB,CAAC;AAGxD;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAGX,eAAO,MAAM,6CAA6C,uCAAuC,CAAC;AAClG,eAAO,MAAM,sCAAsC,0BAA0B,CAAC;AAC9E,eAAO,MAAM,wCAAwC,4BAA4B,CAAC;AAGlF,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,cAAc,MAAM,CAAC;AAGlC,eAAO,MAAM,iCAAiC,mCAAoC,CAAC"}
|
package/dist/const.js
CHANGED
|
@@ -21,35 +21,34 @@ export const DATASET_SIZE_HINT_BYTES = 50000;
|
|
|
21
21
|
/** Shared steer appended to large-output hints so the model narrows instead of refetching everything. */
|
|
22
22
|
export const NARROW_OUTPUT_HINT = 'narrow with fields= or page with offset';
|
|
23
23
|
// MCP Server
|
|
24
|
-
/** When `false`, `resolveServerMode('auto', ...)` forces {@link
|
|
24
|
+
/** When `false`, `resolveServerMode('auto', ...)` forces {@link SERVER_MODE.DEFAULT} regardless of client capabilities. */
|
|
25
25
|
export const SERVER_MODE_AUTO_DETECTION_ENABLED = true;
|
|
26
26
|
export const SERVER_NAME = 'apify-mcp-server';
|
|
27
27
|
export const SERVER_TITLE = 'Apify MCP Server';
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})(HelperTools || (HelperTools = {}));
|
|
28
|
+
export const HELPER_TOOLS = {
|
|
29
|
+
ACTOR_ADD: 'add-actor',
|
|
30
|
+
ACTOR_CALL: 'call-actor',
|
|
31
|
+
ACTOR_CALL_WIDGET: 'call-actor-widget',
|
|
32
|
+
ACTOR_GET_DETAILS: 'fetch-actor-details',
|
|
33
|
+
ACTOR_GET_DETAILS_WIDGET: 'fetch-actor-details-widget',
|
|
34
|
+
ACTOR_RUNS_ABORT: 'abort-actor-run',
|
|
35
|
+
ACTOR_RUNS_GET: 'get-actor-run',
|
|
36
|
+
ACTOR_RUNS_GET_WIDGET: 'get-actor-run-widget',
|
|
37
|
+
ACTOR_RUNS_LOG: 'get-actor-log',
|
|
38
|
+
ACTOR_RUN_LIST_GET: 'get-actor-run-list',
|
|
39
|
+
DATASET_GET: 'get-dataset',
|
|
40
|
+
DATASET_LIST_GET: 'get-dataset-list',
|
|
41
|
+
DATASET_GET_ITEMS: 'get-dataset-items',
|
|
42
|
+
DATASET_SCHEMA_GET: 'get-dataset-schema',
|
|
43
|
+
KEY_VALUE_STORE_LIST_GET: 'get-key-value-store-list',
|
|
44
|
+
KEY_VALUE_STORE_GET: 'get-key-value-store',
|
|
45
|
+
KEY_VALUE_STORE_KEYS_GET: 'get-key-value-store-keys',
|
|
46
|
+
KEY_VALUE_STORE_RECORD_GET: 'get-key-value-store-record',
|
|
47
|
+
STORE_SEARCH: 'search-actors',
|
|
48
|
+
STORE_SEARCH_WIDGET: 'search-actors-widget',
|
|
49
|
+
DOCS_SEARCH: 'search-apify-docs',
|
|
50
|
+
DOCS_FETCH: 'fetch-apify-docs',
|
|
51
|
+
};
|
|
53
52
|
export const RAG_WEB_BROWSER = 'apify/rag-web-browser';
|
|
54
53
|
export const RAG_WEB_BROWSER_WHITELISTED_FIELDS = ['query', 'maxResults', 'outputFormats'];
|
|
55
54
|
export const RAG_WEB_BROWSER_ADDITIONAL_DESC = `Use this tool when user wants to GET or RETRIEVE actual data immediately (one-time data retrieval).
|
|
@@ -111,6 +110,20 @@ export const DOCS_SOURCES = [
|
|
|
111
110
|
'It handles blocking, crawling, proxies, and browsers for you.',
|
|
112
111
|
},
|
|
113
112
|
];
|
|
113
|
+
/**
|
|
114
|
+
* Word window for Algolia `attributesToSnippet` in `search-apify-docs`. Bounds each hit to a
|
|
115
|
+
* match-centered snippet instead of the full indexed `content` attribute — API-reference records
|
|
116
|
+
* inline the whole OpenAPI schema (~34.5k chars each), so 20 hits returned ~173k tokens. The agent
|
|
117
|
+
* fetches full pages via `fetch-apify-docs`.
|
|
118
|
+
*/
|
|
119
|
+
export const DOCS_SNIPPET_MAX_WORDS = 100;
|
|
120
|
+
/**
|
|
121
|
+
* Sentinel used as Algolia `highlightPreTag`/`highlightPostTag` for docs snippets, stripped before
|
|
122
|
+
* returning. An empty-string tag is treated as "unset" and falls back to Algolia's default
|
|
123
|
+
* `<span class="algolia-docsearch-suggestion--highlight">` markup, so we set a private-use
|
|
124
|
+
* character (U+E000) and remove it.
|
|
125
|
+
*/
|
|
126
|
+
export const DOCS_SNIPPET_HIGHLIGHT_TAG = '\uE000';
|
|
114
127
|
export const ALLOWED_DOC_DOMAINS = ['https://docs.apify.com', 'https://crawlee.dev'];
|
|
115
128
|
export const APIFY_STORE_URL = 'https://apify.com';
|
|
116
129
|
/** Apify Console origin (production). */
|
package/dist/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../src/const.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAK,CAAC;AAC7C,0HAA0H;AAC1H,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,kBAAkB;AAClB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAK,CAAC,CAAC,kGAAkG;AAEhJ,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,GAAG,IAAI,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,yCAAyC,CAAC;AAE5E,aAAa;AACb,
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../src/const.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAK,CAAC;AAC7C,0HAA0H;AAC1H,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,kBAAkB;AAClB,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAK,CAAC,CAAC,kGAAkG;AAEhJ,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,GAAG,IAAI,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,yCAAyC,CAAC;AAE5E,aAAa;AACb,2HAA2H;AAC3H,MAAM,CAAC,MAAM,kC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,iBAAiB,GAAG,GAAG,CAAC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,qDAAqD;AACrD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAU,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ApifyClient } from './apify_client.js';
|
|
2
|
-
import { APIFY_FAVICON_URL, defaults,
|
|
2
|
+
import { APIFY_FAVICON_URL, defaults, HELPER_TOOLS, type HelperToolName, SERVER_NAME, SERVER_TITLE } from './const.js';
|
|
3
3
|
import { processParamsGetTools } from './mcp/utils.js';
|
|
4
4
|
import { resolvePaymentProvider } from './payments/index.js';
|
|
5
5
|
import type { PaymentProvider } from './payments/types.js';
|
|
6
6
|
import { getServerCard } from './server_card.js';
|
|
7
|
+
import { actorNameToToolName } from './tools/actor_tool_naming.js';
|
|
7
8
|
import { addActor } from './tools/actors/add_actor.js';
|
|
8
9
|
import { getActorsAsTools, getCategoryTools, getDefaultTools, getUnauthEnabledToolCategories, toolCategoriesEnabledByDefault, unauthEnabledTools } from './tools/index.js';
|
|
9
|
-
import { actorNameToToolName } from './tools/utils.js';
|
|
10
10
|
import type { ActorStore, ServerCard, ToolCategory } from './types.js';
|
|
11
11
|
import { parseCommaSeparatedList, parseQueryParamList, readJsonFile } from './utils/generic.js';
|
|
12
12
|
import { redactSkyfirePayId } from './utils/logging.js';
|
|
13
13
|
import { getExpectedToolNamesByCategories } from './utils/tool_categories_helpers.js';
|
|
14
14
|
import { getToolPublicFieldOnly } from './utils/tools.js';
|
|
15
15
|
import { TTLLRUCache } from './utils/ttl_lru.js';
|
|
16
|
-
export { APIFY_FAVICON_URL, ApifyClient, getExpectedToolNamesByCategories, getServerCard, TTLLRUCache, actorNameToToolName,
|
|
16
|
+
export { APIFY_FAVICON_URL, ApifyClient, getExpectedToolNamesByCategories, getServerCard, TTLLRUCache, actorNameToToolName, HELPER_TOOLS, type HelperToolName, SERVER_NAME, SERVER_TITLE, defaults, getDefaultTools, addActor,
|
|
17
17
|
/**
|
|
18
18
|
* @deprecated Use `addActor` instead. Kept for the apify-mcp-server-internal migration; remove once it no longer imports `addTool`.
|
|
19
19
|
*/
|
|
@@ -22,4 +22,31 @@ addActor as addTool, getCategoryTools, toolCategoriesEnabledByDefault, type Acto
|
|
|
22
22
|
* @deprecated Use the server's paymentProvider.redactForLogging instead. This will be removed in a future release.
|
|
23
23
|
*/
|
|
24
24
|
redactSkyfirePayId, };
|
|
25
|
+
/** @deprecated Use HELPER_TOOLS / HelperToolName. Kept for backward compatibility with apify-mcp-server-internal. */
|
|
26
|
+
export declare const HelperTools: {
|
|
27
|
+
readonly ACTOR_ADD: "add-actor";
|
|
28
|
+
readonly ACTOR_CALL: "call-actor";
|
|
29
|
+
readonly ACTOR_CALL_WIDGET: "call-actor-widget";
|
|
30
|
+
readonly ACTOR_GET_DETAILS: "fetch-actor-details";
|
|
31
|
+
readonly ACTOR_GET_DETAILS_WIDGET: "fetch-actor-details-widget";
|
|
32
|
+
readonly ACTOR_RUNS_ABORT: "abort-actor-run";
|
|
33
|
+
readonly ACTOR_RUNS_GET: "get-actor-run";
|
|
34
|
+
readonly ACTOR_RUNS_GET_WIDGET: "get-actor-run-widget";
|
|
35
|
+
readonly ACTOR_RUNS_LOG: "get-actor-log";
|
|
36
|
+
readonly ACTOR_RUN_LIST_GET: "get-actor-run-list";
|
|
37
|
+
readonly DATASET_GET: "get-dataset";
|
|
38
|
+
readonly DATASET_LIST_GET: "get-dataset-list";
|
|
39
|
+
readonly DATASET_GET_ITEMS: "get-dataset-items";
|
|
40
|
+
readonly DATASET_SCHEMA_GET: "get-dataset-schema";
|
|
41
|
+
readonly KEY_VALUE_STORE_LIST_GET: "get-key-value-store-list";
|
|
42
|
+
readonly KEY_VALUE_STORE_GET: "get-key-value-store";
|
|
43
|
+
readonly KEY_VALUE_STORE_KEYS_GET: "get-key-value-store-keys";
|
|
44
|
+
readonly KEY_VALUE_STORE_RECORD_GET: "get-key-value-store-record";
|
|
45
|
+
readonly STORE_SEARCH: "search-actors";
|
|
46
|
+
readonly STORE_SEARCH_WIDGET: "search-actors-widget";
|
|
47
|
+
readonly DOCS_SEARCH: "search-apify-docs";
|
|
48
|
+
readonly DOCS_FETCH: "fetch-apify-docs";
|
|
49
|
+
};
|
|
50
|
+
/** @deprecated Use HelperToolName. */
|
|
51
|
+
export type HelperTools = HelperToolName;
|
|
25
52
|
//# sourceMappingURL=index_internals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index_internals.d.ts","sourceRoot":"","sources":["../src/index_internals.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index_internals.d.ts","sourceRoot":"","sources":["../src/index_internals.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,8BAA8B,EAC9B,8BAA8B,EAC9B,kBAAkB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EACH,iBAAiB,EACjB,WAAW,EACX,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,KAAK,cAAc,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,QAAQ;AACR;;GAEG;AACH,QAAQ,IAAI,OAAO,EACnB,gBAAgB,EAChB,8BAA8B,EAC9B,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,eAAe;AACpB;;GAEG;AACH,kBAAkB,GACrB,CAAC;AAEF,qHAAqH;AACrH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;CAAe,CAAC;AACxC,sCAAsC;AACtC,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC"}
|
package/dist/index_internals.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
This file provides essential internal functions for Apify MCP servers, serving as an internal library.
|
|
3
3
|
*/
|
|
4
4
|
import { ApifyClient } from './apify_client.js';
|
|
5
|
-
import { APIFY_FAVICON_URL, defaults,
|
|
5
|
+
import { APIFY_FAVICON_URL, defaults, HELPER_TOOLS, SERVER_NAME, SERVER_TITLE } from './const.js';
|
|
6
6
|
import { processParamsGetTools } from './mcp/utils.js';
|
|
7
7
|
import { resolvePaymentProvider } from './payments/index.js';
|
|
8
8
|
import { getServerCard } from './server_card.js';
|
|
9
|
+
import { actorNameToToolName } from './tools/actor_tool_naming.js';
|
|
9
10
|
import { addActor } from './tools/actors/add_actor.js';
|
|
10
11
|
import { getActorsAsTools, getCategoryTools, getDefaultTools, getUnauthEnabledToolCategories, toolCategoriesEnabledByDefault, unauthEnabledTools, } from './tools/index.js';
|
|
11
|
-
import { actorNameToToolName } from './tools/utils.js';
|
|
12
12
|
import { parseCommaSeparatedList, parseQueryParamList, readJsonFile } from './utils/generic.js';
|
|
13
13
|
import { redactSkyfirePayId } from './utils/logging.js';
|
|
14
14
|
import { getExpectedToolNamesByCategories } from './utils/tool_categories_helpers.js';
|
|
15
15
|
import { getToolPublicFieldOnly } from './utils/tools.js';
|
|
16
16
|
import { TTLLRUCache } from './utils/ttl_lru.js';
|
|
17
|
-
export { APIFY_FAVICON_URL, ApifyClient, getExpectedToolNamesByCategories, getServerCard, TTLLRUCache, actorNameToToolName,
|
|
17
|
+
export { APIFY_FAVICON_URL, ApifyClient, getExpectedToolNamesByCategories, getServerCard, TTLLRUCache, actorNameToToolName, HELPER_TOOLS, SERVER_NAME, SERVER_TITLE, defaults, getDefaultTools, addActor,
|
|
18
18
|
/**
|
|
19
19
|
* @deprecated Use `addActor` instead. Kept for the apify-mcp-server-internal migration; remove once it no longer imports `addTool`.
|
|
20
20
|
*/
|
|
@@ -23,4 +23,6 @@ addActor as addTool, getCategoryTools, toolCategoriesEnabledByDefault, processPa
|
|
|
23
23
|
* @deprecated Use the server's paymentProvider.redactForLogging instead. This will be removed in a future release.
|
|
24
24
|
*/
|
|
25
25
|
redactSkyfirePayId, };
|
|
26
|
+
/** @deprecated Use HELPER_TOOLS / HelperToolName. Kept for backward compatibility with apify-mcp-server-internal. */
|
|
27
|
+
export const HelperTools = HELPER_TOOLS;
|
|
26
28
|
//# sourceMappingURL=index_internals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index_internals.js","sourceRoot":"","sources":["../src/index_internals.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index_internals.js","sourceRoot":"","sources":["../src/index_internals.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAuB,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,8BAA8B,EAC9B,8BAA8B,EAC9B,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EACH,iBAAiB,EACjB,WAAW,EACX,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,YAAY,EAEZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,QAAQ;AACR;;GAEG;AACH,QAAQ,IAAI,OAAO,EACnB,gBAAgB,EAChB,8BAA8B,EAI9B,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB;AAEtB;;GAEG;AACH,kBAAkB,GACrB,CAAC;AAEF,qHAAqH;AACrH,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC"}
|
package/dist/mcp/proxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
-
import { fixedAjvCompile } from '../tools/
|
|
2
|
+
import { fixedAjvCompile } from '../tools/actor_input_schema.js';
|
|
3
3
|
import { TOOL_TYPE } from '../types.js';
|
|
4
4
|
import { ajv } from '../utils/ajv.js';
|
|
5
5
|
import { MAX_TOOL_NAME_LENGTH, SERVER_ID_LENGTH } from './const.js';
|
package/dist/mcp/proxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/mcp/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/mcp/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;A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AACN,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
|
7
7
|
import { ApifyClient } from '../apify_client.js';
|
|
8
8
|
import type { ActorsAsToolsResult } from '../tools/index.js';
|
|
9
9
|
import type { ActorsMcpServerOptions, ActorStore, Input, ToolEntry } from '../types.js';
|
|
10
|
-
import {
|
|
10
|
+
import { SERVER_MODE } from '../types.js';
|
|
11
11
|
/** Send notifications/tasks/status for taskId. Routes via session transport (no relatedRequestId).
|
|
12
12
|
* Swallows errors — notifications are advisory. */
|
|
13
13
|
export declare function emitTaskStatusNotification(taskId: string, mcpSessionId: string | undefined, taskStore: TaskStore, server: Server): Promise<void>;
|
|
@@ -28,7 +28,7 @@ export declare class ActorsMcpServer {
|
|
|
28
28
|
* Finalized inside the `initialize` request handler (see constructor) once the
|
|
29
29
|
* client's capabilities are known. Effectively set-once per connection.
|
|
30
30
|
*/
|
|
31
|
-
serverMode:
|
|
31
|
+
serverMode: SERVER_MODE;
|
|
32
32
|
/**
|
|
33
33
|
* Raw option captured from `options.serverMode` (or the legacy `uiMode`). Re-resolved
|
|
34
34
|
* inside the initialize handler when set to `'auto'`; explicit `'default'`/`'apps'`
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4DAA4D,CAAC;AAE5F,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAkC/E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;G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B;IAczB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IAoB7B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyC3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA4FzB,OAAO,CAAC,iBAAiB;IAijBzB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAmD/B;;;;;;;;;;;OAWG;YAEW,wBAAwB;YAgZxB,oBAAoB;IAmClC;;OAEG;YACW,cAAc;IA4CtB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB/B"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -13,21 +13,22 @@ import dedent from 'dedent';
|
|
|
13
13
|
import log from '@apify/log';
|
|
14
14
|
import { parseBooleanOrNull } from '@apify/utilities';
|
|
15
15
|
import { ApifyClient } from '../apify_client.js';
|
|
16
|
-
import { ALLOWED_TASK_TOOL_EXECUTION_MODES, DEFAULT_TELEMETRY_ENABLED, DEFAULT_TELEMETRY_ENV, FAILURE_CATEGORY,
|
|
16
|
+
import { ALLOWED_TASK_TOOL_EXECUTION_MODES, DEFAULT_TELEMETRY_ENABLED, DEFAULT_TELEMETRY_ENV, FAILURE_CATEGORY, HELPER_TOOLS, TOOL_STATUS, } from '../const.js';
|
|
17
17
|
import { prepareToolCallContext } from '../payments/helpers.js';
|
|
18
18
|
import { prompts } from '../prompts/index.js';
|
|
19
19
|
import { createResourceService } from '../resources/resource_service.js';
|
|
20
20
|
import { resolveAvailableWidgets } from '../resources/widgets.js';
|
|
21
21
|
import { getServerInfo } from '../server_card.js';
|
|
22
22
|
import { getTelemetryEnv, trackToolCall } from '../telemetry.js';
|
|
23
|
+
import { decodeDotPropertyNames } from '../tools/actor_input_schema.js';
|
|
24
|
+
import { legacyToolNameToNew } from '../tools/actor_tool_naming.js';
|
|
23
25
|
import { actorExecutor } from '../tools/actors/actor_executor.js';
|
|
24
|
-
import { buildPermissionApprovalResponse, checkPaymentProviderStandbyConflict
|
|
26
|
+
import { buildPermissionApprovalResponse, checkPaymentProviderStandbyConflict } from '../tools/actors/call_actor.js';
|
|
25
27
|
import { getActorsAsTools } from '../tools/index.js';
|
|
26
|
-
import {
|
|
27
|
-
import { ServerMode, TOOL_TYPE } from '../types.js';
|
|
28
|
+
import { SERVER_MODE, TOOL_TYPE } from '../types.js';
|
|
28
29
|
import { isPermissionApprovalError, remoteMcpFailureDetail } from '../utils/apify_errors.js';
|
|
29
30
|
import { getHttpStatusCode, isMcpClientFaultMessage, logHttpError, sanitizeMezmoMessage } from '../utils/logging.js';
|
|
30
|
-
import {
|
|
31
|
+
import { computeToolResponseBytes, getToolCallErrorUserText, respondErrorNoTelemetry, respondOk, } from '../utils/mcp.js';
|
|
31
32
|
import { buildPaymentRequiredResponse, isX402PaymentRequiredError } from '../utils/payment_errors.js';
|
|
32
33
|
import { createProgressTracker } from '../utils/progress.js';
|
|
33
34
|
import { getServerInstructions } from '../utils/server-instructions/index.js';
|
|
@@ -841,7 +842,7 @@ export class ActorsMcpServer {
|
|
|
841
842
|
if (!args) {
|
|
842
843
|
await failInvalidParams(dedent `
|
|
843
844
|
Missing arguments for tool "${name}".
|
|
844
|
-
Please provide the required arguments for this tool. Check the tool's input schema using ${
|
|
845
|
+
Please provide the required arguments for this tool. Check the tool's input schema using ${HELPER_TOOLS.ACTOR_GET_DETAILS} tool to see what parameters are required.
|
|
845
846
|
`, {
|
|
846
847
|
failure_category: FAILURE_CATEGORY.INVALID_INPUT,
|
|
847
848
|
...buildActorFields(actorName, actorId),
|
|
@@ -870,7 +871,7 @@ export class ActorsMcpServer {
|
|
|
870
871
|
await failInvalidParams(dedent `
|
|
871
872
|
Invalid arguments for tool "${tool.name}".
|
|
872
873
|
Validation errors: ${errorMessages}.
|
|
873
|
-
Please check the tool's input schema using ${
|
|
874
|
+
Please check the tool's input schema using ${HELPER_TOOLS.ACTOR_GET_DETAILS} tool and ensure all required parameters are provided with correct types and values.
|
|
874
875
|
`, {
|
|
875
876
|
failure_category: FAILURE_CATEGORY.INVALID_INPUT,
|
|
876
877
|
...ajvErrorDetails,
|
|
@@ -896,7 +897,7 @@ export class ActorsMcpServer {
|
|
|
896
897
|
// when fetching the task result. Task-mode `call-actor` declares
|
|
897
898
|
// `taskSupport: 'optional'`, so without this both paths would 402 by default.
|
|
898
899
|
const { paymentProvider } = this.options;
|
|
899
|
-
const isCallActorTool = tool.name ===
|
|
900
|
+
const isCallActorTool = tool.name === HELPER_TOOLS.ACTOR_CALL || tool.name === HELPER_TOOLS.ACTOR_CALL_WIDGET;
|
|
900
901
|
const actorArg = toolArgs === null || toolArgs === void 0 ? void 0 : toolArgs.actor;
|
|
901
902
|
const standbyRejection = paymentProvider && isCallActorTool && typeof actorArg === 'string' && actorArg.length > 0
|
|
902
903
|
? await checkPaymentProviderStandbyConflict({
|
|
@@ -966,7 +967,7 @@ export class ActorsMcpServer {
|
|
|
966
967
|
if (tool.type === TOOL_TYPE.INTERNAL) {
|
|
967
968
|
// Tools that may emit notifications/progress during a sync wait must be opted in here.
|
|
968
969
|
// call-actor: emits during start+waitForFinish. get-actor-run: emits when waitSecs > 0.
|
|
969
|
-
const progressTrackerOptIn = tool.name ===
|
|
970
|
+
const progressTrackerOptIn = tool.name === HELPER_TOOLS.ACTOR_CALL || tool.name === HELPER_TOOLS.ACTOR_RUNS_GET;
|
|
970
971
|
const progressTracker = progressTrackerOptIn
|
|
971
972
|
? createProgressTracker(progressToken, extra.sendNotification)
|
|
972
973
|
: null;
|
|
@@ -1005,7 +1006,7 @@ export class ActorsMcpServer {
|
|
|
1005
1006
|
await this.server.sendLoggingMessage({ level: 'error', data: msg });
|
|
1006
1007
|
toolStatus = TOOL_STATUS.SOFT_FAIL;
|
|
1007
1008
|
callDiagnostics = { ...callDiagnostics, failure_category: FAILURE_CATEGORY.INTERNAL_ERROR };
|
|
1008
|
-
return captureResult(
|
|
1009
|
+
return captureResult(respondErrorNoTelemetry(msg));
|
|
1009
1010
|
}
|
|
1010
1011
|
// Only set up notification handlers if progressToken is provided by the client
|
|
1011
1012
|
if (progressToken !== undefined && progressToken !== null) {
|
|
@@ -1063,12 +1064,7 @@ export class ActorsMcpServer {
|
|
|
1063
1064
|
toolName: tool.originToolName,
|
|
1064
1065
|
failureCategory: callDiagnostics.failure_category,
|
|
1065
1066
|
});
|
|
1066
|
-
return captureResult(
|
|
1067
|
-
texts: [
|
|
1068
|
-
`Failed to call MCP tool '${tool.originToolName}' on Actor '${tool.actorId}': ${remoteMcpFailureDetail(error)}`,
|
|
1069
|
-
],
|
|
1070
|
-
isError: true,
|
|
1071
|
-
}));
|
|
1067
|
+
return captureResult(respondErrorNoTelemetry(`Failed to call MCP tool '${tool.originToolName}' on Actor '${tool.actorId}': ${remoteMcpFailureDetail(error)}`));
|
|
1072
1068
|
}
|
|
1073
1069
|
finally {
|
|
1074
1070
|
if (client)
|
|
@@ -1168,11 +1164,15 @@ export class ActorsMcpServer {
|
|
|
1168
1164
|
validationMissingProperty: callDiagnostics.validation_missing_property,
|
|
1169
1165
|
validationAdditionalProperty: callDiagnostics.validation_additional_property,
|
|
1170
1166
|
});
|
|
1171
|
-
|
|
1172
|
-
|
|
1167
|
+
// This framework outer-catch path bypasses extractToolTelemetry (returned via
|
|
1168
|
+
// captureResult), so preserve the pre-existing wire shape { toolStatus } exactly:
|
|
1169
|
+
// reuse the local ABORTED-aware toolStatus, do NOT re-derive from the error (which
|
|
1170
|
+
// would drop ABORTED and leak failureCategory/failureHttpStatus onto the wire).
|
|
1171
|
+
return captureResult({
|
|
1172
|
+
...respondOk(getToolCallErrorUserText(name, error)),
|
|
1173
1173
|
isError: true,
|
|
1174
|
-
|
|
1175
|
-
})
|
|
1174
|
+
toolTelemetry: { toolStatus },
|
|
1175
|
+
});
|
|
1176
1176
|
}
|
|
1177
1177
|
finally {
|
|
1178
1178
|
if (shouldTrackTelemetry) {
|
|
@@ -1231,7 +1231,11 @@ export class ActorsMcpServer {
|
|
|
1231
1231
|
...params.telemetryData,
|
|
1232
1232
|
tool_status: params.toolStatus,
|
|
1233
1233
|
tool_exec_time_ms: durationMs,
|
|
1234
|
-
...
|
|
1234
|
+
...(responseBytes && {
|
|
1235
|
+
tool_response_content_bytes: responseBytes.contentBytes,
|
|
1236
|
+
tool_response_structured_content_bytes: responseBytes.structuredContentBytes,
|
|
1237
|
+
tool_response_file_bytes: responseBytes.fileBytes,
|
|
1238
|
+
}),
|
|
1235
1239
|
// Always include actor_name/actor_id; failure-specific fields are only present when callDiagnostics has them.
|
|
1236
1240
|
...params.callDiagnostics,
|
|
1237
1241
|
// Resource ids are read once here from the args + the tool's public output; no tool
|
|
@@ -1592,7 +1596,7 @@ export class ActorsMcpServer {
|
|
|
1592
1596
|
* Resolves widgets and determines which ones are ready to be served.
|
|
1593
1597
|
*/
|
|
1594
1598
|
async resolveWidgets() {
|
|
1595
|
-
if (this.serverMode !==
|
|
1599
|
+
if (this.serverMode !== SERVER_MODE.APPS) {
|
|
1596
1600
|
return;
|
|
1597
1601
|
}
|
|
1598
1602
|
try {
|