@decodo/mcp-server 1.1.0 → 1.1.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.
Files changed (37) hide show
  1. package/README.md +72 -50
  2. package/build/index.js +1 -0
  3. package/build/index.js.map +1 -1
  4. package/build/server/sapi-base-server.js +1 -1
  5. package/package.json +18 -6
  6. package/build/sapi-mcp-server.js +0 -40
  7. package/build/sapi-mcp-server.js.map +0 -1
  8. package/build/tools/amazon-search-parsed/amazon-search-parsed-tool.js +0 -53
  9. package/build/tools/amazon-search-parsed/amazon-search-parsed-tool.js.map +0 -1
  10. package/build/tools/amazon-search-parsed/index.js +0 -18
  11. package/build/tools/amazon-search-parsed/index.js.map +0 -1
  12. package/build/tools/amazon-search-parsed-tool.js +0 -52
  13. package/build/tools/amazon-search-parsed-tool.js.map +0 -1
  14. package/build/tools/chatgpt-tool.js +0 -43
  15. package/build/tools/chatgpt-tool.js.map +0 -1
  16. package/build/tools/constants.js +0 -23
  17. package/build/tools/constants.js.map +0 -1
  18. package/build/tools/google-search-parsed/google-search-parsed-tool.js +0 -61
  19. package/build/tools/google-search-parsed/google-search-parsed-tool.js.map +0 -1
  20. package/build/tools/google-search-parsed/index.js +0 -18
  21. package/build/tools/google-search-parsed/index.js.map +0 -1
  22. package/build/tools/google-search-parsed-tool.js +0 -60
  23. package/build/tools/google-search-parsed-tool.js.map +0 -1
  24. package/build/tools/perplexity-tool.js +0 -42
  25. package/build/tools/perplexity-tool.js.map +0 -1
  26. package/build/tools/reddit-post-tool.js +0 -40
  27. package/build/tools/reddit-post-tool.js.map +0 -1
  28. package/build/tools/reddit-subreddit-tool.js +0 -40
  29. package/build/tools/reddit-subreddit-tool.js.map +0 -1
  30. package/build/tools/scrape-as-markdown-tool.js +0 -78
  31. package/build/tools/scrape-as-markdown-tool.js.map +0 -1
  32. package/build/tools/screenshot-tool.js +0 -44
  33. package/build/tools/screenshot-tool.js.map +0 -1
  34. package/build/tools/youtube-video/index.js +0 -18
  35. package/build/tools/youtube-video/index.js.map +0 -1
  36. package/build/tools/youtube-video/youtube-video-tool.js +0 -45
  37. package/build/tools/youtube-video/youtube-video-tool.js.map +0 -1
package/README.md CHANGED
@@ -22,8 +22,8 @@ services, streamlining access to our tools and capabilities.
22
22
 
23
23
  ## Connecting to [Decodo's MCP server](https://mcp.decodo.com/mcp)
24
24
 
25
- 1. Go to [decodo.com](https://decodo.com/scraping/web) and start a Web Scraping API plan (free
26
- trials available).
25
+ 1. Go to [decodo.com](https://decodo.com/scraping/web) and start a Web Scraping API plan (free plan
26
+ available).
27
27
 
28
28
  2. Once your plan has started, obtain a Web Scraping API basic authentication token from the
