@apify/actors-mcp-server 0.5.2 → 0.5.5

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":"actor-details.d.ts","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAqCvH"}
1
+ {"version":3,"file":"actor-details.d.ts","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKrD,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAyBvH"}
@@ -1,6 +1,6 @@
1
- import log from '@apify/log';
2
1
  import { filterSchemaProperties, shortenProperties } from '../tools/utils.js';
3
2
  import { formatActorToActorCard } from './actor-card.js';
3
+ import { logHttpError } from './logging.js';
4
4
  export async function fetchActorDetails(apifyClient, actorName) {
5
5
  try {
6
6
  const [actorInfo, buildInfo] = await Promise.all([
@@ -25,19 +25,7 @@ export async function fetchActorDetails(apifyClient, actorName) {
25
25
  };
26
26
  }
27
27
  catch (error) {
28
- // Check if it's a 404 error (actor not found) - this is expected
29
- const is404 = typeof error === 'object'
30
- && error !== null
31
- && 'statusCode' in error
32
- && error.statusCode === 404;
33
- if (is404) {
34
- // Log 404 errors at info level since they're expected (user may query non-existent actors)
35
- log.info(`Actor '${actorName}' not found`, { actorName });
36
- }
37
- else {
38
- // Log other errors at error level
39
- log.error(`Failed to fetch actor details for '${actorName}'`, { actorName, error });
40
- }
28
+ logHttpError(error, `Failed to fetch actor details for '${actorName}'`, { actorName });
41
29
  return null;
42
30
  }
43
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"actor-details.js","sourceRoot":"","sources":["../../src/utils/actor-details.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,YAAY,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAWzD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAwB,EAAE,SAAiB;IAC/E,IAAI,CAAC;QACD,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAA2C,MAAM,OAAO,CAAC,GAAG,CAAC;YACrF,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE;YAClC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KA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AC,CAAC;QACvF,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Safely extract HTTP status code from errors.
3
+ * Checks both `statusCode` and `code` properties for compatibility.
4
+ */
5
+ export declare function getHttpStatusCode(error: unknown): number | undefined;
6
+ /**
7
+ * Logs HTTP errors based on status code, following apify-core pattern.
8
+ * Uses `softFail` for status < 500 (API client errors) and `exception` for status >= 500 (API server errors).
9
+ *
10
+ * @param error - The error object
11
+ * @param message - The log message
12
+ * @param data - Additional data to include in the log
13
+ */
14
+ export declare function logHttpError<T extends object>(error: unknown, message: string, data?: T): void;
15
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/utils/logging.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAsBpE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAe9F"}
@@ -0,0 +1,51 @@
1
+ import log from '@apify/log';
2
+ /**
3
+ * Safely extract HTTP status code from errors.
4
+ * Checks both `statusCode` and `code` properties for compatibility.
5
+ */
6
+ export function getHttpStatusCode(error) {
7
+ if (typeof error !== 'object' || error === null) {
8
+ return undefined;
9
+ }
10
+ // Check for statusCode property (used by apify-client)
11
+ if ('statusCode' in error) {
12
+ const { statusCode } = error;
13
+ if (typeof statusCode === 'number' && statusCode >= 100 && statusCode < 600) {
14
+ return statusCode;
15
+ }
16
+ }
17
+ // Check for code property (used by some error types)
18
+ if ('code' in error) {
19
+ const { code } = error;
20
+ if (typeof code === 'number' && code >= 100 && code < 600) {
21
+ return code;
22
+ }
23
+ }
24
+ return undefined;
25
+ }
26
+ /**
27
+ * Logs HTTP errors based on status code, following apify-core pattern.
28
+ * Uses `softFail` for status < 500 (API client errors) and `exception` for status >= 500 (API server errors).
29
+ *
30
+ * @param error - The error object
31
+ * @param message - The log message
32
+ * @param data - Additional data to include in the log
33
+ */
34
+ export function logHttpError(error, message, data) {
35
+ const statusCode = getHttpStatusCode(error);
36
+ const errorMessage = error instanceof Error ? error.message : String(error);
37
+ if (statusCode !== undefined && statusCode < 500) {
38
+ // Client errors (< 500) - log as softFail without stack trace
39
+ log.softFail(message, { error: errorMessage, statusCode, ...data });
40
+ }
41
+ else if (statusCode !== undefined && statusCode >= 500) {
42
+ // Server errors (>= 500) - log as exception with full error (includes stack trace)
43
+ const errorObj = error instanceof Error ? error : new Error(String(error));
44
+ log.exception(errorObj, message, { statusCode, ...data });
45
+ }
46
+ else {
47
+ // No status code available - log as error
48
+ log.error(message, { error, ...data });
49
+ }
50
+ }
51
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/utils/logging.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,uDAAuD;IACvD,IAAI,YAAY,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,EAAE,UAAU,EAAE,GAAI,KAAkC,CAAC;QAC3D,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,EAAE,CAAC;YAC1E,OAAO,UAAU,CAAC;QACtB,CAAC;IACL,CAAC;IAED,qDAAqD;IACrD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;QAClB,MAAM,EAAE,IAAI,EAAE,GAAI,KAA4B,CAAC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Apify MCP server",
5
- "version": "0.5.2",
5
+ "version": "0.5.5",
6
6
  "description": "Extract data from any website using thousands of tools from the Apify Store.",
7
7
  "long_description": "Apify is the world's largest marketplace of tools for web scraping, data extraction, and web automation. You can extract structured data from social media, e-commerce, search engines, maps, travel sites, or any other website.",
8
8
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/actors-mcp-server",
3
- "version": "0.5.2",
3
+ "version": "0.5.5",
4
4
  "type": "module",
5
5
  "description": "Apify MCP Server",
6
6
  "mcpName": "com.apify/apify-mcp-server",
package/server.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/apify/apify-mcp-server",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.5.2",
10
+ "version": "0.5.5",
11
11
  "remotes": [
12
12
  {
13
13
  "type": "streamable-http",