desearch-mcp-server 0.7.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0
4
+
5
+ Company Search: a search budget (`max_cost_usd`) and continuing an ended search (`continue_from`), the two optional `POST /desearch/companies/search` fields of desearch-public-api #624. Both wait for that API release; until then the API answers 422 to them.
6
+
7
+ - `company-search` takes `max_cost_usd` (a number, more than 0, up to 100) and `continue_from` (a Company Search `task_id`) and sends them only when set. `company-enrich` takes neither.
8
+ - `max_cost_usd`: the whole budget is reserved (`reserved_cost_usd`), and the search goes on until it delivers `count` or spends it, instead of stopping at `cost_limit` once it costs more than the companies it found pay for. Its search effort is billed where the companies delivered do not cover it, up to the budget, even when it finds few companies or none. A budget below what `count` reserves is an HTTP 422 from the API. The argument, the tool description, and the server instructions tell the agent to set it only when the user agreed to that amount.
9
+ - `continue_from`: the new search leaves out every company the ended search delivered, held for review, or was told to exclude. The description says to send the same query and filters with the count still wanted, and that the API answers 409 while that task has not ended and 404 when it is not the caller's Company Search.
10
+ - The `query` argument and the `company-search` description name the form that checks only the companies a query names: "Restrict this search to Acme (acme.com.au) and Beta (beta.co.uk). Return only those." (no web search, `only_domains`, `completion_reason: "all_domains_processed"`). Companies named without their websites get warning `scope_not_applied`.
11
+ - Task summaries (`company-search`, `company-search-status`, the control tools, `company-search-tasks`) show `max_cost_usd` and `continue_from` from the stored request and `only_domains` from the query's interpretation, when set. `progress.effort_units` (budgeted searches) passes through with `progress`.
12
+ - The `next` hint of a search that a limit stopped before `count` (`coverage_limited`) now says how to continue it: offer the user a new `company-search` with the same query and filters, `continue_from` set to its `task_id`, and the count still wanted (at least 5). Without a budget it adds that the user may set `max_cost_usd`, which bills search effort, and only with the user's agreement; a `cost_limit` stop says whether the search ran out of its budget or stopped because it cost more than its companies pay for. Company Enrich tasks get no continue hint. The hint says "a limit stopped it", no longer "a budget stopped it". A cancelled search with a budget says it pays for its search effort so far when that is more than the companies delivered.
13
+ - `company-search-cancel` says the same. The `company-search` cost text now gives a minimum of 1 company when a search delivers any (the API's minimum since 2026-11-02), no longer 2.
14
+ - Every version (package, `server.json`, the Gemini extension, the plugin manifests, and `SERVER_VERSION`) is 0.9.0. The tool count is unchanged (39).
15
+
16
+ ## 0.8.0
17
+
18
+ YouTube, Reddit, and Threads: three new tools (39 in total) for the 16 public routes tagged YouTube Search, Reddit Search, and Threads Search. They are not in `desearch-js` 1.5, so they use the same `social.ts` action table and direct API calls (`desearch-api.ts`) as `tiktok`, `facebook`, and `instagram`. Each request is billed as one unit (an empty page included; a 404, a 422, and a 5xx are free).
19
+
20
+ - `youtube`: 6 routes. `search` (`POST /desearch/youtube/search`: `query`, `type`, `upload_date`, `sort_by`, `duration`, `cursor`), `video`, `transcript` (`language`), `comments` (`order`, `cursor`), `channel`, and `channel_videos` (`sort`, `cursor`). Video ids may be full YouTube URLs.
21
+ - `reddit`: 5 routes. `search` (`POST /desearch/reddit/search`: `query`, `sort`, `timeframe`, `cursor`), `subreddit`, `subreddit_posts` (`sort`, `timeframe`, `cursor`), `post`, and `comments` (`cursor`; a tree with the replies Reddit loaded). The two `sort` lists differ by action, and a value from the other list is refused before the request. A leading `r/` on a subreddit name is removed.
22
+ - `threads`: 5 routes. `search` (`query`, `start_date`, `end_date`), `search_users`, `profile`, `profile_posts`, and `post` (with its replies and thread continuation). Threads returns one page, so the tool has no `cursor`.
23
+ - Paging: `youtube` `search`, `comments`, `channel_videos` and `reddit` `search`, `subreddit_posts`, `comments` return `{ results, next_cursor, next }` with `next_cursor` from the `x-desearch-next-cursor` header, exactly as the TikTok actions do.
24
+ - All three are lookups: `readOnlyHint: true`, `destructiveHint: false`, `openWorldHint: true`. The server instructions, README, parity doc, `llms-install.md`, `GEMINI.md`, the plugin skill, and the manifest descriptions name them.
25
+ - `scripts/e2e-youtube-reddit-threads.mjs` calls every new action once over stdio against a live API (`--base-url`, `--key-env`), plus a second page on each action that pages.
26
+ - `DESEARCH_API_BASE`, which already set the OAuth key-check host, now also sets the host for the routes the server calls directly (People Search, Company Search, `search-api`, `people-search-export`, and the social tools), so a staging API can be tested end to end. Tools built on `desearch-js` still call `https://api.desearch.ai`.
27
+
3
28
  ## 0.7.0
4
29
 
5
30
  Full Desearch API coverage: five new tools (36 in total: the 31 tools of 0.6.0 plus these five) for the routes `desearch-js` 1.5 does not cover. They call the API directly through `desearch-api.ts`, the request helper `people.ts` and `companies.ts` used, now in its own module, with the same `Authorization: <key>` header and `HTTP <status>: <detail>` errors. The network stats routes stay out of MCP.
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/desearch-mcp-server.svg)](https://www.npmjs.com/package/desearch-mcp-server)
4
4
  [![GitHub stars](https://img.shields.io/github/stars/Desearch-ai/mcp-desearch?style=social)](https://github.com/Desearch-ai/mcp-desearch/stargazers)
5
+ [![As seen on Open Source Alternatives](https://www.opensourcealternatives.to/badge-osa.svg)](https://www.opensourcealternatives.to)
5
6
 
6
7
  If Desearch is useful, a [star](https://github.com/Desearch-ai/mcp-desearch/stargazers) helps others find it.
7
8
 
@@ -51,13 +52,13 @@ Example output:
51
52
 
52
53
  The tool returns that JSON as pretty-printed text: `{ "content": [{ "type": "text", "text": "<json above>" }] }`.
53
54
 
54
- AI search, X search and web search for AI agents, plus the Search API (ranked pages with the best-matching passage), page extraction, X data tools, public TikTok, Facebook, and Instagram data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), and Company Search (find companies on the web, or enrich domains you have, with their public contacts and leaders). Bring your own Desearch API key. Version 0.7.0 exposes 36 tools.
55
+ AI search, X search and web search for AI agents, plus the Search API (ranked pages with the best-matching passage), page extraction, X data tools, public TikTok, Facebook, Instagram, YouTube (videos, transcripts, comments, channels), Reddit, and Threads data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), and Company Search (find companies on the web, or enrich domains you have, with their public contacts and leaders). Bring your own Desearch API key. Version 0.9.0 exposes 39 tools.
55
56
 
56
57
  ## Tools
57
58
 
58
59
  The Desearch MCP server includes the following tools.
59
60
 
60
- Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `search-api`, `tiktok`, `facebook`, `instagram`, `people-search-status`, `people-search-tasks`, `people-profiles`, and `people-search-export` are lookups too. `people-search` starts a paid job billed to the user's Desearch balance, so `readOnlyHint` is false; it creates a new task and does not delete or overwrite anything, so `destructiveHint` is false. `people-search-pause` and `people-search-resume` change a task's state and undo each other, so `readOnlyHint` and `destructiveHint` are false and `idempotentHint` is true. Pausing loses no data (people found so far stay readable and the search keeps its progress) and changes no billing (nothing is charged or refunded; the reservation stays until the search ends), and resume continues from where the search stopped with no new charge. The caveat: the API cancels a search paused for more than 7 days, and a cancelled search cannot be resumed, so a pause is reversible only within those 7 days. `people-search-cancel` cannot be undone, so `readOnlyHint` is false and `destructiveHint` and `idempotentHint` are true. The Company Search tools follow the same rules: `company-search` and `company-enrich` start paid jobs (`readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`), `company-search-status` and `company-search-tasks` are lookups, `company-search-pause` and `company-search-resume` set `destructiveHint: false` and `idempotentHint: true` (with the same 7-day caveat), and `company-search-cancel` sets `destructiveHint: true` and `idempotentHint: true`. `openWorldHint` is true on every tool because the call reaches a live external source.
61
+ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `search-api`, `tiktok`, `facebook`, `instagram`, `youtube`, `reddit`, `threads`, `people-search-status`, `people-search-tasks`, `people-profiles`, and `people-search-export` are lookups too. `people-search` starts a paid job billed to the user's Desearch balance, so `readOnlyHint` is false; it creates a new task and does not delete or overwrite anything, so `destructiveHint` is false. `people-search-pause` and `people-search-resume` change a task's state and undo each other, so `readOnlyHint` and `destructiveHint` are false and `idempotentHint` is true. Pausing loses no data (people found so far stay readable and the search keeps its progress) and changes no billing (nothing is charged or refunded; the reservation stays until the search ends), and resume continues from where the search stopped with no new charge. The caveat: the API cancels a search paused for more than 7 days, and a cancelled search cannot be resumed, so a pause is reversible only within those 7 days. `people-search-cancel` cannot be undone, so `readOnlyHint` is false and `destructiveHint` and `idempotentHint` are true. The Company Search tools follow the same rules: `company-search` and `company-enrich` start paid jobs (`readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`), `company-search-status` and `company-search-tasks` are lookups, `company-search-pause` and `company-search-resume` set `destructiveHint: false` and `idempotentHint: true` (with the same 7-day caveat), and `company-search-cancel` sets `destructiveHint: true` and `idempotentHint: true`. `openWorldHint` is true on every tool because the call reaches a live external source.
61
62
 
62
63
  - **AI Search** (`ai-search`): Performs AI Twitter and web searches with relevant links and summary. `tools` uses short source ids (`web`, `twitter`, `arxiv`, `wikipedia`, `hackernews`, `reddit`). Older labels such as `Web Search`, `ArXiv Search`, `Wikipedia Search`, `Hacker News Search`, and `Reddit Search` are still accepted and sent as the short id. `youtube` is not accepted. Default is `["web", "twitter"]`.
63
64
  - **X Search** (`x-search`): Tweet search on X. Arguments: `query` (required), `count` (optional, default 20). Sort stays Top. Optional filters: `user`, `start_date`, `end_date` (YYYY-MM-DD), `lang`, `verified`, `blue_verified`, `is_quote`, `is_video`, `is_image`, `min_retweets`, `min_replies`, `min_likes`.
@@ -80,6 +81,9 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
80
81
  - **TikTok** (`tiktok`): Public TikTok data. `action` (required) picks the route: `search` (`query`; optional `count`, `sort`, `cursor`), `post` (`id`), `profile` (`username`), `profile_posts` (`username`; optional `count`, `cursor`), `comments` (`video_id`; optional `count`, `cursor`), `hashtag` (`tag`; optional `count`, `cursor`), `trending` (optional `region`, `count`). See [TikTok, Facebook, and Instagram](#tiktok-facebook-and-instagram).
81
82
  - **Facebook** (`facebook`): Public Facebook data. `action` (required): `search` (`query`; optional `count`, `cursor`) and `hashtag` (`tag`; optional `count`, `cursor`) return Meta Ad Library ads, not organic posts; `post` (`id`), `profile` (`profile_id`, a page or profile ID or public handle), `profile_posts` (`profile_id`; optional `count`, `cursor`), `comments` (`post_id`; optional `count`, `cursor`).
82
83
  - **Instagram** (`instagram`): Public Instagram data. `action` (required): `search` (`query`; optional `count`; profiles, one page, no cursor), `media` (`id`: shortcode, numeric ID, or URL), `profile` (`username`), `profile_posts` (`username`; optional `count`, `cursor`), `comments` (`shortcode`, the code in the post URL; optional `count`, `cursor`), `hashtag` (`tag`; optional `count`, `cursor`).
84
+ - **YouTube** (`youtube`): Public YouTube data. `action` (required): `search` (`query`; optional `type`, `upload_date`, `sort_by`, `duration`, `cursor`; videos, Shorts, live streams, channels, and playlists, each with a `type`), `video` (`id`: video or Short ID or URL), `transcript` (`video_id`; optional `language`), `comments` (`video_id`; optional `order`, `cursor`), `channel` (`handle`, with or without `@`, or a `UC...` channel ID), `channel_videos` (`handle`; optional `sort`, `cursor`). See [YouTube, Reddit, and Threads](#youtube-reddit-and-threads).
85
+ - **Reddit** (`reddit`): Public Reddit data. `action` (required): `search` (`query`; optional `sort`, `timeframe`, `cursor`), `subreddit` (`name`, case-sensitive), `subreddit_posts` (`name`; optional `sort`, `timeframe`, `cursor`), `post` (`id`: post ID or URL), `comments` (`post_id`; optional `cursor`).
86
+ - **Threads** (`threads`): Public Threads data. `action` (required): `search` (`query`; optional `start_date`, `end_date`), `search_users` (`query`), `profile` (`username`), `profile_posts` (`username`), `post` (`id`: post URL or shortcode). One page each; no cursor.
83
87
  - **People Search** (`people-search`): Start a paid job billed to the user's Desearch balance: a search for people who match a plain-language description. Arguments: `platform` (required: `x`, `youtube`, `linkedin`, or `tiktok`), `query` (required, 3–1000 characters), `count` (optional, 5–200, API default 25), `min_score` (optional, 0–100), `exclude` (optional handles), `metadata` (optional labels, below), `idempotency_key` (optional), and that platform's filters (below). Returns the `task_id`, status, and `reserved_cost_usd` (`count` times the platform's per-person price at the time of the call; prices at https://desearch.ai/pricing); the ended task carries `final_cost_usd`. Public data only: public X posts and profile fields, public YouTube channel pages plus the creator's own website for publicly listed contact details, public LinkedIn posts and profiles, and public TikTok videos and profiles. Contacts are only those the person lists publicly.
84
88
  - **People Search Status** (`people-search-status`): A task's status, progress, and cost, plus a page of the people found so far. Arguments: `task_id` (required), `cursor` (optional, `next_cursor` from the previous call), `limit` (optional, 1–100, default 25), `include_people` (optional, default `true`). Free; it reads a search you already started (people come from public profiles and posts).
85
89
  - **Pause People Search** (`people-search-pause`): Pause a task. A queued search pauses at once; a running one finishes its current batch first. No data is lost and billing does not change; `people-search-resume` continues where it stopped with no new charge. A search paused for more than 7 days is cancelled by the API and can no longer be resumed. Argument: `task_id` (required). Free.
@@ -88,15 +92,15 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
88
92
  - **List People Search Tasks** (`people-search-tasks`): Your searches, newest first. Arguments: `platform` (optional), `status` (optional list, for example `["running", "paused"]`), `limit` (optional, 1–100), `cursor` (optional), `metadata` (optional, up to 3 labels a task must have, for example `{"campaign": "q4-outbound"}`). Free; lists tasks, not the people they found.
89
93
  - **List People Found** (`people-profiles`): Everyone your own searches found on one platform, one entry per person, with the search that found them. Runs no new search and queries no outside source. Arguments: `platform` (required), `q` (optional text in name, handle, bio, or location), `sort` (optional: `score`, `recent`, or `audience`), `limit` (optional, 1–200, default 25), `cursor` (optional), and the filters `has` (channels every person must have: `email`, `website`, `x`, `linkedin`, `instagram`, `youtube`, `tiktok`), `min_audience`, `max_audience`, `min_score`, `location`, `verified`. Free.
90
94
  - **Export People Found** (`people-search-export`): The people your searches found as CSV or JSON Lines text. Pass `task_id` to export one search, or `platform` (without `task_id`) to export everyone found on that platform, with the same `q`, `sort`, and filters as `people-profiles`. Arguments: `task_id` or `platform`, `format` (optional, `csv` or `jsonl`, default `csv`), `has`, `min_audience`, `max_audience`, `min_score`, `location`, `verified`, `q` and `sort` (platform export only), `max_rows` (optional, 1–1000, default 100). The reply is a note, then the file text cut at a row boundary to `max_rows` rows and 50,000 characters; the note says how many rows were cut. Free.
91
- - **Company Search** (`company-search`): Start a paid job billed to the user's Desearch balance: find companies on the web that match a plain-language description and collect each one's public contact data. Arguments: `query` (required, 3–1000 characters), `count` (optional, 5–200, API default 25), `min_score` (optional, 0–100), `exclude` (optional domains or URLs, up to 1000), `countries` (optional ISO 3166-1 alpha-2 codes or names, up to 20), `require` (optional: `email`, `phone`, `linkedin`, `leader`, `leader_email`), `roles` (optional, below), `infer_emails` (optional, default `true`), `verify_emails` (optional, default `true`), `metadata` (optional labels, as on `people-search`), `idempotency_key` (optional). `countries` and `require` are sent as the API's `filters`. Returns the `task_id`, status, and `reserved_cost_usd` (`count` times the Company Search per-company price at the time of the call; prices at https://desearch.ai/pricing); the ended task carries `final_cost_usd`. Public data only: each company's own website, public web search results, and public LinkedIn profiles of its leaders.
95
+ - **Company Search** (`company-search`): Start a paid job billed to the user's Desearch balance: find companies on the web that match a plain-language description and collect each one's public contact data. Arguments: `query` (required, 3–1000 characters), `count` (optional, 5–200, API default 25), `min_score` (optional, 0–100), `exclude` (optional domains or URLs, up to 1000), `countries` (optional ISO 3166-1 alpha-2 codes or names, up to 20), `require` (optional: `email`, `phone`, `linkedin`, `leader`, `leader_email`), `roles` (optional, below), `infer_emails` (optional, default `true`), `verify_emails` (optional, default `true`), `metadata` (optional labels, as on `people-search`), `idempotency_key` (optional), `max_cost_usd` (optional search budget in USD, more than 0 and up to 100; set it only with the user's agreement), `continue_from` (optional `task_id` of an ended Company Search, to find only new companies). `countries` and `require` are sent as the API's `filters`. Returns the `task_id`, status, and `reserved_cost_usd` (`count` times the Company Search per-company price at the time of the call, or the whole `max_cost_usd`; prices at https://desearch.ai/pricing); the ended task carries `final_cost_usd`. A query that names companies with their websites ("Restrict this search to Acme (acme.com.au) and Beta (beta.co.uk). Return only those.") checks only those domains. Public data only: each company's own website, public web search results, and public LinkedIn profiles of its leaders.
92
96
  - **Company Enrich** (`company-enrich`): Start a paid job billed to the user's Desearch balance: the same public contact data for companies you already know. Arguments: `domains` (required, 1–200 domains or URLs; reduced to the host without `www.`, lowercased, deduplicated), `roles`, `infer_emails`, `verify_emails`, `metadata`, `idempotency_key` (all optional). One company per domain, with `score: null`. Reserves one company per domain sent at the Company Enrich per-company price; duplicates and companies it does not deliver are returned when the task ends.
93
97
  - **Company Search Status** (`company-search-status`): A Company Search or Company Enrich task's status, progress, and cost, plus a page of the companies delivered so far. Arguments: `task_id` (required), `cursor` (optional, `next_cursor` from the previous call), `limit` (optional, 1–100, default 10), `include_companies` (optional, default `true`). Free.
94
98
  - **Pause Company Search** (`company-search-pause`): Pause a task. No data is lost and billing does not change; `company-search-resume` continues where it stopped with no new charge. A task paused for more than 7 days is cancelled by the API. Argument: `task_id` (required). Free.
95
99
  - **Resume Company Search** (`company-search-resume`): Resume a paused task from where it stopped, with no new charge (409 when it is not paused). Argument: `task_id` (required). Free.
96
- - **Cancel Company Search** (`company-search-cancel`): Stop a task for good. You pay only for the companies it already delivered; the rest of the reservation is returned. Cannot be undone. Argument: `task_id` (required). Free.
100
+ - **Cancel Company Search** (`company-search-cancel`): Stop a task for good. You pay only for the companies it already delivered (a search with `max_cost_usd`: its search effort so far when that is more, up to the budget); the rest of the reservation is returned. Cannot be undone. Argument: `task_id` (required). Free.
97
101
  - **List Company Search Tasks** (`company-search-tasks`): Your Company Search and Company Enrich tasks, newest first. Arguments: `type` (optional, `search` or `enrich`), `status` (optional list), `limit` (optional, 1–100), `cursor` (optional), `metadata` (optional, up to 3 labels, exact match). Free; People Search tasks are not listed here.
98
102
 
99
- The full SDK method → endpoint → MCP tool map is in [docs/API_MCP_PARITY.md](docs/API_MCP_PARITY.md). Every public `desearch-js` 1.5 method is a tool. `latestTweets` was removed from the SDK (`GET /twitter/latest` in 1.0.1) and is not exposed. People Search, Company Search, the TikTok, Facebook, and Instagram routes, and `POST /search` are not in `desearch-js` 1.5; those tools call the routes directly (`/desearch/people/*`, `/desearch/companies/*`, and the rest), and the parity doc lists them too. The network stats routes (`/network/stats`) are not MCP tools.
103
+ The full SDK method → endpoint → MCP tool map is in [docs/API_MCP_PARITY.md](docs/API_MCP_PARITY.md). Every public `desearch-js` 1.5 method is a tool. `latestTweets` was removed from the SDK (`GET /twitter/latest` in 1.0.1) and is not exposed. People Search, Company Search, the TikTok, Facebook, Instagram, YouTube, Reddit, and Threads routes, and `POST /search` are not in `desearch-js` 1.5; those tools call the routes directly (`/desearch/people/*`, `/desearch/companies/*`, and the rest), and the parity doc lists them too. The network stats routes (`/network/stats`) are not MCP tools.
100
104
 
101
105
  ### TikTok, Facebook, and Instagram
102
106
 
@@ -130,6 +134,30 @@ Prompt: show me the latest TikTok videos tagged #ai, then the next page.
130
134
 
131
135
  The cursor is opaque: send it back unchanged, on the same action with the same target (`query`, `username`, `profile_id`, `video_id`, `post_id`, `shortcode`, or `tag`), within 24 hours. Any other value returns HTTP 422 and is not charged. TikTok `trending` and Instagram `search` return one page and take no cursor. Facebook `search` and `hashtag` read the Meta Ad Library (ads), not organic posts. Instagram `comments` takes the post shortcode (`DeuOR-CjKE9` in `https://www.instagram.com/p/DeuOR-CjKE9/`); a numeric media ID returns 404. A leading `@` on a username and `#` on a tag are removed.
132
136
 
137
+ ### YouTube, Reddit, and Threads
138
+
139
+ `youtube`, `reddit`, and `threads` work the same way: `action` picks one public route, and the action's arguments are checked before any request. Each call is billed per request, including an empty page; a 404, a 422, and a 5xx are not charged (prices at https://desearch.ai/pricing).
140
+
141
+ | Tool | Actions that page (take `cursor`) | Single items | One page, no cursor |
142
+ | --- | --- | --- | --- |
143
+ | `youtube` | `search`, `comments`, `channel_videos` | `video`, `transcript`, `channel` | — |
144
+ | `reddit` | `search`, `subreddit_posts`, `comments` | `subreddit`, `post` | — |
145
+ | `threads` | — | `profile`, `post` | `search`, `search_users`, `profile_posts` (the latest posts only) |
146
+
147
+ Paging is the same as on TikTok: a list action returns `{ "results": [...], "next_cursor": ..., "next": ... }`, where `next_cursor` is the `x-desearch-next-cursor` response header. Send it back unchanged as `cursor`, on the same action with the same target, within 24 hours.
148
+
149
+ Prompt: find recent YouTube videos about bittensor, then read the transcript of the first one.
150
+
151
+ ```json
152
+ { "name": "youtube", "arguments": { "action": "search", "query": "bittensor", "type": "videos", "upload_date": "this_month" } }
153
+ ```
154
+
155
+ ```json
156
+ { "name": "youtube", "arguments": { "action": "transcript", "video_id": "dQw4w9WgXcQ", "language": "en" } }
157
+ ```
158
+
159
+ The transcript comes back as `{ "videoId", "language", "text", "segments": [{ "text", "startMs", "endMs", "startText" }] }`; a video without captions returns 404 (not charged). `video`, `transcript`, and `comments` take a video ID or a full YouTube URL; `reddit` `post` and `comments` take a post ID (with or without `t3_`) or URL; `threads` `post` takes a post URL or shortcode. Reddit subreddit names are case-sensitive (`AskReddit`); a leading `r/` is removed. Reddit `sort` values depend on the action: `relevance`, `new`, `top`, or `comment_count` for `search`, and `best`, `hot`, `new`, `top`, or `rising` for `subreddit_posts` (`timeframe` applies to `top` there). `reddit` `comments` returns a tree: top-level comments with the `replies` Reddit loaded and `hasMoreReplies` when there are more.
160
+
133
161
  ### People Search
134
162
 
135
163
  People Search finds X profiles, YouTube creators, LinkedIn members, or TikTok creators who match a plain-language description. Each person comes back with a fit score, one line on why they matched, their audience (followers, or subscribers on YouTube), location, and the public contacts and links the search found.
@@ -267,12 +295,18 @@ Company Search finds companies on the web that match a plain-language descriptio
267
295
 
268
296
  A task runs in the background, like a People Search:
269
297
 
270
- 1. `company-search` or `company-enrich` starts a paid job billed to the user's Desearch balance and returns a `task_id` at once. Company Search reserves `count` companies at its per-company price, Company Enrich one company per domain sent at its own price (prices at https://desearch.ai/pricing). When the task ends you pay only for the companies it delivered (Company Search: a minimum of 2 when it delivers any; Company Enrich: a minimum of 1; a task that delivers none is free), and the rest of the reservation is returned. A company left out by `min_score` or `require` is not billed. Send the same `idempotency_key` to retry a call without starting, or paying for, a second task.
298
+ 1. `company-search` or `company-enrich` starts a paid job billed to the user's Desearch balance and returns a `task_id` at once. Company Search reserves `count` companies at its per-company price, Company Enrich one company per domain sent at its own price (prices at https://desearch.ai/pricing). When the task ends you pay only for the companies it delivered (a minimum of 1 when it delivers any; a task that delivers none is free), and the rest of the reservation is returned. A company left out by `min_score` or `require` is not billed. Send the same `idempotency_key` to retry a call without starting, or paying for, a second task.
271
299
  2. `company-search-status` returns the task's status, progress, cost, and a page of companies. Each company goes through stages: `profile` (its homepage, and the fit score), `contacts` (its contact, about, team, and imprint pages), `people` (its leaders), `email_patterns` (inferred leader emails), and `email_check` (every email checked: `valid`, `invalid`, `risky`, or `unknown`). A company is delivered as soon as the stages the request needs have run, with `enrichment.status: "partial"`, and later stages fill it in until it is `complete`. Pass `next_cursor` back as `cursor` to get only new companies; call without `cursor` to read every company in its latest version. `stage: "enriching"` means every company is delivered and only later stages are left. The `next` hint says which to do, and reminds you to read once more without `cursor` after the task ends if you read companies while it ran.
272
300
  3. `company-search-pause`, `company-search-resume`, and `company-search-cancel` pause, resume, or cancel it. `company-search-tasks` lists your tasks, filtered by `type` (`search` or `enrich`), `status`, or `metadata`.
273
301
 
274
302
  A People Search `task_id` is a 404 on the company tools, and a company `task_id` is a 404 on the People Search tools. Companies stay readable for 30 days after a task ends.
275
303
 
304
+ Without a budget, a Company Search stops once it costs more than the companies it found pay for (`completion_reason: "cost_limit"`, `coverage_limited: true`). `max_cost_usd` is the user's search budget in USD (more than 0, up to 100, and at least what `count` reserves; less is an HTTP 422 that gives the minimum). The whole budget is reserved, the search goes on until it delivers `count` or spends the budget, and its search effort is billed where the companies delivered do not cover it, up to the budget, even when it finds few companies or none. The unused part is returned. Agents must set it only when the user agreed to that amount. The task then shows `max_cost_usd`, and `progress.effort_units` once it ended.
305
+
306
+ `continue_from` takes the `task_id` of an ended Company Search: the new search leaves out every company that one delivered, held for review, or was told to exclude, so it finds only new ones. Send the same query and filters with the count still wanted. The API answers 409 while that task has not ended and 404 when it is not your Company Search. When a limit stopped a search before `count`, the `next` hint says how to continue it.
307
+
308
+ A query that names the only companies wanted, with their websites ("Restrict this search to Acme (acme.com.au) and Beta (beta.co.uk). Return only those."), checks only those domains against the rest of the description, with no web search: the task lists them as `only_domains` and ends with `completion_reason: "all_domains_processed"`. Companies named without their websites do not restrict the search, and the task has warning `scope_not_applied`.
309
+
276
310
  `require` keeps only companies that have all of the listed contacts: `email`, `phone`, `linkedin` (the company's LinkedIn page), `leader` (one of `roles`), `leader_email` (a leader with an email). A company that does not have them once the stage that can show them has run is not delivered and not billed. `roles` takes any of `ceo`, `founder`, `cto`, `cfo`, `coo`, `cmo`, `president`, `owner`, `managing_director`; a managing director (Geschäftsführer) counts as `ceo` when `ceo` is asked for. `infer_emails: false` skips the inferred leader emails and `verify_emails: false` skips the email checks.
277
311
 
278
312
  Prompt: find 25 Series A fintech startups in Berlin with a leader's email.
@@ -396,7 +430,7 @@ The output above is shortened to one company.
396
430
  - Each email has `type` (`personal`, `leadership`, `sales`, `general`, `press`, `support`, `careers`, `legal`, `other`), `source` (`website`, `search`, `linkedin`, `inferred`), `source_url` (none for inferred ones), and `verification` (`valid`, `invalid`, `risky`, `unknown`; left out until the email checks ran). Inferred emails carry `confidence` (`high`: the pattern was learned from this company's own addresses; `low`: a common pattern) and `pattern`.
397
431
  - `primary_email` is never a `support`, `legal`, `careers`, `press`, or `other` address, and an inferred one only when `valid`. `primary_contact` is the leader to reach first, with why.
398
432
  - Each leader has `roles` (from the request's `roles`), `verified` (a quote on the company's own site or their current LinkedIn position shows the role), and `evidence_url` (the page that shows it).
399
- - `completion_reason` adds `all_domains_processed` (Company Enrich read every domain) to People Search's values. `warnings` keep their `code` and `message`, for example `enrichment_time_limit` when some companies were not fully enriched before the task's time limit.
433
+ - `completion_reason` adds `all_domains_processed` (Company Enrich, or a search restricted to the domains its query names, read every domain) to People Search's values. `warnings` keep their `code` and `message`, for example `enrichment_time_limit` when some companies were not fully enriched before the task's time limit.
400
434
 
401
435
  CSV and JSON Lines downloads (`GET /desearch/companies/tasks/{task_id}/export`) are not MCP tools; call the API directly for a file.
402
436
 
@@ -691,7 +725,7 @@ Environment variables for the host:
691
725
  | `OAUTH_REGISTER_RATE_WINDOW_SEC` | No | Registration rate-limit window in seconds. Default 3600 (1 hour). Range 1 to 86400. |
692
726
  | `OAUTH_AUTHORIZE_RATE_LIMIT` | No | Sign-in key checks per IP per window. Default 20. Range 1 to 10000. |
693
727
  | `OAUTH_AUTHORIZE_RATE_WINDOW_SEC` | No | Sign-in key-check window in seconds. Default 600 (10 minutes). Range 1 to 86400. |
694
- | `DESEARCH_API_BASE` | No | Key check host. Default `https://api.desearch.ai`. |
728
+ | `DESEARCH_API_BASE` | No | Desearch API host. Default `https://api.desearch.ai`. Used by the key check and by the routes the server calls directly (People Search, Company Search, `search-api`, `people-search-export`, and the social tools), for example to test against a staging API. Tools built on `desearch-js` always call `https://api.desearch.ai`. |
695
729
  | `OAUTH_REQUIRE_AUTH_ON_INITIALIZE` | No | Set to `true` to require a key or access token on `initialize`. Default is off, so keyless `initialize` stays public. `tools/list` stays public either way. |
696
730
 
697
731
  The key check calls `GET /twitter/trends?woeid=1&count=1`. A real key is authenticated and then rejected as invalid input (HTTP 422), so the check does not run a full trends query. Only 422 counts as a valid key. `401` and `403` reject the key. Any other status, including a 2xx, is a verification error and is not treated as valid.
@@ -10,6 +10,8 @@ import { type PeopleApiResponse, type PeopleControlAction } from "./people.js";
10
10
  * - `POST /desearch/companies/search` finds companies from a description and
11
11
  * `POST /desearch/companies/enrich` reads the domains you send. Both are billed:
12
12
  * they reserve companies at the route price and settle to what they deliver.
13
+ * A search with `max_cost_usd` reserves that budget instead and also bills its
14
+ * search effort where the companies it delivers do not cover it.
13
15
  * - Every other route (tasks, results, pause/resume/cancel) is free. Both kinds of task
14
16
  * run on the People Search engine, but a People Search task_id is a 404 on these
15
17
  * routes and a company task_id is a 404 on People Search's.
@@ -35,6 +37,10 @@ export type CompanyTaskType = (typeof COMPANY_TASK_TYPES)[number];
35
37
  export declare const COMPANY_DOMAINS_MAX = 200;
36
38
  export declare const COMPANY_COUNTRIES_MAX = 20;
37
39
  export declare const COMPANY_EXCLUDE_MAX = 1000;
40
+ /** The largest `max_cost_usd` (model/companies.py COMPANY_SEARCH_MAX_BUDGET_USD). */
41
+ export declare const COMPANY_SEARCH_MAX_BUDGET_USD = 100;
42
+ /** `count` on `POST /desearch/companies/search` (model/people.py PEOPLE_COUNT_MIN). */
43
+ export declare const COMPANY_COUNT_MIN = 5;
38
44
  interface CompanyTaskOptions {
39
45
  roles?: CompanyRole[];
40
46
  infer_emails?: boolean;
@@ -49,6 +55,8 @@ export interface CompanySearchArgs extends CompanyTaskOptions {
49
55
  exclude?: string[];
50
56
  countries?: string[];
51
57
  require?: CompanyRequirement[];
58
+ max_cost_usd?: number;
59
+ continue_from?: string;
52
60
  }
53
61
  export interface CompanyEnrichArgs extends CompanyTaskOptions {
54
62
  domains: string[];
@@ -83,25 +91,34 @@ export declare function compactCompany(company: unknown): Record<string, unknown
83
91
  /**
84
92
  * Task fields an agent polls on. `progress` is the worker's counters, passed through
85
93
  * without its copy of `warnings` (listed once, at the top). `completion_reason` appears
86
- * once the task has ended, `coverage_limited` only when true.
94
+ * once the task has ended, `coverage_limited` only when true. `max_cost_usd` and
95
+ * `continue_from` come from the stored request (a search with a budget, or one that continues
96
+ * an earlier search), `only_domains` from how the query was read (a search restricted to the
97
+ * domains it names).
87
98
  */
88
99
  export declare function compactCompanyTask(task: unknown, options?: {
89
100
  progress?: boolean;
90
101
  }): Record<string, unknown>;
102
+ type NextTask = {
103
+ task_id?: unknown;
104
+ search_type?: unknown;
105
+ stage?: unknown;
106
+ completion_reason?: unknown;
107
+ coverage_limited?: unknown;
108
+ count?: unknown;
109
+ result_count?: unknown;
110
+ max_cost_usd?: unknown;
111
+ };
91
112
  /**
92
113
  * One sentence (or two) on what to do next, so an agent does not have to infer it from the status.
93
114
  * `nextCursor` is the results cursor when the caller just read a page of companies.
94
- * `task` adds the stage (`enriching`) and why an ended task stopped.
115
+ * `task` adds the stage (`enriching`), why an ended task stopped, and whether it had a budget
116
+ * (`max_cost_usd`): a search a limit stopped before `count` also says how to continue it.
95
117
  * `page.partial` counts the companies on this page whose enrichment is still `partial`;
96
118
  * `page.readAfterStart` is true when the caller passed a cursor, so it may hold older
97
119
  * versions of companies it read before.
98
120
  */
99
- export declare function companyNextStep(status: string | undefined, nextCursor?: string, hasMore?: boolean, task?: {
100
- stage?: unknown;
101
- completion_reason?: unknown;
102
- coverage_limited?: unknown;
103
- count?: unknown;
104
- }, page?: {
121
+ export declare function companyNextStep(status: string | undefined, nextCursor?: string, hasMore?: boolean, task?: NextTask, page?: {
105
122
  partial?: number;
106
123
  readAfterStart?: boolean;
107
124
  }): string;
@@ -1 +1 @@
1
- {"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAUH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAC3B,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,6HAAuB,CAAC;AAE1D,6DAA6D;AAC7D,eAAO,MAAM,aAAa,oGAUhB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,mEAAoE,CAAC;AACtG,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,+BAAgC,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MA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from a description and
11
11
  * `POST /desearch/companies/enrich` reads the domains you send. Both are billed:
12
12
  * they reserve companies at the route price and settle to what they deliver.
13
+ * A search with `max_cost_usd` reserves that budget instead and also bills its
14
+ * search effort where the companies it delivers do not cover it.
13
15
  * - Every other route (tasks, results, pause/resume/cancel) is free. Both kinds of task
14
16
  * run on the People Search engine, but a People Search task_id is a 404 on these
15
17
  * routes and a company task_id is a 404 on People Search's.
@@ -42,6 +44,10 @@ export const COMPANY_TASK_TYPES = ["search", "enrich"];
42
44
  export const COMPANY_DOMAINS_MAX = 200;
43
45
  export const COMPANY_COUNTRIES_MAX = 20;
44
46
  export const COMPANY_EXCLUDE_MAX = 1000;
47
+ /** The largest `max_cost_usd` (model/companies.py COMPANY_SEARCH_MAX_BUDGET_USD). */
48
+ export const COMPANY_SEARCH_MAX_BUDGET_USD = 100;
49
+ /** `count` on `POST /desearch/companies/search` (model/people.py PEOPLE_COUNT_MIN). */
50
+ export const COMPANY_COUNT_MIN = 5;
45
51
  export function createCompanyClient(apiKey, baseUrl = PEOPLE_API_BASE_URL) {
46
52
  return companyClientFor(createDesearchApi(apiKey, baseUrl));
47
53
  }
@@ -100,6 +106,10 @@ export function companySearchBody(args) {
100
106
  body.min_score = args.min_score;
101
107
  if (args.exclude !== undefined)
102
108
  body.exclude = args.exclude;
109
+ if (args.max_cost_usd !== undefined)
110
+ body.max_cost_usd = args.max_cost_usd;
111
+ if (args.continue_from !== undefined)
112
+ body.continue_from = args.continue_from;
103
113
  leaderFields(args, body);
104
114
  const filters = {};
105
115
  if (args.countries !== undefined)
@@ -246,10 +256,14 @@ function compactWarning(warning) {
246
256
  /**
247
257
  * Task fields an agent polls on. `progress` is the worker's counters, passed through
248
258
  * without its copy of `warnings` (listed once, at the top). `completion_reason` appears
249
- * once the task has ended, `coverage_limited` only when true.
259
+ * once the task has ended, `coverage_limited` only when true. `max_cost_usd` and
260
+ * `continue_from` come from the stored request (a search with a budget, or one that continues
261
+ * an earlier search), `only_domains` from how the query was read (a search restricted to the
262
+ * domains it names).
250
263
  */
251
264
  export function compactCompanyTask(task, options = {}) {
252
265
  const t = objectOf(task);
266
+ const request = objectOf(t.request);
253
267
  const status = typeof t.status === "string" ? t.status : undefined;
254
268
  let progress;
255
269
  if (options.progress) {
@@ -266,6 +280,9 @@ export function compactCompanyTask(task, options = {}) {
266
280
  metadata: t.metadata,
267
281
  count: t.count,
268
282
  result_count: t.result_count,
283
+ max_cost_usd: numberOf(request.max_cost_usd),
284
+ continue_from: stringOf(request.continue_from),
285
+ only_domains: strings(objectOf(objectOf(t.interpreted).interpretation).only_domains),
269
286
  completion_reason: stringOf(t.completion_reason),
270
287
  coverage_limited: t.coverage_limited === true ? true : undefined,
271
288
  warnings: arrayOf(t.warnings).map(compactWarning),
@@ -280,10 +297,35 @@ export function compactCompanyTask(task, options = {}) {
280
297
  });
281
298
  }
282
299
  const LATEST = "call company-search-status without cursor to read every company in its latest version";
300
+ /**
301
+ * For a search a limit stopped before `count`: how to find more with `continue_from`, which
302
+ * leaves out every company this one delivered or held for review. A budget (`max_cost_usd`) is
303
+ * offered only as the user's choice, because it bills search effort even when little is found.
304
+ */
305
+ function findMore(task) {
306
+ const id = typeof task.task_id === "string" ? `continue_from "${task.task_id}"` : "continue_from set to its task_id";
307
+ const count = numberOf(task.count);
308
+ const delivered = numberOf(task.result_count);
309
+ const left = count !== undefined && delivered !== undefined ? count - delivered : 0;
310
+ const wanted = left >= COMPANY_COUNT_MIN
311
+ ? `count ${left} (the companies still wanted)`
312
+ : left > 0
313
+ ? `count ${COMPANY_COUNT_MIN} (the least it takes; ${left} still wanted)`
314
+ : "count set to the companies still wanted";
315
+ const offer = `To find more, offer the user a new company-search with the same query and filters, ${id}, and ${wanted}: it leaves out every company this search delivered or held for review.`;
316
+ if (typeof task.max_cost_usd === "number") {
317
+ return `${offer} Set max_cost_usd on it only if the user agrees to a new budget.`;
318
+ }
319
+ if (task.completion_reason === "time_limit") {
320
+ return offer;
321
+ }
322
+ return `${offer} The user may also set a budget (max_cost_usd): the search then goes on until it delivers count or spends the budget, and bills its search effort up to the budget even when it finds few companies or none, so set it only with the user's agreement to that amount.`;
323
+ }
283
324
  /**
284
325
  * One sentence (or two) on what to do next, so an agent does not have to infer it from the status.
285
326
  * `nextCursor` is the results cursor when the caller just read a page of companies.
286
- * `task` adds the stage (`enriching`) and why an ended task stopped.
327
+ * `task` adds the stage (`enriching`), why an ended task stopped, and whether it had a budget
328
+ * (`max_cost_usd`): a search a limit stopped before `count` also says how to continue it.
287
329
  * `page.partial` counts the companies on this page whose enrichment is still `partial`;
288
330
  * `page.readAfterStart` is true when the caller passed a cursor, so it may hold older
289
331
  * versions of companies it read before.
@@ -296,7 +338,7 @@ export function companyNextStep(status, nextCursor, hasMore = false, task = {},
296
338
  if (hasMore) {
297
339
  return `More companies are ready now: call ${again}.`;
298
340
  }
299
- const ended = (first) => {
341
+ const ended = (first, last) => {
300
342
  const notes = [first];
301
343
  if (partial > 0) {
302
344
  notes.push(`${partial === 1 ? "1 company" : `${partial} companies`} on this page stayed partial: the task ended before every stage ran for ${partial === 1 ? "it" : "them"}.`);
@@ -304,6 +346,8 @@ export function companyNextStep(status, nextCursor, hasMore = false, task = {},
304
346
  if (page.readAfterStart) {
305
347
  notes.push("If you read companies while it ran, call company-search-status without cursor to read every company in its final version.");
306
348
  }
349
+ if (last !== undefined)
350
+ notes.push(last);
307
351
  return notes.join(" ");
308
352
  };
309
353
  switch (status) {
@@ -328,7 +372,14 @@ export function companyNextStep(status, nextCursor, hasMore = false, task = {},
328
372
  case "completed":
329
373
  if (task.coverage_limited === true) {
330
374
  const wanted = typeof task.count === "number" ? `${task.count} companies` : "the count you asked for";
331
- return ended(`Finished early: a budget stopped it (${String(task.completion_reason)}) before it delivered ${wanted}, so more companies may match. You have every company it delivered.`);
375
+ const budget = numberOf(task.max_cost_usd);
376
+ const why = task.completion_reason !== "cost_limit"
377
+ ? `a limit stopped it (${String(task.completion_reason)})`
378
+ : budget !== undefined
379
+ ? `it spent its search budget of $${budget} (max_cost_usd; cost_limit)`
380
+ : "it stopped once its search cost more than the companies it found pay for (cost_limit)";
381
+ // continue_from takes a Company Search only.
382
+ return ended(`Finished early: ${why} before it delivered ${wanted}, so more companies may match. You have every company it delivered.`, task.search_type === "company_enrich" ? undefined : findMore(task));
332
383
  }
333
384
  if (task.completion_reason === "no_candidates") {
334
385
  return "Finished: its searches found no company to check. Try a broader description.";
@@ -345,6 +396,9 @@ export function companyNextStep(status, nextCursor, hasMore = false, task = {},
345
396
  case "failed":
346
397
  return "The task failed. See errors. A task that delivers no companies is not charged.";
347
398
  case "cancelled":
399
+ if (typeof task.max_cost_usd === "number") {
400
+ return ended("Cancelled. A search with a budget pays for the companies it delivered or, when that is more, its search effort so far, up to max_cost_usd; the rest of the reservation is returned.");
401
+ }
348
402
  return ended("Cancelled. You pay only for the companies it delivered; the rest of the reservation is returned.");
349
403
  case "expired":
350
404
  return "Results expired 30 days after the task ended.";
@@ -1,11 +1,16 @@
1
1
  /**
2
2
  * Direct calls to the Desearch API for routes desearch-js 1.5 does not cover
3
- * (People Search, the TikTok, Facebook and Instagram routes, `POST /search`).
3
+ * (People Search, the TikTok, Facebook, Instagram, YouTube, Reddit and Threads routes,
4
+ * `POST /search`).
4
5
  *
5
6
  * Same base URL, `Authorization: <key>` header, and `HTTP <status>: <detail>`
6
7
  * error text that desearch-js uses, so every tool reports API errors the same way.
7
8
  */
8
- export declare const DESEARCH_API_BASE_URL = "https://api.desearch.ai";
9
+ /**
10
+ * `DESEARCH_API_BASE` (the host the OAuth key check also uses) points these direct calls
11
+ * at another Desearch API, such as a staging deploy. The desearch-js tools ignore it.
12
+ */
13
+ export declare const DESEARCH_API_BASE_URL: string;
9
14
  export type QueryValue = string | number | boolean | undefined;
10
15
  export interface ApiResponse {
11
16
  status: number;
@@ -1 +1 @@
1
- {"version":3,"file":"desearch-api.d.ts","sourceRoot":"","sources":["../desearch-api.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,eA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AAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,WAAW,GAAG,CACtB,MAAM,EAAE,KAAK,GAAG,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,iBAAiB,KAC1B,OAAO,CAAC,WAAW,CAAC,CAAC;AAM1B,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/D;AAED,sDAAsD;AACtD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CASlF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAA8B,GAAG,WAAW,CAgCtG"}
@@ -1,12 +1,17 @@
1
1
  import { fetch } from "undici";
2
2
  /**
3
3
  * Direct calls to the Desearch API for routes desearch-js 1.5 does not cover
4
- * (People Search, the TikTok, Facebook and Instagram routes, `POST /search`).
4
+ * (People Search, the TikTok, Facebook, Instagram, YouTube, Reddit and Threads routes,
5
+ * `POST /search`).
5
6
  *
6
7
  * Same base URL, `Authorization: <key>` header, and `HTTP <status>: <detail>`
7
8
  * error text that desearch-js uses, so every tool reports API errors the same way.
8
9
  */
9
- export const DESEARCH_API_BASE_URL = "https://api.desearch.ai";
10
+ /**
11
+ * `DESEARCH_API_BASE` (the host the OAuth key check also uses) points these direct calls
12
+ * at another Desearch API, such as a staging deploy. The desearch-js tools ignore it.
13
+ */
14
+ export const DESEARCH_API_BASE_URL = (process.env.DESEARCH_API_BASE?.trim() || "https://api.desearch.ai").replace(/\/+$/, "");
10
15
  function isPlainObject(value) {
11
16
  return typeof value === "object" && value !== null && !Array.isArray(value);
12
17
  }
package/build/people.d.ts CHANGED
@@ -10,7 +10,7 @@ import { type DesearchApi, type QueryValue } from "./desearch-api.js";
10
10
  * it reserves `count` people at the route price and settles to what it delivers.
11
11
  * - Every other route (tasks, results, pause/resume/cancel, profiles, exports) is free.
12
12
  */
13
- export declare const PEOPLE_API_BASE_URL = "https://api.desearch.ai";
13
+ export declare const PEOPLE_API_BASE_URL: string;
14
14
  export declare const PEOPLE_PLATFORMS: readonly ["x", "youtube", "linkedin", "tiktok"];
15
15
  export type PeoplePlatform = (typeof PEOPLE_PLATFORMS)[number];
16
16
  export declare const PEOPLE_TASK_STATUSES: readonly ["queued", "running", "pausing", "paused", "cancelling", "completed", "partial", "failed", "cancelled", "expired"];
@@ -1 +1 @@
1
- {"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../people.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhH;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,mBAAmB,4BAAwB,CAAC;AAEzD,eAAO,MAAM,gBAAgB,iDAAkD,CAAC;AAChF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,oBAAoB,6HAWvB,CAAC;AAEX,yDAAyD;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,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAoBnF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAgC,GAC3C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAwBtG;AAcD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqD5G"}
package/build/server.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type Icon } from "@modelcontextprotocol/sdk/types.js";
3
3
  import { type PeopleClient } from "./people.js";
4
4
  import { type CompanyClient } from "./companies.js";
5
5
  export declare const SERVER_NAME = "Desearch";
6
- export declare const SERVER_VERSION = "0.7.0";
6
+ export declare const SERVER_VERSION = "0.9.0";
7
7
  export declare const SERVER_TITLE = "Desearch";
8
8
  export declare const SERVER_WEBSITE_URL = "https://www.desearch.ai";
9
9
  export declare const MCP_PUBLIC_BASE_URL: string;
@@ -107,7 +107,7 @@ export declare function presentSearchBody(value: unknown): unknown;
107
107
  * them and the server builds a desearch-js client, a People Search client (people.ts), and
108
108
  * a Company Search client (companies.ts) from `apiKey`.
109
109
  * The routes desearch-js 1.5 does not cover (People Search, Company Search, TikTok,
110
- * Facebook, Instagram, `POST /search`) share one direct API caller (desearch-api.ts)
110
+ * Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`) share one direct API caller (desearch-api.ts)
111
111
  * for that key.
112
112
  */
113
113
  export declare function createDesearchMcpServer(apiKey: string, client?: DesearchClient, peopleClient?: PeopleClient, companyClient?: CompanyClient): McpServer;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAKH,KAAK,IAAI,EAEZ,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAqBH,KAAK,YAAY,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAcH,KAAK,aAAa,EACrB,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAG5D,eAAO,MAAM,mBAAmB,QAA6F,CAAC;AAE9H,eAAO,MAAM,YAAY,EAAE,IAAI,EAG9B,CAAC;AAEF,UAAU,cAAc;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,kBAAkB;IACxB,GAAG,EAAE,MAAM,CAAC;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chApi } from "./desearch-api.js";
6
6
  import { PEOPLE_EXPORT_DEFAULT_ROWS, PEOPLE_EXPORT_FORMATS, PEOPLE_EXPORT_MAX_CHARS, PEOPLE_EXPORT_MAX_ROWS, PEOPLE_FILTER_CHANNELS, PEOPLE_METADATA_KEY_PATTERN, PEOPLE_METADATA_MAX_FILTERS, PEOPLE_METADATA_MAX_KEYS, PEOPLE_METADATA_VALUE_MAX, PEOPLE_PLATFORMS, PEOPLE_PROFILE_SORTS, PEOPLE_SEARCH_FILTERS, PEOPLE_TASK_STATUSES, controlPeopleTask, exportPeople, listPeopleProfiles, listPeopleTasks, peopleClientFor, readPeopleStatus, startPeopleSearch, } from "./people.js";
7
- import { COMPANY_COUNTRIES_MAX, COMPANY_DOMAINS_MAX, COMPANY_EXCLUDE_MAX, COMPANY_REQUIREMENTS, COMPANY_ROLES, COMPANY_TASK_STATUSES, COMPANY_TASK_TYPES, companyClientFor, controlCompanyTask, listCompanyTasks, readCompanyStatus, startCompanyEnrich, startCompanySearch, } from "./companies.js";
7
+ import { COMPANY_COUNTRIES_MAX, COMPANY_DOMAINS_MAX, COMPANY_EXCLUDE_MAX, COMPANY_REQUIREMENTS, COMPANY_ROLES, COMPANY_SEARCH_MAX_BUDGET_USD, COMPANY_TASK_STATUSES, COMPANY_TASK_TYPES, companyClientFor, controlCompanyTask, listCompanyTasks, readCompanyStatus, startCompanyEnrich, startCompanySearch, } from "./companies.js";
8
8
  import { runSocialAction, socialActionNames } from "./social.js";
9
9
  import { AI_SEARCH_TOOLS, WEB_LINK_TOOLS, toolIdSchema } from "./tool-sources.js";
10
10
  export const SERVER_NAME = "Desearch";
11
- export const SERVER_VERSION = "0.7.0";
11
+ export const SERVER_VERSION = "0.9.0";
12
12
  export const SERVER_TITLE = "Desearch";
13
13
  export const SERVER_WEBSITE_URL = "https://www.desearch.ai";
14
14
  // Public origin of the hosted server, which serves the icons below.
@@ -142,13 +142,20 @@ function socialCursor() {
142
142
  .optional()
143
143
  .describe("next_cursor from the previous page of the same action and target, sent back unchanged. Omit it for the first page.");
144
144
  }
145
- function socialQuery(example) {
145
+ function socialQuery(example, maxLength = 1000, note = "") {
146
146
  return z
147
147
  .string()
148
148
  .min(1)
149
- .max(1000)
149
+ .max(maxLength)
150
150
  .optional()
151
- .describe(`search: keyword or phrase, example: '${example}'.`);
151
+ .describe(`search: keyword or phrase, example: '${example}'.${note}`);
152
+ }
153
+ function socialDate(description) {
154
+ return z
155
+ .string()
156
+ .regex(/^\d{4}-\d{2}-\d{2}$/)
157
+ .optional()
158
+ .describe(description);
152
159
  }
153
160
  function socialTag() {
154
161
  return socialTarget("hashtag: the hashtag without #, example: 'ai'. A leading # is removed.");
@@ -452,7 +459,7 @@ function registerTool(server, apiKey, name, title, description, inputSchema, han
452
459
  * them and the server builds a desearch-js client, a People Search client (people.ts), and
453
460
  * a Company Search client (companies.ts) from `apiKey`.
454
461
  * The routes desearch-js 1.5 does not cover (People Search, Company Search, TikTok,
455
- * Facebook, Instagram, `POST /search`) share one direct API caller (desearch-api.ts)
462
+ * Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`) share one direct API caller (desearch-api.ts)
456
463
  * for that key.
457
464
  */
458
465
  export function createDesearchMcpServer(apiKey, client, peopleClient, companyClient) {
@@ -468,7 +475,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
468
475
  icons: SERVER_ICONS,
469
476
  };
470
477
  const server = new McpServer(serverInfo, {
471
- instructions: "Search the public web and X with Desearch. Use search for titles and links, then fetch with a result URL to read the page. search-api returns ranked pages with the passage that best matches the query. Other tools cover AI search, X posts, and page extraction. tiktok, facebook, and instagram read public posts, profiles, comments, and hashtags; their list actions return next_cursor for the next page. People Search finds people and creators on X, YouTube, LinkedIn, and TikTok: people-search starts a paid job billed to the user's Desearch balance, people-search-status reads progress, people-search-pause, people-search-resume, and people-search-cancel pause, resume, or cancel it, and people-search-export returns the people found as CSV or JSON Lines. Company Search finds companies on the web from a description and Company Enrich reads the domains you send; both collect public emails, phones, social profiles, and leaders (CEO, founders, CTO, CFO): company-search and company-enrich start paid jobs billed to the user's Desearch balance, company-search-status reads progress and the companies, and company-search-pause, company-search-resume, and company-search-cancel pause, resume, or cancel a task. Calls need a Desearch API key.",
478
+ instructions: "Search the public web and X with Desearch. Use search for titles and links, then fetch with a result URL to read the page. search-api returns ranked pages with the passage that best matches the query. Other tools cover AI search, X posts, and page extraction. tiktok, facebook, instagram, youtube, reddit, and threads read public social data (posts, profiles, comments, hashtags, YouTube transcripts and channels, subreddits); list actions return next_cursor for the next page where the platform has one. People Search finds people and creators on X, YouTube, LinkedIn, and TikTok: people-search starts a paid job billed to the user's Desearch balance, people-search-status reads progress, people-search-pause, people-search-resume, and people-search-cancel pause, resume, or cancel it, and people-search-export returns the people found as CSV or JSON Lines. Company Search finds companies on the web from a description and Company Enrich reads the domains you send; both collect public emails, phones, social profiles, and leaders (CEO, founders, CTO, CFO): company-search and company-enrich start paid jobs billed to the user's Desearch balance, company-search-status reads progress and the companies, and company-search-pause, company-search-resume, and company-search-cancel pause, resume, or cancel a task. Set company-search's max_cost_usd only when the user agreed to that budget: it bills search effort even when few companies are found. Calls need a Desearch API key.",
472
479
  });
473
480
  registerTool(server, apiKey, "ai-search", "AI Search", "AI search and analysis on web using Desearch AI", {
474
481
  prompt: z.string().describe("Question, example: 'What is the latest news on AI?'"),
@@ -857,6 +864,81 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
857
864
  return fail("Instagram error", error);
858
865
  }
859
866
  });
867
+ registerTool(server, apiKey, "youtube", "YouTube", "Read public YouTube data with Desearch. Set action and that action's arguments. search (query; optional type, upload_date, sort_by, duration, cursor): videos, Shorts, live streams, channels, and playlists that match a keyword; each result has a type. video (id): one video or Short by ID or URL, with its channel, counts, chapters, and caption languages. transcript (video_id; optional language): its captions as plain text and timestamped segments; a video without captions returns 404. comments (video_id; optional order, cursor): its top-level comments. channel (handle): one channel by handle or channel ID. channel_videos (handle; optional sort, cursor): the channel's videos. A video id from search or channel_videos can be passed to video, transcript, or comments. video, transcript, and channel return the item itself. " +
868
+ SOCIAL_PAGING, strictArgs({
869
+ action: socialAction("youtube", "What to read: 'search', 'video', 'transcript', 'comments', 'channel', or 'channel_videos'."),
870
+ query: socialQuery("bittensor", 500, " Use intitle:\"...\" for stricter title matching."),
871
+ type: z
872
+ .enum(["videos", "shorts", "channels", "playlists"])
873
+ .optional()
874
+ .describe("search: only this kind of result. Omit for mixed results."),
875
+ upload_date: z
876
+ .enum(["today", "this_week", "this_month", "this_year"])
877
+ .optional()
878
+ .describe("search: only videos uploaded in this window."),
879
+ sort_by: z.enum(["relevance", "popular"]).optional().describe("search: result order."),
880
+ duration: z
881
+ .enum(["under_3_min", "between_3_and_20_min", "over_20_min"])
882
+ .optional()
883
+ .describe("search: video length. Applies to videos, not Shorts."),
884
+ id: socialTarget("video: YouTube video or Short ID, or its full URL, example: 'dQw4w9WgXcQ'."),
885
+ video_id: socialTarget("transcript, comments: YouTube video or Short ID, or its full URL."),
886
+ language: z
887
+ .string()
888
+ .regex(/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,4})?$/)
889
+ .optional()
890
+ .describe("transcript: caption language code, example: 'en' or 'es'. Omit for YouTube's default track."),
891
+ order: z.enum(["top", "newest"]).optional().describe("comments: comment order."),
892
+ handle: socialTarget("channel, channel_videos: channel handle (with or without @) or channel ID (UC...), example: '@MrBeast'."),
893
+ sort: z.enum(["latest", "popular"]).optional().describe("channel_videos: video order (API default latest)."),
894
+ cursor: socialCursor(),
895
+ }), async (args) => {
896
+ try {
897
+ return ok(await runSocialAction(api, "youtube", args));
898
+ }
899
+ catch (error) {
900
+ return fail("YouTube error", error);
901
+ }
902
+ });
903
+ registerTool(server, apiKey, "reddit", "Reddit", "Read public Reddit data with Desearch. Set action and that action's arguments. search (query; optional sort, timeframe, cursor): posts across all subreddits that match a keyword. subreddit (name): a subreddit's description, rules, and weekly activity; the name is case-sensitive ('AskReddit', not 'askreddit'). subreddit_posts (name; optional sort, timeframe, cursor): its posts. post (id): one post by ID or URL, without comments. comments (post_id; optional cursor): a post's comments as a tree, with the replies Reddit loaded alongside them. A post id from search or subreddit_posts can be passed to post or comments. subreddit and post return the item itself. " +
904
+ SOCIAL_PAGING, strictArgs({
905
+ action: socialAction("reddit", "What to read: 'search', 'subreddit', 'subreddit_posts', 'post', or 'comments'."),
906
+ query: socialQuery("bittensor", 500),
907
+ sort: z
908
+ .enum(["relevance", "new", "top", "comment_count", "best", "hot", "rising"])
909
+ .optional()
910
+ .describe("search: 'relevance', 'new', 'top', or 'comment_count'. subreddit_posts: 'best', 'hot', 'new', 'top', or 'rising'."),
911
+ timeframe: z
912
+ .enum(["all", "day", "week", "month", "year"])
913
+ .optional()
914
+ .describe("search: only posts from this window. subreddit_posts: the window for sort 'top' (ignored with another sort; without a sort it means top)."),
915
+ name: socialTarget("subreddit, subreddit_posts: subreddit name, case-sensitive, example: 'AskReddit'. A leading r/ is removed."),
916
+ id: socialTarget("post: Reddit post ID (example: '1q6pxwn', with or without t3_) or its full URL."),
917
+ post_id: socialTarget("comments: Reddit post ID (with or without t3_) or its full URL."),
918
+ cursor: socialCursor(),
919
+ }), async (args) => {
920
+ try {
921
+ return ok(await runSocialAction(api, "reddit", args));
922
+ }
923
+ catch (error) {
924
+ return fail("Reddit error", error);
925
+ }
926
+ });
927
+ registerTool(server, apiKey, "threads", "Threads", "Read public Threads data with Desearch. Set action and that action's arguments. search (query; optional start_date, end_date): one page of posts that match a keyword. search_users (query): accounts that match a username or name. profile (username): one profile with bio, followers, and links. profile_posts (username): the account's latest public posts (Threads shows only the most recent ones). post (id): one post by URL or shortcode, with its replies (comments) and the author's own continuation posts (threadItems). profile and post return the item itself. List actions return { results, next_cursor, next }; Threads returns no further pages, so next_cursor is always null and no action takes a cursor.", strictArgs({
928
+ action: socialAction("threads", "What to read: 'search', 'search_users', 'profile', 'profile_posts', or 'post'."),
929
+ query: socialQuery("bittensor", 500, " search_users: username or name, up to 100 characters, example: 'zuck'."),
930
+ start_date: socialDate("search: only posts on or after this date (YYYY-MM-DD), example: '2026-01-01'."),
931
+ end_date: socialDate("search: only posts on or before this date (YYYY-MM-DD)."),
932
+ username: socialTarget("profile, profile_posts: Threads username, example: 'zuck'. A leading @ is removed."),
933
+ id: socialTarget("post: Threads post URL or shortcode, example: 'DK-BydcJHkF' or 'https://www.threads.com/@zuck/post/DK-BydcJHkF'."),
934
+ }), async (args) => {
935
+ try {
936
+ return ok(await runSocialAction(api, "threads", args));
937
+ }
938
+ catch (error) {
939
+ return fail("Threads error", error);
940
+ }
941
+ });
860
942
  registerTool(server, apiKey, "search", "Search", "Search the public web and return titles and links. Use fetch with a result URL to read the page.", {
861
943
  query: z.string().describe("Search query."),
862
944
  }, async ({ query }) => {
@@ -1182,7 +1264,10 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1182
1264
  }
1183
1265
  }, undefined, READ_ONLY_OPEN_WORLD);
1184
1266
  registerTool(server, apiKey, "company-search", "Company Search", "Start a paid job billed to the user's Desearch balance: find companies on the web that match a plain-language description, and collect each one's public contact data. Returns a task_id at once, with the task's status and reserved_cost_usd. " +
1185
- "Cost: the call reserves count companies at the Company Search per-company price at the time of the call (reserved_cost_usd; prices at https://desearch.ai/pricing). When the task ends you pay only for the companies it delivered (final_cost_usd; a minimum of 2 when it delivers any; a task that delivers none is free) and the rest of the reservation is returned. A company left out by min_score or require is not billed. " +
1267
+ "Cost: without max_cost_usd, the call reserves count companies at the Company Search per-company price at the time of the call (reserved_cost_usd; prices at https://desearch.ai/pricing). When the task ends you pay only for the companies it delivered (final_cost_usd; a minimum of 1 when it delivers any; a task that delivers none is free) and the rest of the reservation is returned. A company left out by min_score or require is not billed. Such a search stops once it costs more than the companies it found pay for (completion_reason cost_limit, coverage_limited: true). " +
1268
+ "Search budget: with max_cost_usd the whole budget is reserved, and the search goes on until it delivers count or spends the budget. Its search effort is billed where the companies delivered do not cover it, up to the budget, even when it finds few companies or none; the unused part is returned. Set max_cost_usd only when the user agreed to spend that amount, never on your own. " +
1269
+ "Find more: when a search ended before count because a limit stopped it (coverage_limited, for example cost_limit), offer the user a new company-search with the same query and filters, continue_from set to its task_id, and count set to the companies still wanted, optionally with a budget the user agrees to. It leaves out every company the earlier search delivered or held for review, so it finds only new ones. " +
1270
+ "To check only companies you name, give their websites in query, for example 'Restrict this search to Acme (acme.com.au) and Beta (beta.co.uk). Return only those.' Only those domains are then checked against the rest of the description, with no web search (the task shows them as only_domains and ends with completion_reason all_domains_processed). Companies named without their websites do not restrict the search (warning scope_not_applied). " +
1186
1271
  "Each company has a fit score (0-100) and why it matched, plus fully_verified and unverified_criteria (what its own pages do and do not confirm). " +
1187
1272
  COMPANY_DATA +
1188
1273
  COMPANY_RUNS +
@@ -1191,14 +1276,14 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1191
1276
  .string()
1192
1277
  .min(3)
1193
1278
  .max(1000)
1194
- .describe("The companies you are looking for, in plain language: what they do, where, how far along. Example: 'Series A fintech startups in Berlin building payment infrastructure'."),
1279
+ .describe("The companies you are looking for, in plain language: what they do, where, how far along. Example: 'Series A fintech startups in Berlin building payment infrastructure'. To check only companies you name, give each one's website: 'Restrict this search to Acme (acme.com.au) and Beta (beta.co.uk). Return only those.' Only those domains are checked; companies named without a website do not restrict the search (warning scope_not_applied)."),
1195
1280
  count: z
1196
1281
  .number()
1197
1282
  .int()
1198
1283
  .min(5)
1199
1284
  .max(200)
1200
1285
  .optional()
1201
- .describe("How many companies to deliver (5-200, API default 25). The task reserves this many and bills only the companies it delivers."),
1286
+ .describe("How many companies to deliver (5-200, API default 25). Without max_cost_usd the task reserves this many and bills only the companies it delivers. With continue_from, the companies still wanted."),
1202
1287
  min_score: z
1203
1288
  .number()
1204
1289
  .int()
@@ -1220,6 +1305,17 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1220
1305
  .array(z.enum(COMPANY_REQUIREMENTS))
1221
1306
  .optional()
1222
1307
  .describe("Only deliver companies that have all of these: 'email', 'phone', 'linkedin' (the company's LinkedIn page), 'leader' (one of roles), 'leader_email' (a leader with an email). A company is delivered once the stage that can show them has run (email, phone, linkedin: the contact pages; leader: the leaders; leader_email: the email checks); one that does not have them is not delivered and not billed. Sent as filters.require."),
1308
+ max_cost_usd: z
1309
+ .number()
1310
+ .positive()
1311
+ .max(COMPANY_SEARCH_MAX_BUDGET_USD)
1312
+ .optional()
1313
+ .describe(`Search budget in USD (more than 0, up to ${COMPANY_SEARCH_MAX_BUDGET_USD}): the most this task may charge. Set it only when the user agreed to spend this amount. It must be at least what count reserves (count times the per-company price; a smaller budget is refused with HTTP 422, which gives the minimum). The whole budget is reserved (reserved_cost_usd) and the search goes on until it delivers count or spends the budget. Its search effort is billed where the companies delivered do not cover it, up to the budget, even when it finds few companies or none; the unused part is returned when the task ends. Without it, the search stops once it costs more than the companies it found pay for (cost_limit), and only the companies delivered are billed.`),
1314
+ continue_from: z
1315
+ .string()
1316
+ .uuid()
1317
+ .optional()
1318
+ .describe("task_id of an earlier Company Search of yours that has ended, to find only new companies: this search leaves out every company that one delivered, held for review, or was told to exclude, as well as your own exclude. Send the same query and filters with count set to the companies still wanted. HTTP 409 while that task has not ended (queued, running, or paused); 404 when it is not your Company Search (a Company Enrich or People Search task_id is refused)."),
1223
1319
  ...companyTaskFields(),
1224
1320
  }), async (args) => {
1225
1321
  try {
@@ -1249,7 +1345,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1249
1345
  }
1250
1346
  }, undefined, BILLED_TASK);
1251
1347
  registerTool(server, apiKey, "company-search-status", "Get Company Search Status", "Status, progress, and cost of one Company Search or Company Enrich task, plus a page of the companies delivered so far: domain, name, url, location, fit score (null for Company Enrich) and why it matched, primary_email and primary_contact, public emails, phones, and social profiles with the page each came from (source_url), leaders with their roles, title, LinkedIn profile, and emails (each with its verification status; inferred ones with source: inferred and a confidence), contact_coverage, and enrichment (status partial or complete, and each stage: profile, contacts, people, email_patterns, email_check). Free: it reads a task you already started and runs no new search. Cost fields are reserved_cost_usd and, once the task ended, final_cost_usd. The data came from each company's own website, public web search, and public LinkedIn profiles. " +
1252
- "Companies arrive while the task runs and are filled in place by the later stages: pass the returned next_cursor as cursor to get only the companies delivered since then, and call without cursor to read every company in its latest version. stage enriching means every company is delivered and only later stages of some are left. When done is true and has_more is false you have every company. An ended task has completion_reason (why it stopped; all_domains_processed for Company Enrich), coverage_limited: true when a budget stopped it before count (more companies may match), and warnings. Company Search results have fully_verified (every criterion confirmed by the company's own pages) and unverified_criteria (criteria that are unknown or not met, or a disqualifier that applies). These are information only: the company still qualified.", strictArgs({
1348
+ "Companies arrive while the task runs and are filled in place by the later stages: pass the returned next_cursor as cursor to get only the companies delivered since then, and call without cursor to read every company in its latest version. stage enriching means every company is delivered and only later stages of some are left. When done is true and has_more is false you have every company. An ended task has completion_reason (why it stopped; all_domains_processed for Company Enrich or a search restricted to the domains its query names, listed as only_domains), coverage_limited: true when a limit stopped it before count (more companies may match: the next hint says how to continue it with continue_from), and warnings. A search with a budget shows max_cost_usd, and progress.effort_units once it ended (the search effort billed where the companies delivered do not cover it); a continued search shows continue_from. Company Search results have fully_verified (every criterion confirmed by the company's own pages) and unverified_criteria (criteria that are unknown or not met, or a disqualifier that applies). These are information only: the company still qualified.", strictArgs({
1253
1349
  task_id: companyTaskId,
1254
1350
  cursor: z
1255
1351
  .string()
@@ -1295,7 +1391,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1295
1391
  return fail("Company Search Resume error", error);
1296
1392
  }
1297
1393
  }, undefined, TASK_STATE_CHANGE);
1298
- registerTool(server, apiKey, "company-search-cancel", "Cancel Company Search", "Cancel a Company Search or Company Enrich task. Free. The task stops for good; you pay only for the companies it already delivered (a task cancelled before it starts costs nothing) and the rest of the reservation is returned. Companies delivered so far stay readable for 30 days. This cannot be undone.", strictArgs({
1394
+ registerTool(server, apiKey, "company-search-cancel", "Cancel Company Search", "Cancel a Company Search or Company Enrich task. Free. The task stops for good; you pay only for the companies it already delivered (a task cancelled before it starts costs nothing) and the rest of the reservation is returned. A Company Search started with max_cost_usd pays for its search effort so far instead when that is more, up to its budget. Companies delivered so far stay readable for 30 days. This cannot be undone.", strictArgs({
1299
1395
  task_id: companyTaskId,
1300
1396
  }), async (args) => {
1301
1397
  try {
@@ -1305,7 +1401,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
1305
1401
  return fail("Company Search Cancel error", error);
1306
1402
  }
1307
1403
  }, undefined, TASK_CANCEL);
1308
- registerTool(server, apiKey, "company-search-tasks", "List Company Search Tasks", "Your Company Search and Company Enrich tasks, newest first, with status, counts, cost, why each ended task stopped (completion_reason, coverage_limited), and the metadata labels set on company-search or company-enrich. Free; it lists your own tasks, not the companies they found (read those with company-search-status). People Search tasks are not listed here (see people-search-tasks). Use it to find a task_id (filter by type, status, or metadata to find the tasks of one campaign), or to see which tasks are still queued, running, or paused: a new task is refused while too many People Search and Company Search tasks are active.", strictArgs({
1404
+ registerTool(server, apiKey, "company-search-tasks", "List Company Search Tasks", "Your Company Search and Company Enrich tasks, newest first, with status, counts, cost, why each ended task stopped (completion_reason, coverage_limited), max_cost_usd and continue_from when a search set them, and the metadata labels set on company-search or company-enrich. Free; it lists your own tasks, not the companies they found (read those with company-search-status). People Search tasks are not listed here (see people-search-tasks). Use it to find a task_id (filter by type, status, or metadata to find the tasks of one campaign), or to see which tasks are still queued, running, or paused: a new task is refused while too many People Search and Company Search tasks are active.", strictArgs({
1309
1405
  type: z
1310
1406
  .enum(COMPANY_TASK_TYPES)
1311
1407
  .optional()
package/build/social.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import type { DesearchApi } from "./desearch-api.js";
2
2
  /**
3
- * TikTok, Facebook, and Instagram on the Desearch API (`/desearch/{platform}/*`).
3
+ * TikTok, Facebook, Instagram, YouTube, Reddit, and Threads on the Desearch API
4
+ * (`/desearch/{platform}/*`).
4
5
  *
5
- * desearch-js 1.5 has no social methods, so the `tiktok`, `facebook`, and
6
- * `instagram` tools call these routes through `desearch-api.ts`. Each tool takes an
7
- * `action` that picks one route; the table below says which arguments each route
8
- * needs and accepts, and the request is refused before it is sent when they do not match.
6
+ * desearch-js 1.5 has no social methods, so the `tiktok`, `facebook`, `instagram`,
7
+ * `youtube`, `reddit`, and `threads` tools call these routes through `desearch-api.ts`.
8
+ * Each tool takes an `action` that picks one route; the table below says which
9
+ * arguments each route needs and accepts, and the request is refused before it is
10
+ * sent when they do not match.
9
11
  *
10
12
  * Paging (desearch-public-api docs/social-pagination.md): a list route answers with a
11
13
  * JSON array and, when there is another page, an `x-desearch-next-cursor` header.
@@ -13,7 +15,7 @@ import type { DesearchApi } from "./desearch-api.js";
13
15
  * same target. The header is absent on the last page. A cursor is opaque and lasts
14
16
  * 24 hours; this module never builds or changes one.
15
17
  */
16
- export declare const SOCIAL_PLATFORMS: readonly ["tiktok", "facebook", "instagram"];
18
+ export declare const SOCIAL_PLATFORMS: readonly ["tiktok", "facebook", "instagram", "youtube", "reddit", "threads"];
17
19
  export type SocialPlatform = (typeof SOCIAL_PLATFORMS)[number];
18
20
  export declare const NEXT_CURSOR_HEADER = "x-desearch-next-cursor";
19
21
  export interface SocialActionSpec {
@@ -26,6 +28,8 @@ export interface SocialActionSpec {
26
28
  optional: readonly string[];
27
29
  /** The route answers with a list of items. */
28
30
  list?: true;
31
+ /** Values an argument may take on this action, when the tool's schema allows more. */
32
+ choices?: Readonly<Record<string, readonly string[]>>;
29
33
  }
30
34
  export declare const SOCIAL_ACTIONS: {
31
35
  readonly tiktok: {
@@ -161,6 +165,123 @@ export declare const SOCIAL_ACTIONS: {
161
165
  readonly list: true;
162
166
  };
163
167
  };
168
+ readonly youtube: {
169
+ readonly search: {
170
+ readonly method: "POST";
171
+ readonly path: "/desearch/youtube/search";
172
+ readonly required: readonly ["query"];
173
+ readonly optional: readonly ["type", "upload_date", "sort_by", "duration", "cursor"];
174
+ readonly list: true;
175
+ };
176
+ readonly video: {
177
+ readonly method: "GET";
178
+ readonly path: "/desearch/youtube/video/{id}";
179
+ readonly required: readonly ["id"];
180
+ readonly optional: readonly [];
181
+ };
182
+ readonly transcript: {
183
+ readonly method: "GET";
184
+ readonly path: "/desearch/youtube/transcript/{video_id}";
185
+ readonly required: readonly ["video_id"];
186
+ readonly optional: readonly ["language"];
187
+ };
188
+ readonly comments: {
189
+ readonly method: "GET";
190
+ readonly path: "/desearch/youtube/comments/{video_id}";
191
+ readonly required: readonly ["video_id"];
192
+ readonly optional: readonly ["order", "cursor"];
193
+ readonly list: true;
194
+ };
195
+ readonly channel: {
196
+ readonly method: "GET";
197
+ readonly path: "/desearch/youtube/channel/{handle}";
198
+ readonly required: readonly ["handle"];
199
+ readonly optional: readonly [];
200
+ };
201
+ readonly channel_videos: {
202
+ readonly method: "GET";
203
+ readonly path: "/desearch/youtube/channel/{handle}/videos";
204
+ readonly required: readonly ["handle"];
205
+ readonly optional: readonly ["sort", "cursor"];
206
+ readonly list: true;
207
+ };
208
+ };
209
+ readonly reddit: {
210
+ readonly search: {
211
+ readonly method: "POST";
212
+ readonly path: "/desearch/reddit/search";
213
+ readonly required: readonly ["query"];
214
+ readonly optional: readonly ["sort", "timeframe", "cursor"];
215
+ readonly list: true;
216
+ readonly choices: {
217
+ readonly sort: readonly ["relevance", "new", "top", "comment_count"];
218
+ };
219
+ };
220
+ readonly subreddit: {
221
+ readonly method: "GET";
222
+ readonly path: "/desearch/reddit/subreddit/{name}";
223
+ readonly required: readonly ["name"];
224
+ readonly optional: readonly [];
225
+ };
226
+ readonly subreddit_posts: {
227
+ readonly method: "GET";
228
+ readonly path: "/desearch/reddit/subreddit/{name}/posts";
229
+ readonly required: readonly ["name"];
230
+ readonly optional: readonly ["sort", "timeframe", "cursor"];
231
+ readonly list: true;
232
+ readonly choices: {
233
+ readonly sort: readonly ["best", "hot", "new", "top", "rising"];
234
+ };
235
+ };
236
+ readonly post: {
237
+ readonly method: "GET";
238
+ readonly path: "/desearch/reddit/post/{id}";
239
+ readonly required: readonly ["id"];
240
+ readonly optional: readonly [];
241
+ };
242
+ readonly comments: {
243
+ readonly method: "GET";
244
+ readonly path: "/desearch/reddit/comments/{post_id}";
245
+ readonly required: readonly ["post_id"];
246
+ readonly optional: readonly ["cursor"];
247
+ readonly list: true;
248
+ };
249
+ };
250
+ readonly threads: {
251
+ readonly search: {
252
+ readonly method: "POST";
253
+ readonly path: "/desearch/threads/search";
254
+ readonly required: readonly ["query"];
255
+ readonly optional: readonly ["start_date", "end_date"];
256
+ readonly list: true;
257
+ };
258
+ readonly search_users: {
259
+ readonly method: "POST";
260
+ readonly path: "/desearch/threads/search/users";
261
+ readonly required: readonly ["query"];
262
+ readonly optional: readonly [];
263
+ readonly list: true;
264
+ };
265
+ readonly profile: {
266
+ readonly method: "GET";
267
+ readonly path: "/desearch/threads/profile/{username}";
268
+ readonly required: readonly ["username"];
269
+ readonly optional: readonly [];
270
+ };
271
+ readonly profile_posts: {
272
+ readonly method: "GET";
273
+ readonly path: "/desearch/threads/profile/{username}/posts";
274
+ readonly required: readonly ["username"];
275
+ readonly optional: readonly [];
276
+ readonly list: true;
277
+ };
278
+ readonly post: {
279
+ readonly method: "GET";
280
+ readonly path: "/desearch/threads/post/{id}";
281
+ readonly required: readonly ["id"];
282
+ readonly optional: readonly [];
283
+ };
284
+ };
164
285
  };
165
286
  export type SocialAction<P extends SocialPlatform> = keyof (typeof SOCIAL_ACTIONS)[P] & string;
166
287
  /** Action names in table order, for the tool's `action` enum. */
@@ -179,8 +300,8 @@ export declare function socialRequest(platform: SocialPlatform, args: Record<str
179
300
  /** One sentence on how to get the next page. */
180
301
  export declare function socialNextStep(platform: SocialPlatform, action: string, spec: SocialActionSpec, nextCursor: string | null): string;
181
302
  /**
182
- * Run one `tiktok`, `facebook`, or `instagram` action. A single post, profile, or
183
- * media item comes back as the API sent it. A list comes back as
303
+ * Run one social action. A single post, profile, media item, video, transcript,
304
+ * channel, or subreddit comes back as the API sent it. A list comes back as
184
305
  * `{ results, next_cursor, next }`: `next_cursor` is the `x-desearch-next-cursor`
185
306
  * header (null on the last page) and `next` says how to ask for the next page.
186
307
  */
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,gBAAgB,8CAA+C,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,8CAA8C;IAC9C,IAAI,CAAC,EAAE,IAAI,CAAC;CACf;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHkD,CAAC;AAE9E,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,cAAc,IAAI,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAE/F,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAEhH;AAOD,2CAA2C;AAC3C,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,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M,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,MAAM,GAAG,IAAI,GAC1B,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACjC,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAAO,CAAC,CAclB"}
package/build/social.js CHANGED
@@ -1,10 +1,12 @@
1
1
  /**
2
- * TikTok, Facebook, and Instagram on the Desearch API (`/desearch/{platform}/*`).
2
+ * TikTok, Facebook, Instagram, YouTube, Reddit, and Threads on the Desearch API
3
+ * (`/desearch/{platform}/*`).
3
4
  *
4
- * desearch-js 1.5 has no social methods, so the `tiktok`, `facebook`, and
5
- * `instagram` tools call these routes through `desearch-api.ts`. Each tool takes an
6
- * `action` that picks one route; the table below says which arguments each route
7
- * needs and accepts, and the request is refused before it is sent when they do not match.
5
+ * desearch-js 1.5 has no social methods, so the `tiktok`, `facebook`, `instagram`,
6
+ * `youtube`, `reddit`, and `threads` tools call these routes through `desearch-api.ts`.
7
+ * Each tool takes an `action` that picks one route; the table below says which
8
+ * arguments each route needs and accepts, and the request is refused before it is
9
+ * sent when they do not match.
8
10
  *
9
11
  * Paging (desearch-public-api docs/social-pagination.md): a list route answers with a
10
12
  * JSON array and, when there is another page, an `x-desearch-next-cursor` header.
@@ -12,7 +14,7 @@
12
14
  * same target. The header is absent on the last page. A cursor is opaque and lasts
13
15
  * 24 hours; this module never builds or changes one.
14
16
  */
15
- export const SOCIAL_PLATFORMS = ["tiktok", "facebook", "instagram"];
17
+ export const SOCIAL_PLATFORMS = ["tiktok", "facebook", "instagram", "youtube", "reddit", "threads"];
16
18
  export const NEXT_CURSOR_HEADER = "x-desearch-next-cursor";
17
19
  export const SOCIAL_ACTIONS = {
18
20
  tiktok: {
@@ -129,6 +131,90 @@ export const SOCIAL_ACTIONS = {
129
131
  list: true,
130
132
  },
131
133
  },
134
+ youtube: {
135
+ search: {
136
+ method: "POST",
137
+ path: "/desearch/youtube/search",
138
+ required: ["query"],
139
+ optional: ["type", "upload_date", "sort_by", "duration", "cursor"],
140
+ list: true,
141
+ },
142
+ video: { method: "GET", path: "/desearch/youtube/video/{id}", required: ["id"], optional: [] },
143
+ transcript: {
144
+ method: "GET",
145
+ path: "/desearch/youtube/transcript/{video_id}",
146
+ required: ["video_id"],
147
+ optional: ["language"],
148
+ },
149
+ comments: {
150
+ method: "GET",
151
+ path: "/desearch/youtube/comments/{video_id}",
152
+ required: ["video_id"],
153
+ optional: ["order", "cursor"],
154
+ list: true,
155
+ },
156
+ channel: { method: "GET", path: "/desearch/youtube/channel/{handle}", required: ["handle"], optional: [] },
157
+ channel_videos: {
158
+ method: "GET",
159
+ path: "/desearch/youtube/channel/{handle}/videos",
160
+ required: ["handle"],
161
+ optional: ["sort", "cursor"],
162
+ list: true,
163
+ },
164
+ },
165
+ reddit: {
166
+ search: {
167
+ method: "POST",
168
+ path: "/desearch/reddit/search",
169
+ required: ["query"],
170
+ optional: ["sort", "timeframe", "cursor"],
171
+ list: true,
172
+ choices: { sort: ["relevance", "new", "top", "comment_count"] },
173
+ },
174
+ subreddit: { method: "GET", path: "/desearch/reddit/subreddit/{name}", required: ["name"], optional: [] },
175
+ subreddit_posts: {
176
+ method: "GET",
177
+ path: "/desearch/reddit/subreddit/{name}/posts",
178
+ required: ["name"],
179
+ optional: ["sort", "timeframe", "cursor"],
180
+ list: true,
181
+ choices: { sort: ["best", "hot", "new", "top", "rising"] },
182
+ },
183
+ post: { method: "GET", path: "/desearch/reddit/post/{id}", required: ["id"], optional: [] },
184
+ comments: {
185
+ method: "GET",
186
+ path: "/desearch/reddit/comments/{post_id}",
187
+ required: ["post_id"],
188
+ optional: ["cursor"],
189
+ list: true,
190
+ },
191
+ },
192
+ // Threads shows one page of results everywhere: no action takes a cursor.
193
+ threads: {
194
+ search: {
195
+ method: "POST",
196
+ path: "/desearch/threads/search",
197
+ required: ["query"],
198
+ optional: ["start_date", "end_date"],
199
+ list: true,
200
+ },
201
+ search_users: {
202
+ method: "POST",
203
+ path: "/desearch/threads/search/users",
204
+ required: ["query"],
205
+ optional: [],
206
+ list: true,
207
+ },
208
+ profile: { method: "GET", path: "/desearch/threads/profile/{username}", required: ["username"], optional: [] },
209
+ profile_posts: {
210
+ method: "GET",
211
+ path: "/desearch/threads/profile/{username}/posts",
212
+ required: ["username"],
213
+ optional: [],
214
+ list: true,
215
+ },
216
+ post: { method: "GET", path: "/desearch/threads/post/{id}", required: ["id"], optional: [] },
217
+ },
132
218
  };
133
219
  /** Action names in table order, for the tool's `action` enum. */
134
220
  export function socialActionNames(platform) {
@@ -148,8 +234,9 @@ export function socialActionUsage(platform, action) {
148
234
  return parts.length > 0 ? parts.join(", ") : "no other arguments";
149
235
  }
150
236
  /**
151
- * Light clean-up of a target: trim it, and drop a leading "@" from a username or
152
- * "#" from a tag, which the API takes without them. Cursors are never touched.
237
+ * Light clean-up of a target: trim it, and drop a leading "@" from a username,
238
+ * "#" from a tag, or "r/" from a subreddit name, which the API takes without them.
239
+ * Cursors are never touched.
153
240
  */
154
241
  function cleanTarget(name, value) {
155
242
  const trimmed = value.trim();
@@ -159,18 +246,32 @@ function cleanTarget(name, value) {
159
246
  if (name === "tag") {
160
247
  return trimmed.replace(/^#+/, "");
161
248
  }
249
+ if (name === "name") {
250
+ return trimmed.replace(/^\/?r\//i, "");
251
+ }
162
252
  return trimmed;
163
253
  }
164
254
  const ARGUMENT_NAMES = [
165
255
  "query",
256
+ "type",
166
257
  "sort",
258
+ "sort_by",
259
+ "upload_date",
260
+ "duration",
261
+ "timeframe",
262
+ "start_date",
263
+ "end_date",
167
264
  "id",
168
265
  "username",
266
+ "handle",
267
+ "name",
169
268
  "profile_id",
170
269
  "post_id",
171
270
  "video_id",
172
271
  "shortcode",
173
272
  "tag",
273
+ "language",
274
+ "order",
174
275
  "region",
175
276
  "count",
176
277
  "cursor",
@@ -201,7 +302,9 @@ export function socialRequest(platform, args) {
201
302
  typeof raw === "string" && spec.required.includes(name) ? cleanTarget(name, raw) : raw;
202
303
  }
203
304
  const missing = spec.required.filter((name) => values[name] === undefined || values[name] === "");
204
- if (missing.length > 0 || extra.length > 0) {
305
+ const choices = spec.choices ?? {};
306
+ const wrong = Object.keys(choices).filter((name) => values[name] !== undefined && !choices[name].includes(String(values[name])));
307
+ if (missing.length > 0 || extra.length > 0 || wrong.length > 0) {
205
308
  const problems = [];
206
309
  if (missing.length > 0) {
207
310
  problems.push(`${platform} action "${action}" needs ${missing.join(" and ")}.`);
@@ -209,6 +312,9 @@ export function socialRequest(platform, args) {
209
312
  if (extra.length > 0) {
210
313
  problems.push(`${platform} action "${action}" does not take ${extra.join(", ")}.`);
211
314
  }
315
+ for (const name of wrong) {
316
+ problems.push(`${platform} action "${action}" takes ${name} ${choices[name].join(", ")}, not "${String(values[name])}".`);
317
+ }
212
318
  throw new Error(`${problems.join(" ")} ${action} takes: ${socialActionUsage(platform, action)}. No request was sent.`);
213
319
  }
214
320
  const inPath = new Set();
@@ -237,8 +343,8 @@ export function socialNextStep(platform, action, spec, nextCursor) {
237
343
  return `More results: call ${platform} again with action "${action}"${same} and cursor set to next_cursor, unchanged. A cursor works for 24 hours.`;
238
344
  }
239
345
  /**
240
- * Run one `tiktok`, `facebook`, or `instagram` action. A single post, profile, or
241
- * media item comes back as the API sent it. A list comes back as
346
+ * Run one social action. A single post, profile, media item, video, transcript,
347
+ * channel, or subreddit comes back as the API sent it. A list comes back as
242
348
  * `{ results, next_cursor, next }`: `next_cursor` is the `x-desearch-next-cursor`
243
349
  * header (null on the last page) and `next` says how to ask for the next page.
244
350
  */
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "desearch-mcp-server",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "mcpName": "io.github.Desearch-ai/mcp-desearch",
5
- "description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, the Search API, public TikTok, Facebook, and Instagram data, People Search exports, page extraction, X data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), and Company Search (find companies and their public contacts and leaders, or enrich domains you send) tools for AI agents. Includes 36 tools.",
5
+ "description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, the Search API, public TikTok, Facebook, Instagram, YouTube (including transcripts), Reddit, and Threads data, People Search exports, page extraction, X data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), and Company Search (find companies and their public contacts and leaders, or enrich domains you send) tools for AI agents. Includes 39 tools.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://desearch.ai",
8
8
  "type": "module",
@@ -52,7 +52,9 @@
52
52
  "tiktok",
53
53
  "linkedin",
54
54
  "instagram",
55
- "facebook"
55
+ "facebook",
56
+ "threads",
57
+ "youtube-transcript"
56
58
  ],
57
59
  "scripts": {
58
60
  "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",