29
29
  [dashboard](https://dashboard.decodo.com/).
@@ -83,6 +83,21 @@ this:
83
83
 
84
84
  4. Update your MCP client with the server information:
85
85
 
86
+ ```
87
+ {
88
+ "mcpServers": {
89
+ "decodo-mcp": {
90
+ "command": "node",
91
+ "args": ["/Users/your.user/projects/decodo-mcp/build/index.js"],
92
+ "env": {
93
+ "SCRAPER_API_USERNAME": "your_username",
94
+ "SCRAPER_API_PASSWORD": "your_password"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
86
101
  </details>
87
102
 
88
103
  ## Toolsets
@@ -101,65 +116,72 @@ comma-separated list via the `toolsets` query parameter:
101
116
 
102
117
  When no toolsets are specified, all tools are registered.
103
118
 
104
- | Toolset | Tools |
105
- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
106
- | `web` | `scrape_as_markdown`, `screenshot` |
107
- | `search` | `google_search`, `google_ads`, `google_lens`, `google_travel_hotels`, `bing_search` |
119
+ | Toolset | Tools |
120
+ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
121
+ | `web` | `scrape_as_markdown`, `screenshot` |
122
+ | `search` | `google_search`, `google_ads`, `google_lens`, `google_travel_hotels`, `bing_search` |
108
123
  | `ecommerce` | `amazon_search`, `amazon_product`, `amazon_pricing`, `amazon_sellers`, `amazon_bestsellers`, `walmart_search`, `walmart_product`, `target_search`, `target_product`, `tiktok_shop_search`, `tiktok_shop_product`, `tiktok_shop_url` |
109
- | `social_media` | `reddit_post`, `reddit_subreddit`, `reddit_user`, `tiktok_post`, `youtube_video`, `youtube_metadata`, `youtube_channel`, `youtube_subtitles`, `youtube_search` |
110
- | `ai` | `chatgpt`, `perplexity`, `google_ai_mode` |
124
+ | `social_media` | `reddit_post`, `reddit_subreddit`, `reddit_user`, `tiktok_post`, `youtube_metadata`, `youtube_channel`, `youtube_subtitles`, `youtube_search` |
125
+ | `ai` | `chatgpt`, `perplexity`, `google_ai_mode` |
111
126
 
112
127
  ## Tools
113
128
 
114
129
  The server exposes the following tools:
115
130
 
116
- | Tool | Description | Example prompt |
117
- | ----------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
118
- | `scrape_as_markdown` | Scrapes any target URL, expects a URL to be given via prompt. Returns results in Markdown. | Scrape peacock.com from a US IP address and tell me the pricing. |
119
- | `screenshot` | Captures a screenshot of any webpage and returns it as a PNG image. | Take a screenshot of github.com from a US IP address. |
120
- | `google_search` | Scrapes Google Search for a given query, and returns parsed results. | Scrape Google Search for shoes and tell me the top position. |
121
- | `google_ads` | Scrapes Google Ads search results with automatic parsing. | Scrape Google Ads for laptop and show me the top ads. |
122
- | `google_lens` | Scrapes Google Lens image search results with automatic parsing. | Search Google Lens for this image: https://example.com/image.jpg |
123
- | `google_ai_mode` | Scrapes Google AI Mode (Search with AI) results with automatic parsing. | Ask Google AI Mode: What are the top three dog breeds? |
124
- | `google_travel_hotels` | Scrapes Google Travel Hotels search results. | Search Google Travel Hotels for hotels in Paris. |
125
- | `amazon_search` | Scrapes Amazon Search for a given query, and returns parsed results. | Scrape Amazon Search for wireless keyboard. |
126
- | `amazon_product` | Scrapes Amazon Product page with automatic parsing. | Scrape Amazon product B09H74FXNW and show me the details. |
127
- | `amazon_pricing` | Scrapes Amazon Product pricing information with automatic parsing. | Get pricing for Amazon product B09H74FXNW. |
128
- | `amazon_sellers` | Scrapes Amazon Seller information with automatic parsing. | Get information about Amazon seller A1R0Z7FJGTKESH. |
129
- | `amazon_bestsellers` | Scrapes Amazon Bestsellers list with automatic parsing. | Show me Amazon bestsellers in electronics. |
130
- | `walmart_search` | Scrapes Walmart Search for a given query, and returns parsed results. | Scrape Walmart Search for camping tent. |
131
- | `walmart_product` | Scrapes Walmart Product page with automatic parsing. | Scrape Walmart product 15296401808. |
132
- | `target_search` | Scrapes Target Search for a given query, and returns parsed results. | Scrape Target Search for kitchen appliances. |
133
- | `target_product` | Scrapes Target Product page with automatic parsing. | Scrape Target product 92186007. |
134
- | `tiktok_post` | Scrapes a TikTok post URL for structured data (e.g. engagement, caption, hashtags). | Scrape this TikTok post: https://www.tiktok.com/@nba/video/7393013274725403950 |
135
- | `tiktok_shop_search` | Scrapes TikTok Shop Search for a given query, and returns parsed results. | Scrape TikTok Shop Search for phone cases. |
136
- | `tiktok_shop_product` | Scrapes TikTok Shop Product page. | Scrape TikTok Shop product 1731541214379741272. |
137
- | `tiktok_shop_url` | Scrapes TikTok Shop page by URL. | Scrape this TikTok Shop URL: https://www.tiktok.com/shop/s?q=HEADPHONES |
138
- | `youtube_video` | Scrapes YouTube video information. | Scrape YouTube video 6Ejga4kJUts. |
139
- | `youtube_metadata` | Scrapes YouTube video metadata. | Get metadata for YouTube video dFu9aKJoqGg. |
140
- | `youtube_channel` | Scrapes YouTube channel videos with automatic parsing. | Scrape YouTube channel @decodo_official. |
141
- | `youtube_subtitles` | Scrapes YouTube video subtitles. | Get subtitles for YouTube video L8zSWbQN-v8. |
142
- | `youtube_search` | Search YouTube videos. | Search YouTube for "How to care for chinchillas". |
143
- | `reddit_post` | Scrapes a specific Reddit post for a given query, and returns parsed results. | Scrape the following Reddit post: https://www.reddit.com/r/horseracing/comments/1nsrn3/ |
144
- | `reddit_subreddit` | Scrapes a specific Reddit subreddit for a given query, and returns parsed results. | Scrape the top 5 posts on r/Python this week. |
145
- | `reddit_user` | Scrapes a Reddit user profile and their posts or comments. | Scrape Reddit user u/spez's profile. |
146
- | `bing_search` | Scrapes Bing Search results with automatic parsing. | Search Bing for laptop reviews. |
147
- | `chatgpt` | Search and interact with ChatGPT for AI-powered responses and conversations. | Ask ChatGPT to explain quantum computing in simple terms. |
148
- | `perplexity` | Search and interact with Perplexity for AI-powered responses and conversations. | Ask Perplexity what the latest trends in web development are. |
131
+ | Tool | Description | Example prompt |
132
+ | ---------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
133
+ | `scrape_as_markdown` | Scrapes any target URL, expects a URL to be given via prompt. Returns results in Markdown. | Scrape peacock.com from a US IP address and tell me the pricing. |
134
+ | `screenshot` | Captures a screenshot of any webpage and returns it as a PNG image. | Take a screenshot of github.com from a US IP address. |
135
+ | `google_search` | Scrapes Google Search for a given query, and returns parsed results. | Scrape Google Search for shoes and tell me the top position. |
136
+ | `google_ads` | Scrapes Google Ads search results with automatic parsing. | Scrape Google Ads for laptop and show me the top ads. |
137
+ | `google_lens` | Scrapes Google Lens image search results with automatic parsing. | Search Google Lens for this image: https://example.com/image.jpg |
138
+ | `google_ai_mode` | Scrapes Google AI Mode (Search with AI) results with automatic parsing. | Ask Google AI Mode: What are the top three dog breeds? |
139
+ | `google_travel_hotels` | Scrapes Google Travel Hotels search results. | Search Google Travel Hotels for hotels in Paris. |
140
+ | `amazon_search` | Scrapes Amazon Search for a given query, and returns parsed results. | Scrape Amazon Search for wireless keyboard. |
141
+ | `amazon_product` | Scrapes Amazon Product page with automatic parsing. | Scrape Amazon product B09H74FXNW and show me the details. |
142
+ | `amazon_pricing` | Scrapes Amazon Product pricing information with automatic parsing. | Get pricing for Amazon product B09H74FXNW. |
143
+ | `amazon_sellers` | Scrapes Amazon Seller information with automatic parsing. | Get information about Amazon seller A1R0Z7FJGTKESH. |
144
+ | `amazon_bestsellers` | Scrapes Amazon Bestsellers list with automatic parsing. | Show me Amazon bestsellers in electronics. |
145
+ | `walmart_search` | Scrapes Walmart Search for a given query, and returns parsed results. | Scrape Walmart Search for camping tent. |
146
+ | `walmart_product` | Scrapes Walmart Product page with automatic parsing. | Scrape Walmart product 15296401808. |
147
+ | `target_search` | Scrapes Target Search for a given query, and returns parsed results. | Scrape Target Search for kitchen appliances. |
148
+ | `target_product` | Scrapes Target Product page with automatic parsing. | Scrape Target product 92186007. |
149
+ | `tiktok_post` | Scrapes a TikTok post URL for structured data (e.g. engagement, caption, hashtags). | Scrape this TikTok post: https://www.tiktok.com/@nba/video/7393013274725403950 |
150
+ | `tiktok_shop_search` | Scrapes TikTok Shop Search for a given query, and returns parsed results. | Scrape TikTok Shop Search for phone cases. |
151
+ | `tiktok_shop_product` | Scrapes TikTok Shop Product page. | Scrape TikTok Shop product 1731541214379741272. |
152
+ | `tiktok_shop_url` | Scrapes TikTok Shop page by URL. | Scrape this TikTok Shop URL: https://www.tiktok.com/shop/s?q=HEADPHONES |
153
+ | `youtube_metadata` | Scrapes YouTube video metadata. | Get metadata for YouTube video dFu9aKJoqGg. |
154
+ | `youtube_channel` | Scrapes YouTube channel videos with automatic parsing. | Scrape YouTube channel @decodo_official. |
155
+ | `youtube_subtitles` | Scrapes YouTube video subtitles. | Get subtitles for YouTube video L8zSWbQN-v8. |
156
+ | `youtube_search` | Search YouTube videos. | Search YouTube for "How to care for chinchillas". |
157
+ | `reddit_post` | Scrapes a specific Reddit post. | Scrape the following Reddit post: https://www.reddit.com/r/horseracing/comments/1nsrn3/ |
158
+ | `reddit_subreddit` | Scrapes Reddit subreddit results with automatic parsing. | Scrape the top 5 posts on r/Python this week. |
159
+ | `reddit_user` | Scrapes a Reddit user profile and their posts/comments. | Scrape this Reddit user: https://www.reddit.com/user/IWasRightOnce/ |
160
+ | `bing_search` | Scrapes Bing Search results with automatic parsing. | Search Bing for laptop reviews. |
161
+ | `chatgpt` | Search and interact with ChatGPT for AI-powered responses and conversations. | Ask ChatGPT to explain quantum computing in simple terms. |
162
+ | `perplexity` | Search and interact with Perplexity for AI-powered responses and conversations. | Ask Perplexity what the latest trends in web development are. |
149
163
 
150
164
  ## Parameters
151
165
 
152
166
  The following parameters are inferred from user prompts:
153
167
 
154
- | Parameter | Description |
155
- | ------------ | ----------------------------------------------------------------------------------------------------- |
156
- | `jsRender` | Renders target URL in a headless browser. |
157
- | `geo` | Sets the country from which the request will originate. |
158
- | `locale` | Sets the locale of the request. |
159
- | `tokenLimit` | Truncates the response content up to this limit. Useful if the context window is small. |
160
- | `prompt` | Prompt to send to AI tools (`chatgpt`, `perplexity`). |
161
- | `search` | Activates ChatGPT's web search functionality (`chatgpt` only). |
162
- | `xhr` | When true, includes XHR or fetch responses in the scrape result where supported (e.g. `tiktok_post`). |
168
+ | Parameter | Description |
169
+ | --------------- | ----------------------------------------------------------------------------------------------------- |
170
+ | `jsRender` | Renders target URL in a headless browser. |
171
+ | `geo` | Sets the country from which the request will originate. |
172
+ | `locale` | Sets the locale of the request. |
173
+ | `tokenLimit` | Truncates the response content up to this limit. Useful if the context window is small. |
174
+ | `prompt` | Prompt to send to AI tools (`chatgpt`, `perplexity`). |
175
+ | `search` | Activates ChatGPT's web search functionality (`chatgpt` only). |
176
+ | `xhr` | When true, includes XHR or fetch responses in the scrape result where supported (e.g. `tiktok_post`). |
177
+ | `deviceType` | Device type to emulate for the request (`desktop`, `mobile`, `tablet`). |
178
+ | `domain` | Domain to use for the request (e.g., `amazon.com`, `amazon.co.uk`, `bing.com`). |
179
+ | `pageFrom` | Starting page number for pagination. |
180
+ | `deliveryZip` | ZIP code for delivery location (Target, Walmart). |
181
+ | `storeId` | Store ID for local inventory (Target, Walmart). |
182
+ | `country` | Country for TikTok Shop requests. |
183
+ | `limit` | Maximum number of results to return (e.g., YouTube channel videos). |
184
+ | `language_code` | Language code for subtitles (e.g., `en`, `es`). |
163
185
 
164
186
  ## Examples
165
187
 
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  require("dotenv/config");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AAEvB,wEAAiF;AACjF,kEAAmE;AACnE,mCAA0C;AAE1C,MAAM,eAAe,GAAG,GAA2B,EAAE;IACnD,MAAM,IAAI,GAAG,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;IAE9D,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,OAAO,MAAM,UAAU,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAW;QAC3D,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAW;KAC5D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;IACtB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAE7C,4DAA4D;IAC5D,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAC;IAEzD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,IAAI,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE/E,MAAM,aAAa,GAAG,IAAI,yCAAqB,CAAC;QAC9C,IAAI;QACJ,QAAQ,EAAE,IAAA,uBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KAChD,CAAC,CAAC;IACH,MAAM,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC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BAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KAChD,CAAC,CAAC;IACH,MAAM,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -9,7 +9,7 @@ class ScraperAPIBaseServer {
9
9
  this.auth = '';
10
10
  this.server = new mcp_js_1.McpServer({
11
11
  name: 'decodo',
12
- version: '1.1.0',
12
+ version: '1.1.1',
13
13
  });
14
14
  this.sapiClient = new scraper_api_client_1.ScraperApiClient();
15
15
  this.auth = auth;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@decodo/mcp-server",
3
- "version": "1.1.0",
4
- "description": "[![](https://dcbadge.limes.pink/api/server/https://discord.gg/Ja8dqKgvbZ)](https://discord.gg/Ja8dqKgvbZ) [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Decodo&config=eyJ1cmwiOiJodHRwczovL21jcC5kZWNvZG8uY29tL21jcCIsImhlYWRlcnMiOnsiQXV0aG9yaXphdGlvbiI6IkJhc2ljIDx3ZWJfYWR2YW5jZWRfdG9rZW4%2BIn19) [![smithery badge](https://smithery.ai/badge/@Decodo/decodo-mcp-server)](https://smithery.ai/server/@Decodo/decodo-mcp-server)",
3
+ "version": "1.1.1",
4
+ "description": "Decodo MCP Server",
5
5
  "bin": {
6
- "decodo-mcp": "build/index.js"
6
+ "decodo-mcp": "./build/index.js"
7
7
  },
8
8
  "main": "index.js",
9
9
  "mcpName": "io.github.Decodo/mcp-web-scraper",
@@ -13,11 +13,15 @@
13
13
  "start": "node build/server.js",
14
14
  "inspect": "mcp-inspector",
15
15
  "test": "jest",
16
- "lint": "eslint src/"
16
+ "lint": "eslint src/",
17
+ "release": "semantic-release"
17
18
  },
18
19
  "keywords": [],
19
20
  "author": "",
20
21
  "license": "ISC",
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
21
25
  "files": [
22
26
  "build"
23
27
  ],
@@ -31,13 +35,17 @@
31
35
  "devDependencies": {
32
36
  "@eslint/js": "^10.0.1",
33
37
  "@modelcontextprotocol/inspector": "^0.21.1",
38
+ "@semantic-release/changelog": "^6.0.3",
39
+ "@semantic-release/git": "^10.0.1",
40
+ "@semantic-release/github": "^12.0.6",
41
+ "@semantic-release/npm": "^13.1.5",
34
42
  "@types/express": "^5.0.1",
35
43
  "@types/jest": "^30.0.0",
36
44
  "@types/node": "^24.0.0",
37
45
  "eslint": "^10.2.1",
38
46
  "jest": "^30.0.0",
39
- "mcps-logger": "^1.0.0",
40
47
  "nodemon": "^3.1.14",
48
+ "semantic-release": "^25.0.3",
41
49
  "ts-jest": "^29.4.0",
42
50
  "typescript": "^5.8.3",
43
51
  "typescript-eslint": "^8.58.2",
@@ -45,6 +53,10 @@
45
53
  },
46
54
  "repository": {
47
55
  "type": "git",
48
- "url": "git@github.com-dcd:Decodo/mcp-server.git"
56
+ "url": "https://github.com/Decodo/mcp-server.git"
57
+ },
58
+ "homepage": "https://github.com/Decodo/mcp-server#readme",
59
+ "bugs": {
60
+ "url": "https://github.com/Decodo/mcp-server/issues"
49
61
  }
50
62
  }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScraperAPIMCPServer = void 0;
4
- const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
5
- const scraper_api_client_1 = require("./clients/scraper-api-client");
6
- const tools_1 = require("./tools");
7
- class ScraperAPIMCPServer {
8
- constructor({ sapiUsername, sapiPassword }) {
9
- this.server = new mcp_js_1.McpServer({
10
- name: 'decodo',
11
- version: '0.1.0',
12
- capabilities: {
13
- logging: {},
14
- resources: {},
15
- tools: {},
16
- },
17
- });
18
- const auth = Buffer.from(`${sapiUsername}:${sapiPassword}`).toString('base64');
19
- this.sapiClient = new scraper_api_client_1.ScraperApiClient({ auth });
20
- this.registerTools();
21
- this.registerResources();
22
- }
23
- connect(transport) {
24
- this.server.connect(transport);
25
- }
26
- registerTools() {
27
- // scrape
28
- tools_1.ScrapeAsMarkdownTool.register({ server: this.server, sapiClient: this.sapiClient });
29
- // targets
30
- tools_1.GoogleSearchParsedTool.register({ server: this.server, sapiClient: this.sapiClient });
31
- tools_1.AmazonSearchParsedTool.register({ server: this.server, sapiClient: this.sapiClient });
32
- tools_1.RedditPostTool.register({ server: this.server, sapiClient: this.sapiClient });
33
- tools_1.RedditSubredditTool.register({ server: this.server, sapiClient: this.sapiClient });
34
- }
35
- registerResources() {
36
- // todo: expose info about all targets available
37
- }
38
- }
39
- exports.ScraperAPIMCPServer = ScraperAPIMCPServer;
40
- //# sourceMappingURL=sapi-mcp-server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sapi-mcp-server.js","sourceRoot":"","sources":["../src/sapi-mcp-server.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AAEpE,qEAAgE;AAChE,mCAMiB;AAEjB,MAAa,mBAAmB;IAK9B,YAAY,EAAE,YAAY,EAAE,YAAY,EAAkD;QACxF,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAS,CAAC;YAC1B,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE;gBACZ,OAAO,EAAE,EAAE;gBACX,SAAS,EAAE,EAAE;gBACb,KAAK,EAAE,EAAE;aACV;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,IAAI,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE/E,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,SAA+B;QACrC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,aAAa;QACX,SAAS;QACT,4BAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAEpF,UAAU;QACV,8BAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACtF,8BAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACtF,sBAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC9E,2BAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,iBAAiB;QACf,gDAAgD;IAClD,CAAC;CACF;AA1CD,kDA0CC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AmazonSearchParsedTool = void 0;
7
- const zod_1 = __importDefault(require("zod"));
8
- const constants_1 = require("../../constants");
9
- const utils_1 = require("../../utils");
10
- const zod_types_1 = require("../../zod/zod-types");
11
- const tool_1 = require("../tool");
12
- class AmazonSearchParsedTool extends tool_1.Tool {
13
- constructor() {
14
- super(...arguments);
15
- this.toolset = constants_1.TOOLSET.ECOMMERCE;
16
- this.transformResponse = ({ data }) => {
17
- for (const fieldToRemove of AmazonSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
18
- data = (0, utils_1.removeKeyFromNestedObject)({ obj: data, keyToRemove: fieldToRemove });
19
- }
20
- return { data: JSON.stringify(data) };
21
- };
22
- this.register = ({ server, sapiClient, getAuthToken }) => {
23
- server.registerTool('amazon_search_parsed', {
24
- description: 'Scrape Amazon Search results with automatic parsing',
25
- inputSchema: {
26
- query: zod_1.default.string().describe('Search query'),
27
- geo: zod_types_1.zodGeo,
28
- jsRender: zod_types_1.zodJsRender,
29
- },
30
- annotations: {
31
- readOnlyHint: true,
32
- openWorldHint: true,
33
- },
34
- }, async (scrapingParams) => {
35
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.AMAZON_SEARCH, parse: true });
36
- const auth = getAuthToken();
37
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
38
- const { data: text } = this.transformResponse({ data });
39
- return {
40
- content: [
41
- {
42
- type: 'text',
43
- text,
44
- },
45
- ],
46
- };
47
- });
48
- };
49
- }
50
- }
51
- exports.AmazonSearchParsedTool = AmazonSearchParsedTool;
52
- AmazonSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT = ['suggested', 'amazons_choices', 'refinements'];
53
- //# sourceMappingURL=amazon-search-parsed-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"amazon-search-parsed-tool.js","sourceRoot":"","sources":["../../../src/tools/amazon-search-parsed/amazon-search-parsed-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,uCAAwD;AACxD,mDAA0D;AAC1D,kCAAqD;AAErD,MAAa,sBAAuB,SAAQ,WAAI;IAAhD;;QACE,YAAO,GAAG,m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4BACZ,IAAI;yBACL;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;;AApDD,wDAoDC;AAjDgB,kDAA2B,GAAG,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,AAAlD,CAAmD"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./amazon-search-parsed-tool"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/amazon-search-parsed/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.AmazonSearchParsedTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- const utils_1 = require("../utils");
11
- const zod_types_1 = require("../zod/zod-types");
12
- class AmazonSearchParsedTool {
13
- }
14
- exports.AmazonSearchParsedTool = AmazonSearchParsedTool;
15
- _a = AmazonSearchParsedTool;
16
- AmazonSearchParsedTool.toolset = constants_1.TOOLSET.ECOMMERCE;
17
- AmazonSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT = ['suggested', 'amazons_choices', 'refinements'];
18
- AmazonSearchParsedTool.transformAutoParsedResponse = ({ obj }) => {
19
- for (const fieldToRemove of _a.FIELDS_WITH_HIGH_CHAR_COUNT) {
20
- obj = (0, utils_1.removeKeyFromNestedObject)({ obj, keyToRemove: fieldToRemove });
21
- }
22
- const text = JSON.stringify(obj);
23
- return text;
24
- };
25
- AmazonSearchParsedTool.register = ({ server, sapiClient, getAuthToken, }) => {
26
- server.registerTool('amazon_search_parsed', {
27
- description: 'Scrape Amazon Search results with automatic parsing',
28
- inputSchema: {
29
- query: zod_1.default.string().describe('Search query'),
30
- geo: zod_types_1.zodGeo,
31
- jsRender: zod_types_1.zodJsRender,
32
- },
33
- annotations: {
34
- readOnlyHint: true,
35
- openWorldHint: true,
36
- },
37
- }, async (scrapingParams) => {
38
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.AMAZON_SEARCH, parse: true });
39
- const auth = getAuthToken();
40
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
41
- const text = _a.transformAutoParsedResponse({ obj: data });
42
- return {
43
- content: [
44
- {
45
- type: 'text',
46
- text,
47
- },
48
- ],
49
- };
50
- });
51
- };
52
- //# sourceMappingURL=amazon-search-parsed-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"amazon-search-parsed-tool.js","sourceRoot":"","sources":["../../src/tools/amazon-search-parsed-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,4CAA4D;AAC5D,oCAAqD;AACrD,gDAAuD;AAEvD,MAAa,sBAAsB;;AAAnC,wDA6DC;;AA5DQ,8BAAO,GAAG,mBAAO,CAAC,SAAS,AAApB,CAAqB;AAC5B,kDAA2B,GAAG,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,AAAlD,CAAmD;AAE9E,k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,CAAC,AA9Cc,CA8Cb"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ChatGPTTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- const zod_types_1 = require("../zod/zod-types");
11
- class ChatGPTTool {
12
- }
13
- exports.ChatGPTTool = ChatGPTTool;
14
- _a = ChatGPTTool;
15
- ChatGPTTool.toolset = constants_1.TOOLSET.AI;
16
- ChatGPTTool.register = ({ server, sapiClient, getAuthToken, }) => {
17
- server.registerTool('chatgpt', {
18
- description: 'Search and interact with ChatGPT for AI-powered responses and conversations',
19
- inputSchema: {
20
- prompt: zod_1.default.string().describe('Prompt to send to ChatGPT'),
21
- search: zod_1.default.boolean().describe("Activates ChatGPT's web search functionality").optional(),
22
- geo: zod_types_1.zodGeo,
23
- },
24
- annotations: {
25
- readOnlyHint: true,
26
- openWorldHint: true,
27
- },
28
- }, async (scrapingParams) => {
29
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.CHATGPT, parse: true });
30
- const auth = getAuthToken();
31
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
32
- const text = JSON.stringify(data, null, 2);
33
- return {
34
- content: [
35
- {
36
- type: 'text',
37
- text,
38
- },
39
- ],
40
- };
41
- });
42
- };
43
- //# sourceMappingURL=chatgpt-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatgpt-tool.js","sourceRoot":"","sources":["../../src/tools/chatgpt-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,4CAA4D;AAC5D,gDAA0C;AAE1C,MAAa,WAAW;;AAAxB,kCAiDC;;AAhDQ,mBAAO,GAAG,mBAAO,CAAC,EAAE,AAAb,CAAc;AACrB,oBAAQ,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,EACV,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,CACjB,SAAS,EACT;QACE,WAAW,EAAE,6EAA6E;QAC1F,WAAW,EAAE;YACX,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YACxD,MAAM,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC,CAAC,QAAQ,EAAE;YACvF,GAAG,EAAE,kBAAM;SACZ;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,OAAO,EACnC,KAAK,EAAE,IAAI,GACe,CAAC;QAE7B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE3C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AA9Cc,CA8Cb"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SCRAPER_API_TARGETS = exports.TOOLSET = void 0;
4
- var TOOLSET;
5
- (function (TOOLSET) {
6
- TOOLSET["WEB"] = "web";
7
- TOOLSET["SEARCH"] = "search";
8
- TOOLSET["ECOMMERCE"] = "ecommerce";
9
- TOOLSET["SOCIAL_MEDIA"] = "social_media";
10
- TOOLSET["AI"] = "ai";
11
- })(TOOLSET || (exports.TOOLSET = TOOLSET = {}));
12
- // todo: utils
13
- var SCRAPER_API_TARGETS;
14
- (function (SCRAPER_API_TARGETS) {
15
- SCRAPER_API_TARGETS["GOOGLE_SEARCH"] = "google_search";
16
- SCRAPER_API_TARGETS["AMAZON_SEARCH"] = "amazon_search";
17
- SCRAPER_API_TARGETS["REDDIT_POST"] = "reddit_post";
18
- SCRAPER_API_TARGETS["REDDIT_SUBREDDIT"] = "reddit_subreddit";
19
- SCRAPER_API_TARGETS["REDDIT_USER"] = "reddit_user";
20
- SCRAPER_API_TARGETS["CHATGPT"] = "chatgpt";
21
- SCRAPER_API_TARGETS["PERPLEXITY"] = "perplexity";
22
- })(SCRAPER_API_TARGETS || (exports.SCRAPER_API_TARGETS = SCRAPER_API_TARGETS = {}));
23
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/tools/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,4BAAiB,CAAA;IACjB,kCAAuB,CAAA;IACvB,wCAA6B,CAAA;IAC7B,oBAAS,CAAA;AACX,CAAC,EANW,OAAO,uBAAP,OAAO,QAMlB;AAED,cAAc;AACd,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAE/B,kDAA2B,CAAA;IAC3B,4DAAqC,CAAA;IACrC,kDAA2B,CAAA;IAE3B,0CAAmB,CAAA;IACnB,gDAAyB,CAAA;AAC3B,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GoogleSearchParsedTool = void 0;
7
- const zod_1 = __importDefault(require("zod"));
8
- const constants_1 = require("src/tools/constants");
9
- const utils_1 = require("../../utils");
10
- const zod_types_1 = require("../../zod/zod-types");
11
- const tool_1 = require("../tool");
12
- class GoogleSearchParsedTool extends tool_1.Tool {
13
- constructor() {
14
- super(...arguments);
15
- this.toolset = constants_1.TOOLSET.SEARCH;
16
- this.transformResponse = ({ data }) => {
17
- for (const fieldToRemove of GoogleSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
18
- data = (0, utils_1.removeKeyFromNestedObject)({ obj: data, keyToRemove: fieldToRemove });
19
- }
20
- return { data: JSON.stringify(data) };
21
- };
22
- this.register = ({ server, sapiClient, getAuthToken }) => {
23
- server.registerTool('google_search_parsed', {
24
- description: 'Scrape Google Search results with automatic parsing',
25
- inputSchema: {
26
- query: zod_1.default.string().describe('Search query'),
27
- geo: zod_types_1.zodGeo,
28
- locale: zod_types_1.zodLocale,
29
- jsRender: zod_types_1.zodJsRender,
30
- },
31
- annotations: {
32
- readOnlyHint: true,
33
- openWorldHint: true,
34
- },
35
- }, async (scrapingParams) => {
36
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.GOOGLE_SEARCH, parse: true });
37
- const auth = getAuthToken();
38
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
39
- const { data: text } = this.transformResponse({ data });
40
- return {
41
- content: [
42
- {
43
- type: 'text',
44
- text,
45
- },
46
- ],
47
- };
48
- });
49
- };
50
- }
51
- }
52
- exports.GoogleSearchParsedTool = GoogleSearchParsedTool;
53
- GoogleSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT = [
54
- 'images',
55
- 'image_data',
56
- 'related_searches_urls',
57
- 'factoids',
58
- 'people_also_buy_from',
59
- 'what_people_are_saying',
60
- ];
61
- //# sourceMappingURL=google-search-parsed-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-search-parsed-tool.js","sourceRoot":"","sources":["../../../src/tools/google-search-parsed/google-search-pars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AM,EAAE,CAAC,CAAC;gBAEnF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBAExD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI;yBACL;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;;AA5DD,wDA4DC;AAzDQ,kDAA2B,GAAG;IACnC,QAAQ;IACR,YAAY;IACZ,uBAAuB;IACvB,UAAU;IACV,sBAAsB;IACtB,wBAAwB;CACzB,AAPiC,CAOhC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./google-search-parsed-tool"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/google-search-parsed/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.GoogleSearchParsedTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- const utils_1 = require("../utils");
11
- const zod_types_1 = require("../zod/zod-types");
12
- class GoogleSearchParsedTool {
13
- }
14
- exports.GoogleSearchParsedTool = GoogleSearchParsedTool;
15
- _a = GoogleSearchParsedTool;
16
- GoogleSearchParsedTool.toolset = constants_1.TOOLSET.WEB;
17
- GoogleSearchParsedTool.FIELDS_WITH_HIGH_CHAR_COUNT = [
18
- 'images',
19
- 'image_data',
20
- 'related_searches_urls',
21
- 'factoids',
22
- 'people_also_buy_from',
23
- 'what_people_are_saying',
24
- ];
25
- GoogleSearchParsedTool.transformAutoParsedResponse = ({ obj }) => {
26
- for (const fieldToRemove of _a.FIELDS_WITH_HIGH_CHAR_COUNT) {
27
- obj = (0, utils_1.removeKeyFromNestedObject)({ obj, keyToRemove: fieldToRemove });
28
- }
29
- const text = JSON.stringify(obj);
30
- return text;
31
- };
32
- GoogleSearchParsedTool.register = ({ server, sapiClient, getAuthToken, }) => {
33
- server.registerTool('google_search_parsed', {
34
- description: 'Scrape Google Search results with automatic parsing',
35
- inputSchema: {
36
- query: zod_1.default.string().describe('Search query'),
37
- geo: zod_types_1.zodGeo,
38
- locale: zod_types_1.zodLocale,
39
- jsRender: zod_types_1.zodJsRender,
40
- },
41
- annotations: {
42
- readOnlyHint: true,
43
- openWorldHint: true,
44
- },
45
- }, async (scrapingParams) => {
46
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.GOOGLE_SEARCH, parse: true });
47
- const auth = getAuthToken();
48
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
49
- const text = _a.transformAutoParsedResponse({ obj: data });
50
- return {
51
- content: [
52
- {
53
- type: 'text',
54
- text,
55
- },
56
- ],
57
- };
58
- });
59
- };
60
- //# sourceMappingURL=google-search-parsed-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-search-parsed-tool.js","source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AAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnF,MAAM,IAAI,GAAG,EAAI,CAAC,2BAA2B,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAE7D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AA/Cc,CA+Cb"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PerplexityTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- const zod_types_1 = require("../zod/zod-types");
11
- class PerplexityTool {
12
- }
13
- exports.PerplexityTool = PerplexityTool;
14
- _a = PerplexityTool;
15
- PerplexityTool.toolset = constants_1.TOOLSET.AI;
16
- PerplexityTool.register = ({ server, sapiClient, getAuthToken, }) => {
17
- server.registerTool('perplexity', {
18
- description: 'Search and interact with Perplexity for AI-powered responses and conversations',
19
- inputSchema: {
20
- prompt: zod_1.default.string().describe('Prompt to send to Perplexity'),
21
- geo: zod_types_1.zodGeo,
22
- },
23
- annotations: {
24
- readOnlyHint: true,
25
- openWorldHint: true,
26
- },
27
- }, async (scrapingParams) => {
28
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.PERPLEXITY, parse: true });
29
- const auth = getAuthToken();
30
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
31
- const text = JSON.stringify(data, null, 2);
32
- return {
33
- content: [
34
- {
35
- type: 'text',
36
- text,
37
- },
38
- ],
39
- };
40
- });
41
- };
42
- //# sourceMappingURL=perplexity-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perplexity-tool.js","sourceRoot":"","sources":["../../src/tools/perplexity-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,4CAA4D;AAC5D,gDAA0C;AAE1C,MAAa,cAAc;;AAA3B,wCAiDC;;AAhDQ,sBAAO,GAAG,mBAAO,CAAC,EAAE,AAAb,CAAc;AACrB,uBAAQ,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,EACV,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EACT,gFAAgF;QAClF,WAAW,EAAE;YACX,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YAC3D,GAAG,EAAE,kBAAM;SACZ;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,UAAU,EACtC,KAAK,EAAE,IAAI,GACe,CAAC;QAE7B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE3C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AA9Cc,CA8Cb"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RedditPostTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- class RedditPostTool {
11
- }
12
- exports.RedditPostTool = RedditPostTool;
13
- _a = RedditPostTool;
14
- RedditPostTool.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
15
- RedditPostTool.register = ({ server, sapiClient, getAuthToken, }) => {
16
- server.registerTool('reddit_post', {
17
- description: 'Scrape a specific Reddit post',
18
- inputSchema: {
19
- url: zod_1.default.string().describe('reddit post URL'),
20
- },
21
- annotations: {
22
- readOnlyHint: true,
23
- openWorldHint: true,
24
- },
25
- }, async (scrapingParams) => {
26
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.REDDIT_POST });
27
- const auth = getAuthToken();
28
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
29
- const text = JSON.stringify(data, null, 2);
30
- return {
31
- content: [
32
- {
33
- type: 'text',
34
- text,
35
- },
36
- ],
37
- };
38
- });
39
- };
40
- //# sourceMappingURL=reddit-post-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reddit-post-tool.js","sourceRoot":"","sources":["../../src/tools/reddit-post-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,4CAA4D;AAE5D,MAAa,cAAc;;AAA3B,wCA8CC;;AA7CQ,sBAAO,GAAG,mBAAO,CAAC,YAAY,AAAvB,CAAwB;AAC/B,uBAAQ,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,EACV,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;QACE,WAAW,EAAE,+BAA+B;QAC5C,WAAW,EAAE;YACX,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SAC5C;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,WAAW,GACb,CAAC;QAE7B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE3C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AA3Cc,CA2Cb"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RedditSubredditTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const constants_1 = require("../constants");
10
- class RedditSubredditTool {
11
- }
12
- exports.RedditSubredditTool = RedditSubredditTool;
13
- _a = RedditSubredditTool;
14
- RedditSubredditTool.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
15
- RedditSubredditTool.register = ({ server, sapiClient, getAuthToken, }) => {
16
- server.registerTool('reddit_subreddit', {
17
- description: 'Scrape Reddit subreddit results with automatic parsing',
18
- inputSchema: {
19
- url: zod_1.default.string().describe('URL to subreddit'),
20
- },
21
- annotations: {
22
- readOnlyHint: true,
23
- openWorldHint: true,
24
- },
25
- }, async (scrapingParams) => {
26
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.REDDIT_SUBREDDIT });
27
- const auth = getAuthToken();
28
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
29
- const text = JSON.stringify(data, null, 2);
30
- return {
31
- content: [
32
- {
33
- type: 'text',
34
- text,
35
- },
36
- ],
37
- };
38
- });
39
- };
40
- //# sourceMappingURL=reddit-subreddit-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reddit-subreddit-tool.js","sourceRoot":"","sources":["../../src/tools/reddit-subreddit-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,4CAA4D;AAE5D,MAAa,mBAAmB;;AAAhC,kDA8CC;;AA7CQ,2BAAO,GAAG,mBAAO,CAAC,YAAY,AAAvB,CAAwB;AAC/B,4BAAQ,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,EACV,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EAAE,wDAAwD;QACrE,WAAW,EAAE;YACX,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SAC7C;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,gBAAgB,GAClB,CAAC;QAE7B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAE3C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AA3Cc,CA2Cb"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ScrapeAsMarkdownTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const node_html_markdown_1 = require("node-html-markdown");
10
- const zod_types_1 = require("../zod/zod-types");
11
- const constants_1 = require("../constants");
12
- class ScrapeAsMarkdownTool {
13
- }
14
- exports.ScrapeAsMarkdownTool = ScrapeAsMarkdownTool;
15
- _a = ScrapeAsMarkdownTool;
16
- ScrapeAsMarkdownTool.toolset = constants_1.TOOLSET.WEB;
17
- ScrapeAsMarkdownTool.LARGE_CONTENT_SYMBOL_COUNT = 100000;
18
- ScrapeAsMarkdownTool.isResponseOverLimit = (content) => {
19
- return content.length > _a.LARGE_CONTENT_SYMBOL_COUNT;
20
- };
21
- ScrapeAsMarkdownTool.truncateResponse = ({ content, limit }) => {
22
- return content.substring(0, limit);
23
- };
24
- ScrapeAsMarkdownTool.transformResponse = ({ html, tokenLimit }) => {
25
- let markdown;
26
- try {
27
- markdown = node_html_markdown_1.NodeHtmlMarkdown.translate(html, {});
28
- }
29
- catch (_b) {
30
- markdown = html;
31
- }
32
- if (tokenLimit || _a.isResponseOverLimit(markdown)) {
33
- const truncated = _a.truncateResponse({
34
- content: markdown,
35
- limit: tokenLimit || _a.LARGE_CONTENT_SYMBOL_COUNT,
36
- });
37
- return { markdown: truncated, isTruncated: true };
38
- }
39
- return { markdown, isTruncated: false };
40
- };
41
- ScrapeAsMarkdownTool.register = ({ server, sapiClient, getAuthToken, }) => {
42
- server.registerTool('scrape_as_markdown', {
43
- description: 'Scrape the contents of a website and return Markdown-formatted results',
44
- inputSchema: {
45
- url: zod_1.default.string().describe('URL to scrape'),
46
- geo: zod_types_1.zodGeo,
47
- locale: zod_types_1.zodLocale,
48
- jsRender: zod_types_1.zodJsRender,
49
- tokenLimit: zod_types_1.zodTokenLimit,
50
- },
51
- annotations: {
52
- readOnlyHint: true,
53
- openWorldHint: true,
54
- },
55
- }, async (scrapingParams) => {
56
- const auth = getAuthToken();
57
- const { data } = await sapiClient.scrape({ auth, scrapingParams });
58
- const { markdown, isTruncated } = _a.transformResponse({
59
- html: data,
60
- tokenLimit: scrapingParams.tokenLimit,
61
- });
62
- return {
63
- content: [
64
- {
65
- type: 'text',
66
- text: isTruncated
67
- ? `The website content is over ${_a.LARGE_CONTENT_SYMBOL_COUNT} symbols, therefore, the content has been truncated. If you wish to obtain the full response, just say "full response". Alternatively, you say a specific token limit in the prompt.`
68
- : 'Full website content retrieved.',
69
- },
70
- {
71
- type: 'text',
72
- text: markdown,
73
- },
74
- ],
75
- };
76
- });
77
- };
78
- //# sourceMappingURL=scrape-as-markdown-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scrape-as-markdown-tool.js","sourceRoot":"","sources":["../../src/tools/scrape-as-markdown-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,2DAAsD;AACtD,gDAAiF;AACjF,4CAAuC;AAEvC,MAAa,oBAAoB;;AAAjC,oDAoFC;;AAnFQ,4BAAO,GAAG,mBAAO,CAAC,GAAG,AAAd,CAAe;AACtB,+CAA0B,GAAG,MAAO,AAAV,CAAW;AAErC,wCAAmB,GAAG,CAAC,OAAe,EAAE,EAAE;IAC/C,OAAO,OAAO,CAAC,MAAM,GAAG,EAAI,CAAC,0BAA0B,CAAC;AAC1D,CAAC,AAFyB,CAExB;AAEK,qCAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,EAAsC,EAAE,EAAE;IACnF,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC,AAFsB,CAErB;AAEK,sCAAiB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EA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AQ,EAAE,WAAW,EAAE,GAAG,EAAI,CAAC,iBAAiB,CAAC;YACvD,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,cAAc,CAAC,UAAU;SACtC,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW;wBACf,CAAC,CAAC,+BAA+B,EAAI,CAAC,0BAA0B,sLAAsL;wBACtP,CAAC,CAAC,iCAAiC;iBACtC;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AAnDc,CAmDb"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ScreenshotTool = void 0;
8
- const zod_1 = __importDefault(require("zod"));
9
- const zod_types_1 = require("../zod/zod-types");
10
- const constants_1 = require("../constants");
11
- class ScreenshotTool {
12
- }
13
- exports.ScreenshotTool = ScreenshotTool;
14
- _a = ScreenshotTool;
15
- ScreenshotTool.toolset = constants_1.TOOLSET.WEB;
16
- ScreenshotTool.register = ({ server, sapiClient, getAuthToken, }) => {
17
- server.registerTool('screenshot', {
18
- description: 'Capture a screenshot of any webpage and return it as a PNG image',
19
- inputSchema: {
20
- url: zod_1.default.string().describe('URL to screenshot'),
21
- geo: zod_types_1.zodGeo,
22
- },
23
- annotations: {
24
- readOnlyHint: true,
25
- openWorldHint: true,
26
- },
27
- }, async (scrapingParams) => {
28
- const auth = getAuthToken();
29
- const { data } = await sapiClient.scrape({
30
- auth,
31
- scrapingParams: Object.assign(Object.assign({}, scrapingParams), { headless: 'png' }),
32
- });
33
- return {
34
- content: [
35
- {
36
- type: 'image',
37
- data: data,
38
- mimeType: 'image/png',
39
- },
40
- ],
41
- };
42
- });
43
- };
44
- //# sourceMappingURL=screenshot-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"screenshot-tool.js","sourceRoot":"","sources":["../../src/tools/screenshot-tool.ts"],"names":[],"mappings":";;;;;;;AAAA,8CAAoB;AAIpB,gDAA0C;AAC1C,4CAAuC;AAEvC,MAAa,cAAc;;AAA3B,wCA4CC;;AA3CQ,sBAAO,GAAG,mBAAO,CAAC,GAAG,AAAd,CAAe;AACtB,uBAAQ,GAAG,CAAC,EACjB,MAAM,EACN,UAAU,EACV,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EAAE,kEAAkE;QAC/E,WAAW,EAAE;YACX,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC7C,GAAG,EAAE,kBAAM;SACZ;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC;YACvC,IAAI;YACJ,cAAc,kCAAO,cAAc,KAAE,QAAQ,EAAE,KAAK,GAAE;SACvD,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,OAAgB;oBACtB,IAAI,EAAE,IAAc;oBACpB,QAAQ,EAAE,WAAW;iBACtB;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,AAzCc,CAyCb"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./youtube-video-tool"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/youtube-video/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.YoutubeVideoTool = void 0;
7
- const zod_1 = __importDefault(require("zod"));
8
- const constants_1 = require("../../constants");
9
- const zod_types_1 = require("../../zod/zod-types");
10
- const tool_1 = require("../tool");
11
- class YoutubeVideoTool extends tool_1.Tool {
12
- constructor() {
13
- super(...arguments);
14
- this.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
15
- this.transformResponse = ({ data }) => {
16
- return { data: JSON.stringify(data) };
17
- };
18
- this.register = ({ server, sapiClient, auth }) => {
19
- server.registerTool('youtube_video', {
20
- description: 'Scrape YouTube video information',
21
- inputSchema: {
22
- query: zod_1.default.string().describe('YouTube video ID (e.g., "6Ejga4kJUts")'),
23
- geo: zod_types_1.zodGeo,
24
- },
25
- annotations: {
26
- readOnlyHint: true,
27
- openWorldHint: true,
28
- },
29
- }, async (scrapingParams) => {
30
- const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.YOUTUBE_VIDEO });
31
- const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
32
- return {
33
- content: [
34
- {
35
- type: 'text',
36
- text: JSON.stringify(data),
37
- },
38
- ],
39
- };
40
- });
41
- };
42
- }
43
- }
44
- exports.YoutubeVideoTool = YoutubeVideoTool;
45
- //# sourceMappingURL=youtube-video-tool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"youtube-video-tool.js","sourceRoot":"","sources":["../../../src/tools/youtube-video/youtube-video-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,mDAA6C;AAC7C,kCAAqD;AAErD,MAAa,gBAAiB,SAAQ,WAAI;IAA1C;;QACE,YAAO,GAAG,mBAAO,CAAC,YAAY,CAAC;QAE/B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;gBACE,WAAW,EAAE,kCAAkC;gBAC/C,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;oBACpE,GAAG,EAAE,kBAAM;iBACZ;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,aAAa,GACf,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AAxCD,4CAwCC"}