mcpscraper-sdk 0.22.0 → 0.23.1
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/README.md +2 -1
- package/dist/index.cjs +16 -3
- package/dist/index.js +16 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Every non-2xx response throws a `ScraperApiError` with `status`, `code`, and the
|
|
|
40
40
|
|
|
41
41
|
## API surface
|
|
42
42
|
|
|
43
|
-
`client.tools` is the generated, typed
|
|
43
|
+
`client.tools` is the generated, typed 175-tool MCP surface. It includes 85 MCP Scraper tools and all 90 mirrored Memory tools from `contracts/mcp.tools.json`.
|
|
44
44
|
|
|
45
45
|
For multimodal results such as `meta_ad_creative_media`, call `client.tools.callToolResult(...)` to preserve native MCP image/audio/resource blocks. `callTool(...)` remains backward-compatible and returns the parsed structured or text value.
|
|
46
46
|
|
|
@@ -50,6 +50,7 @@ await client.tools.web.archiveRead({
|
|
|
50
50
|
url: 'https://github.com/octocat/Hello-World/archive/refs/heads/master.zip',
|
|
51
51
|
path: 'Hello-World-master/README',
|
|
52
52
|
})
|
|
53
|
+
const method = await client.tools.editorial.readingRoomGuide({ focus: 'workflow' })
|
|
53
54
|
await client.tools.memory.search({ query: 'roofing warranty terms' })
|
|
54
55
|
await client.tools.connections.exportConnectedServiceData({
|
|
55
56
|
connectionId: 'conn_123',
|
package/dist/index.cjs
CHANGED
|
@@ -38,16 +38,29 @@ function readString(body, key) {
|
|
|
38
38
|
}
|
|
39
39
|
return void 0;
|
|
40
40
|
}
|
|
41
|
+
var PUBLIC_SERVICE_UNAVAILABLE_MESSAGE = "This operation is temporarily unavailable. Please retry later.";
|
|
42
|
+
function publicErrorBody(status, body) {
|
|
43
|
+
if (status < 500) return body;
|
|
44
|
+
return {
|
|
45
|
+
error: "service_unavailable",
|
|
46
|
+
error_code: "service_unavailable",
|
|
47
|
+
error_type: "service_unavailable",
|
|
48
|
+
retryable: true,
|
|
49
|
+
status,
|
|
50
|
+
message: PUBLIC_SERVICE_UNAVAILABLE_MESSAGE
|
|
51
|
+
};
|
|
52
|
+
}
|
|
41
53
|
var ScraperApiError = class extends Error {
|
|
42
54
|
status;
|
|
43
55
|
code;
|
|
44
56
|
body;
|
|
45
57
|
constructor(status, body) {
|
|
46
|
-
|
|
58
|
+
const safeBody = publicErrorBody(status, body);
|
|
59
|
+
super(readString(safeBody, "message") ?? `mcpscraper.dev API request failed with status ${status}`);
|
|
47
60
|
this.name = "ScraperApiError";
|
|
48
61
|
this.status = status;
|
|
49
|
-
this.code = readString(
|
|
50
|
-
this.body =
|
|
62
|
+
this.code = readString(safeBody, "error_code") ?? readString(safeBody, "error");
|
|
63
|
+
this.body = safeBody;
|
|
51
64
|
}
|
|
52
65
|
isInsufficientBalance() {
|
|
53
66
|
return this.code === "insufficient_balance";
|
package/dist/index.js
CHANGED
|
@@ -6,16 +6,29 @@ function readString(body, key) {
|
|
|
6
6
|
}
|
|
7
7
|
return void 0;
|
|
8
8
|
}
|
|
9
|
+
var PUBLIC_SERVICE_UNAVAILABLE_MESSAGE = "This operation is temporarily unavailable. Please retry later.";
|
|
10
|
+
function publicErrorBody(status, body) {
|
|
11
|
+
if (status < 500) return body;
|
|
12
|
+
return {
|
|
13
|
+
error: "service_unavailable",
|
|
14
|
+
error_code: "service_unavailable",
|
|
15
|
+
error_type: "service_unavailable",
|
|
16
|
+
retryable: true,
|
|
17
|
+
status,
|
|
18
|
+
message: PUBLIC_SERVICE_UNAVAILABLE_MESSAGE
|
|
19
|
+
};
|
|
20
|
+
}
|
|
9
21
|
var ScraperApiError = class extends Error {
|
|
10
22
|
status;
|
|
11
23
|
code;
|
|
12
24
|
body;
|
|
13
25
|
constructor(status, body) {
|
|
14
|
-
|
|
26
|
+
const safeBody = publicErrorBody(status, body);
|
|
27
|
+
super(readString(safeBody, "message") ?? `mcpscraper.dev API request failed with status ${status}`);
|
|
15
28
|
this.name = "ScraperApiError";
|
|
16
29
|
this.status = status;
|
|
17
|
-
this.code = readString(
|
|
18
|
-
this.body =
|
|
30
|
+
this.code = readString(safeBody, "error_code") ?? readString(safeBody, "error");
|
|
31
|
+
this.body = safeBody;
|
|
19
32
|
}
|
|
20
33
|
isInsufficientBalance() {
|
|
21
34
|
return this.code === "insufficient_balance";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpscraper-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Official Node.js client for all
|
|
3
|
+
"version": "0.23.1",
|
|
4
|
+
"description": "Official Node.js client for all 175 mcpscraper.dev MCP tools and the REST API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"seo-api"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"mcpscraper-memory-sdk": "^0.
|
|
35
|
+
"mcpscraper-memory-sdk": "^0.24.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"openapi-typescript": "^7.13.0"
|