desearch-mcp-server 0.4.0 → 0.6.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 +31 -1
- package/README.md +150 -4
- package/build/companies.d.ts +130 -0
- package/build/companies.d.ts.map +1 -0
- package/build/companies.js +429 -0
- package/build/people.d.ts +17 -2
- package/build/people.d.ts.map +1 -1
- package/build/people.js +17 -9
- package/build/server.d.ts +7 -5
- package/build/server.d.ts.map +1 -1
- package/build/server.js +209 -16
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
Company Search and Company Enrich tools. Company Search is live on `api.desearch.ai` since 2026-10-29.
|
|
6
|
+
|
|
7
|
+
Company Search finds companies on the web from a plain-language description; Company Enrich starts from the domains you send. Both collect each company's public emails, phones, and social profiles, and its leaders (CEO, founders, CTO, and CFO by default) with their LinkedIn profiles and emails, and every contact keeps the page it came from. They run as background tasks on the People Search engine. desearch-js 1.5 has no Company Search methods, so `companies.ts` calls the `/desearch/companies/*` routes directly with the same key header and error text as `people.ts` (the request helper is now shared).
|
|
8
|
+
|
|
9
|
+
| Tool | Route | Billed |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `company-search` | `POST /desearch/companies/search` | Yes. Reserves `count` companies at the Company Search per-company price and settles to the companies delivered (a minimum of 2 when it delivers any; nothing when it delivers none). |
|
|
12
|
+
| `company-enrich` | `POST /desearch/companies/enrich` | Yes. Reserves one company per domain sent at the Company Enrich per-company price and settles to the companies delivered (a minimum of 1); duplicate domains are returned. |
|
|
13
|
+
| `company-search-status` | `GET /desearch/companies/tasks/{id}` and `GET /desearch/companies/tasks/{id}/results` | No |
|
|
14
|
+
| `company-search-pause` | `POST /desearch/companies/tasks/{id}/pause` | No |
|
|
15
|
+
| `company-search-resume` | `POST /desearch/companies/tasks/{id}/resume` | No |
|
|
16
|
+
| `company-search-cancel` | `POST /desearch/companies/tasks/{id}/cancel` | No |
|
|
17
|
+
| `company-search-tasks` | `GET /desearch/companies/tasks` | No |
|
|
18
|
+
|
|
19
|
+
- `company-search` takes `query`, `count`, `min_score`, `exclude` (domains or URLs), `countries` and `require` (sent as `filters.countries` and `filters.require`), `roles`, `infer_emails`, `verify_emails`, `metadata`, and `idempotency_key`. `company-enrich` takes `domains` (1-200), `roles`, `infer_emails`, `verify_emails`, `metadata`, and `idempotency_key`. Only the arguments the caller set are sent. `idempotency_key` is sent as `Idempotency-Key`; a replay is returned with `existing_task: true` and is not charged again. Metadata labels follow the People Search rules and are checked before the billed call.
|
|
20
|
+
- `company-search-status` returns compact companies: domain, name, url, industry, location, a short description, `score` (always present; `null` for Company Enrich), `why`, up to three `reasons`, `fully_verified` and `unverified_criteria` (Company Search), `primary_email`, `primary_contact`, `contact_coverage`, emails, phones, and socials with their `source_url`, leaders with `roles`, `title`, `verified`, LinkedIn profile, and emails (each email with its `verification` status, and inferred ones with `confidence` and `pattern`), and `enrichment` (`status` and `stages`). Its page size defaults to 10 (max 100).
|
|
21
|
+
- The `next` hint understands results that fill in place: it says to read again without `cursor` while the task is `enriching`, to read once more without `cursor` after the task ends when companies were read while it ran, and how many companies on the page stayed `partial` when a task ended before every stage ran. Completed tasks name `all_domains_processed`, a budget stop, `no_candidates`, and `zero_qualified`.
|
|
22
|
+
- `company-search-tasks` filters by `type` (`search` or `enrich`), `status`, and up to 3 `metadata` pairs. Task summaries keep `search_type` (`company_search` or `company_enrich`), `completion_reason`, `coverage_limited: true` when a budget stopped the task before `count`, and `warnings` with their `code` and `message`.
|
|
23
|
+
- Pause, resume, and cancel take only `task_id`; a 409 is returned as a tool error with the API detail and the task's status. Errors are titled `Company Search error`, `Company Enrich error`, `Company Search Status error`, `Company Search Pause error`, `Company Search Resume error`, `Company Search Cancel error`, and `Company Search Tasks error`.
|
|
24
|
+
- Company tools reject unknown arguments, so a nested `filters` object or a misspelled argument is not dropped from a billed task.
|
|
25
|
+
- The `GET /desearch/companies/tasks/{id}/export` CSV and JSON Lines route is not a tool, like People Search's export routes.
|
|
26
|
+
- Annotations follow People Search: `company-search` and `company-enrich` set `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`; `company-search-status` and `company-search-tasks` set `readOnlyHint: true`, `destructiveHint: false`; `company-search-pause` and `company-search-resume` set `destructiveHint: false`, `idempotentHint: true`; `company-search-cancel` sets `destructiveHint: true`, `idempotentHint: true`. `openWorldHint` is `true` on every tool.
|
|
27
|
+
- The server instructions, README, `docs/API_MCP_PARITY.md`, `llms-install.md`, `GEMINI.md`, the plugin skill, and the manifest descriptions mention Company Search. The server lists 31 tools.
|
|
28
|
+
|
|
29
|
+
## 0.5.0
|
|
30
|
+
|
|
31
|
+
- `extract` and `web-crawl` accept `format: "markdown"` (headings, lists, tables and code). `full_page` is described as `text`-only.
|
|
32
|
+
|
|
33
|
+
## 0.4.0
|
|
4
34
|
|
|
5
35
|
- `extract` and `web-crawl` take `full_page` (boolean). With `format: "text"` it returns all visible text of the page, every section, table and notice, instead of only the main content. The `extract` description says what the `js_required` and `blocked` errors mean.
|
|
6
36
|
|
package/README.md
CHANGED
|
@@ -51,13 +51,13 @@ Example output:
|
|
|
51
51
|
|
|
52
52
|
The tool returns that JSON as pretty-printed text: `{ "content": [{ "type": "text", "text": "<json above>" }] }`.
|
|
53
53
|
|
|
54
|
-
AI search, X search and web search for AI agents, plus page extraction, X data tools,
|
|
54
|
+
AI search, X search and web search for AI agents, plus page extraction, X data tools, 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.
|
|
55
55
|
|
|
56
56
|
## Tools
|
|
57
57
|
|
|
58
58
|
The Desearch MCP server includes the following tools.
|
|
59
59
|
|
|
60
|
-
Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `people-search-status`, `people-search-tasks`, and `people-profiles` 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. `openWorldHint` is true on every tool because the call reaches a live external source.
|
|
60
|
+
Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `people-search-status`, `people-search-tasks`, and `people-profiles` 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
61
|
|
|
62
62
|
- **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
63
|
- **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`.
|
|
@@ -65,7 +65,7 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
|
|
|
65
65
|
- **Fetch Page** (`fetch`): Read a public page as text. Argument: `id` (required, an `http` or `https` URL from `search`).
|
|
66
66
|
- **Web Search** (`web-search`): SERP-style web search. Arguments: `query` (required), `start` (optional pagination offset).
|
|
67
67
|
- **Web Links Search** (`web-links-search`): Web link search. Arguments: `prompt` (required), `tools` (optional, only `web`, default `["web"]`; `Web Search` is accepted and rewritten to `web`), `count` (optional, 10–200). The links/web API rejects other sources, so they are not in the enum.
|
|
68
|
-
- **Extract** (`extract`): Read a public URL as text or HTML. Preferred over crawl. Arguments: `url` (required), `format` (optional, `
|
|
68
|
+
- **Extract** (`extract`): Read a public URL as text or HTML. Preferred over crawl. Arguments: `url` (required), `format` (optional, `text`, `markdown` or `html`), `js` (optional), `wait` (optional milliseconds), `full_page` (optional, `text` only: every visible section of the page instead of its main content). Errors carry an `error_code`: `js_required` (retry with `js: true`), `blocked` (the site refused or showed a bot check), `page_not_found`.
|
|
69
69
|
- **Web Crawl** (`web-crawl`): Same arguments as `extract`, on the legacy `/web/crawl` route. The SDK marks `webCrawl` deprecated in favor of `extract`; this tool stays so that route remains reachable. Prefer `extract` for new integrations.
|
|
70
70
|
- **X Links Search** (`x-links-search`): AI search for X post links. Arguments: `prompt` (required), `count` (optional, 10–200).
|
|
71
71
|
- **X Posts By URLs** (`x-posts-by-urls`): Full posts for a list of URLs. Argument: `urls` (required).
|
|
@@ -83,8 +83,15 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
|
|
|
83
83
|
- **Cancel People Search** (`people-search-cancel`): Stop a task for good. You pay only for the people it already delivered; the rest of the reservation is returned. Cannot be undone. Argument: `task_id` (required). Free.
|
|
84
84
|
- **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.
|
|
85
85
|
- **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.
|
|
86
|
+
- **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.
|
|
87
|
+
- **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.
|
|
88
|
+
- **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.
|
|
89
|
+
- **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.
|
|
90
|
+
- **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.
|
|
91
|
+
- **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.
|
|
92
|
+
- **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.
|
|
86
93
|
|
|
87
|
-
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
|
|
94
|
+
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 and Company Search are not in `desearch-js` 1.5; their tools call the `/desearch/people/*` and `/desearch/companies/*` routes directly, and the parity doc lists them too.
|
|
88
95
|
|
|
89
96
|
### People Search
|
|
90
97
|
|
|
@@ -213,6 +220,145 @@ When the search has ended, the task also says why and how complete it is, and ea
|
|
|
213
220
|
- `warnings` lists what made part of the search less reliable. `partial_enrichment`: `failed` of `attempted` profiles could not be read after search, so those people were scored on the search hit and show `enrichment: "failed"` with `enrichment_error`.
|
|
214
221
|
- `fully_verified` is `true` when every criterion is confirmed by the person's own profile or posts. `unverified_criteria` lists up to five that are not: `(unknown)`, `(not met)`, or a disqualifier that `(applies)`. Both are information only: the person still qualified. Results scored before 2026-10-20 have neither.
|
|
215
222
|
|
|
223
|
+
### Company Search
|
|
224
|
+
|
|
225
|
+
Company Search finds companies on the web that match a plain-language description. Company Enrich starts from domains you send. Both collect each company's public contact data: emails, phones, social profiles, and its leaders (`roles`: CEO, founders, CTO, and CFO by default) with their LinkedIn profiles and emails. Every contact keeps the page it came from (`source_url`). Company Search also scores how well each company fits (0–100); Company Enrich has no score (`score: null`).
|
|
226
|
+
|
|
227
|
+
A task runs in the background, like a People Search:
|
|
228
|
+
|
|
229
|
+
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.
|
|
230
|
+
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.
|
|
231
|
+
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`.
|
|
232
|
+
|
|
233
|
+
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.
|
|
234
|
+
|
|
235
|
+
`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.
|
|
236
|
+
|
|
237
|
+
Prompt: find 25 Series A fintech startups in Berlin with a leader's email.
|
|
238
|
+
|
|
239
|
+
```json
|
|
240
|
+
{
|
|
241
|
+
"name": "company-search",
|
|
242
|
+
"arguments": {
|
|
243
|
+
"query": "Series A fintech startups in Berlin building payment infrastructure",
|
|
244
|
+
"count": 25,
|
|
245
|
+
"countries": ["DE"],
|
|
246
|
+
"require": ["leader_email"]
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Then poll with `{"task_id": "5b33f3ee-168b-4780-9c8e-63a626781872"}` on `company-search-status`:
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"task_id": "5b33f3ee-168b-4780-9c8e-63a626781872",
|
|
256
|
+
"search_type": "company_search",
|
|
257
|
+
"status": "running",
|
|
258
|
+
"stage": "processing",
|
|
259
|
+
"done": false,
|
|
260
|
+
"query": "Series A fintech startups in Berlin building payment infrastructure",
|
|
261
|
+
"count": 25,
|
|
262
|
+
"result_count": 3,
|
|
263
|
+
"progress": {
|
|
264
|
+
"candidates_found": 140,
|
|
265
|
+
"candidates_processed": 60,
|
|
266
|
+
"qualified": 3,
|
|
267
|
+
"filtered": { "not_a_company": 9, "below_min_score": 3 },
|
|
268
|
+
"enrichment": { "published": 3, "complete": 1, "pending": 2, "failed": 0 },
|
|
269
|
+
"email_checks": { "checked": 6, "valid": 3, "invalid": 1, "risky": 1, "unknown": 1 }
|
|
270
|
+
},
|
|
271
|
+
"reserved_cost_usd": 2.25,
|
|
272
|
+
"created_at": "2026-10-28T10:00:00Z",
|
|
273
|
+
"companies": [
|
|
274
|
+
{
|
|
275
|
+
"domain": "example.com",
|
|
276
|
+
"name": "Example Payments",
|
|
277
|
+
"url": "https://example.com/",
|
|
278
|
+
"industry": "Fintech",
|
|
279
|
+
"location": { "country": "DE", "city": "Berlin" },
|
|
280
|
+
"description": "Payment infrastructure for marketplaces.",
|
|
281
|
+
"score": 86,
|
|
282
|
+
"why": "Berlin payments infrastructure startup, Series A in 2025.",
|
|
283
|
+
"reasons": ["Payments infrastructure for marketplaces", "Based in Berlin"],
|
|
284
|
+
"fully_verified": false,
|
|
285
|
+
"unverified_criteria": ["Stage: Series A (unknown)"],
|
|
286
|
+
"primary_email": {
|
|
287
|
+
"value": "anna.schmidt@example.com",
|
|
288
|
+
"type": "personal",
|
|
289
|
+
"source": "inferred",
|
|
290
|
+
"person": "Anna Schmidt",
|
|
291
|
+
"confidence": "high",
|
|
292
|
+
"pattern": "first.last",
|
|
293
|
+
"verification": "valid"
|
|
294
|
+
},
|
|
295
|
+
"primary_contact": {
|
|
296
|
+
"name": "Anna Schmidt",
|
|
297
|
+
"title": "Co-founder & CEO",
|
|
298
|
+
"email": "anna.schmidt@example.com",
|
|
299
|
+
"linkedin_url": "https://www.linkedin.com/in/example-anna",
|
|
300
|
+
"reason": "CEO, email inferred from the company's pattern and verified"
|
|
301
|
+
},
|
|
302
|
+
"contact_coverage": { "email": true, "phone": true, "linkedin": true, "leader": true, "leader_email": true },
|
|
303
|
+
"emails": [
|
|
304
|
+
{
|
|
305
|
+
"value": "hello@example.com",
|
|
306
|
+
"type": "general",
|
|
307
|
+
"source": "website",
|
|
308
|
+
"source_url": "https://example.com/impressum",
|
|
309
|
+
"verification": "valid"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"phones": [{ "value": "+493012345678", "type": "main", "source_url": "https://example.com/impressum" }],
|
|
313
|
+
"socials": [
|
|
314
|
+
{
|
|
315
|
+
"type": "linkedin",
|
|
316
|
+
"url": "https://www.linkedin.com/company/example-payments",
|
|
317
|
+
"source_url": "https://example.com/"
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"leaders": [
|
|
321
|
+
{
|
|
322
|
+
"name": "Anna Schmidt",
|
|
323
|
+
"title": "Co-founder & CEO",
|
|
324
|
+
"roles": ["ceo", "founder"],
|
|
325
|
+
"verified": true,
|
|
326
|
+
"linkedin_url": "https://www.linkedin.com/in/example-anna",
|
|
327
|
+
"emails": [
|
|
328
|
+
{
|
|
329
|
+
"value": "anna.schmidt@example.com",
|
|
330
|
+
"type": "personal",
|
|
331
|
+
"source": "inferred",
|
|
332
|
+
"confidence": "high",
|
|
333
|
+
"pattern": "first.last",
|
|
334
|
+
"verification": "valid"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"evidence_url": "https://example.com/impressum"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"enrichment": {
|
|
341
|
+
"status": "complete",
|
|
342
|
+
"stages": { "profile": "done", "contacts": "done", "people": "done", "email_patterns": "done", "email_check": "done" }
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
"next_cursor": "3",
|
|
347
|
+
"has_more": false,
|
|
348
|
+
"next": "Still running. Wait 15 to 30 seconds, then call company-search-status again with cursor \"3\" to get only the companies delivered since this call. Companies with enrichment status \"partial\" are still being filled in; when the task is done, call company-search-status without cursor to read every company in its latest version."
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
The output above is shortened to one company.
|
|
353
|
+
|
|
354
|
+
- `score` is the fit score (0–100) for Company Search and `null` for Company Enrich. `why` and up to three `reasons` say why it matched; `fully_verified` and `unverified_criteria` say what the company's own pages confirm (information only: the company still qualified).
|
|
355
|
+
- 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`.
|
|
356
|
+
- `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.
|
|
357
|
+
- 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).
|
|
358
|
+
- `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.
|
|
359
|
+
|
|
360
|
+
CSV and JSON Lines downloads (`GET /desearch/companies/tasks/{task_id}/export`) are not MCP tools; call the API directly for a file.
|
|
361
|
+
|
|
216
362
|
## Prerequisites 📋
|
|
217
363
|
|
|
218
364
|
- An [Desearch API Key](https://console.desearch.ai/api-keys)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type PeopleApiResponse, type PeopleControlAction, type QueryValue } from "./people.js";
|
|
2
|
+
/**
|
|
3
|
+
* Company Search and Company Enrich on the Desearch API (`/desearch/companies/*`).
|
|
4
|
+
*
|
|
5
|
+
* desearch-js 1.5 has no Company Search methods, so this module calls the routes
|
|
6
|
+
* directly with the same base URL, `Authorization: <key>` header, and
|
|
7
|
+
* `HTTP <status>: <detail>` error text as People Search (people.ts).
|
|
8
|
+
*
|
|
9
|
+
* - `POST /desearch/companies/search` finds companies from a description and
|
|
10
|
+
* `POST /desearch/companies/enrich` reads the domains you send. Both are billed:
|
|
11
|
+
* they reserve companies at the route price and settle to what they deliver.
|
|
12
|
+
* - Every other route (tasks, results, pause/resume/cancel) is free. Both kinds of task
|
|
13
|
+
* run on the People Search engine, but a People Search task_id is a 404 on these
|
|
14
|
+
* routes and a company task_id is a 404 on People Search's.
|
|
15
|
+
*
|
|
16
|
+
* A company is published once the stages its request needs have run
|
|
17
|
+
* (`enrichment.status: "partial"`); later stages (contacts, people, email_patterns,
|
|
18
|
+
* email_check) fill it in place until it is `complete`. A results cursor returns only
|
|
19
|
+
* companies delivered after it; reading without a cursor returns every company in its
|
|
20
|
+
* latest version.
|
|
21
|
+
*/
|
|
22
|
+
/** Statuses are People Search's (desearch-public-api model/people.py TaskStatus). */
|
|
23
|
+
export declare const COMPANY_TASK_STATUSES: readonly ["queued", "running", "pausing", "paused", "cancelling", "completed", "partial", "failed", "cancelled", "expired"];
|
|
24
|
+
/** `roles` (desearch-public-api model/companies.py Role). */
|
|
25
|
+
export declare const COMPANY_ROLES: readonly ["ceo", "founder", "cto", "cfo", "coo", "cmo", "president", "owner", "managing_director"];
|
|
26
|
+
export type CompanyRole = (typeof COMPANY_ROLES)[number];
|
|
27
|
+
/** `filters.require` (model/companies.py Requirement). */
|
|
28
|
+
export declare const COMPANY_REQUIREMENTS: readonly ["email", "phone", "linkedin", "leader", "leader_email"];
|
|
29
|
+
export type CompanyRequirement = (typeof COMPANY_REQUIREMENTS)[number];
|
|
30
|
+
/** `type` on `GET /desearch/companies/tasks` (routers/companies.py TYPE_SERVICES). */
|
|
31
|
+
export declare const COMPANY_TASK_TYPES: readonly ["search", "enrich"];
|
|
32
|
+
export type CompanyTaskType = (typeof COMPANY_TASK_TYPES)[number];
|
|
33
|
+
/** Request limits (model/companies.py, model/people.py). */
|
|
34
|
+
export declare const COMPANY_DOMAINS_MAX = 200;
|
|
35
|
+
export declare const COMPANY_COUNTRIES_MAX = 20;
|
|
36
|
+
export declare const COMPANY_EXCLUDE_MAX = 1000;
|
|
37
|
+
interface CompanyTaskOptions {
|
|
38
|
+
roles?: CompanyRole[];
|
|
39
|
+
infer_emails?: boolean;
|
|
40
|
+
verify_emails?: boolean;
|
|
41
|
+
metadata?: Record<string, string>;
|
|
42
|
+
idempotency_key?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface CompanySearchArgs extends CompanyTaskOptions {
|
|
45
|
+
query: string;
|
|
46
|
+
count?: number;
|
|
47
|
+
min_score?: number;
|
|
48
|
+
exclude?: string[];
|
|
49
|
+
countries?: string[];
|
|
50
|
+
require?: CompanyRequirement[];
|
|
51
|
+
}
|
|
52
|
+
export interface CompanyEnrichArgs extends CompanyTaskOptions {
|
|
53
|
+
domains: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface CompanyClient {
|
|
56
|
+
startSearch(body: Record<string, unknown>, idempotencyKey?: string): Promise<PeopleApiResponse>;
|
|
57
|
+
startEnrich(body: Record<string, unknown>, idempotencyKey?: string): Promise<PeopleApiResponse>;
|
|
58
|
+
getTask(taskId: string): Promise<unknown>;
|
|
59
|
+
getResults(taskId: string, params: {
|
|
60
|
+
cursor?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
}): Promise<unknown>;
|
|
63
|
+
controlTask(taskId: string, action: PeopleControlAction): Promise<unknown>;
|
|
64
|
+
listTasks(params: Record<string, QueryValue>): Promise<unknown>;
|
|
65
|
+
}
|
|
66
|
+
export declare function createCompanyClient(apiKey: string, baseUrl?: string): CompanyClient;
|
|
67
|
+
/**
|
|
68
|
+
* Request body for `POST /desearch/companies/search` (model/companies.py CompanySearchRequest).
|
|
69
|
+
* The tool takes `countries` and `require` as top-level arguments; they go in `filters`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function companySearchBody(args: CompanySearchArgs): Record<string, unknown>;
|
|
72
|
+
/** Request body for `POST /desearch/companies/enrich` (model/companies.py CompanyEnrichRequest). */
|
|
73
|
+
export declare function companyEnrichBody(args: CompanyEnrichArgs): Record<string, unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* One company as an agent needs it: what it is, how well it fits (Company Search; `score`
|
|
76
|
+
* is null for Company Enrich), how to reach it and its leaders, with the page each contact
|
|
77
|
+
* came from, and how far its enrichment has got.
|
|
78
|
+
*/
|
|
79
|
+
export declare function compactCompany(company: unknown): Record<string, unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Task fields an agent polls on. `progress` is the worker's counters, passed through
|
|
82
|
+
* without its copy of `warnings` (listed once, at the top). `completion_reason` appears
|
|
83
|
+
* once the task has ended, `coverage_limited` only when true.
|
|
84
|
+
*/
|
|
85
|
+
export declare function compactCompanyTask(task: unknown, options?: {
|
|
86
|
+
progress?: boolean;
|
|
87
|
+
}): Record<string, unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* One sentence (or two) on what to do next, so an agent does not have to infer it from the status.
|
|
90
|
+
* `nextCursor` is the results cursor when the caller just read a page of companies.
|
|
91
|
+
* `task` adds the stage (`enriching`) and why an ended task stopped.
|
|
92
|
+
* `page.partial` counts the companies on this page whose enrichment is still `partial`;
|
|
93
|
+
* `page.readAfterStart` is true when the caller passed a cursor, so it may hold older
|
|
94
|
+
* versions of companies it read before.
|
|
95
|
+
*/
|
|
96
|
+
export declare function companyNextStep(status: string | undefined, nextCursor?: string, hasMore?: boolean, task?: {
|
|
97
|
+
stage?: unknown;
|
|
98
|
+
completion_reason?: unknown;
|
|
99
|
+
coverage_limited?: unknown;
|
|
100
|
+
count?: unknown;
|
|
101
|
+
}, page?: {
|
|
102
|
+
partial?: number;
|
|
103
|
+
readAfterStart?: boolean;
|
|
104
|
+
}): string;
|
|
105
|
+
/** `company-search`: start a billed background Company Search and return the task to poll. */
|
|
106
|
+
export declare function startCompanySearch(client: CompanyClient, args: CompanySearchArgs): Promise<Record<string, unknown>>;
|
|
107
|
+
/** `company-enrich`: start a billed background Company Enrich and return the task to poll. */
|
|
108
|
+
export declare function startCompanyEnrich(client: CompanyClient, args: CompanyEnrichArgs): Promise<Record<string, unknown>>;
|
|
109
|
+
/** `company-search-status`: task status and progress, plus a page of companies when there are any. */
|
|
110
|
+
export declare function readCompanyStatus(client: CompanyClient, args: {
|
|
111
|
+
task_id: string;
|
|
112
|
+
cursor?: string;
|
|
113
|
+
limit?: number;
|
|
114
|
+
include_companies?: boolean;
|
|
115
|
+
}): Promise<Record<string, unknown>>;
|
|
116
|
+
/** `company-search-pause`, `company-search-resume`, `company-search-cancel`: change a task's state. */
|
|
117
|
+
export declare function controlCompanyTask(client: CompanyClient, args: {
|
|
118
|
+
task_id: string;
|
|
119
|
+
action: PeopleControlAction;
|
|
120
|
+
}): Promise<Record<string, unknown>>;
|
|
121
|
+
/** `company-search-tasks`: the caller's Company Search and Company Enrich tasks, newest first. */
|
|
122
|
+
export declare function listCompanyTasks(client: CompanyClient, args: {
|
|
123
|
+
type?: CompanyTaskType;
|
|
124
|
+
status?: string[];
|
|
125
|
+
limit?: number;
|
|
126
|
+
cursor?: string;
|
|
127
|
+
metadata?: Record<string, string>;
|
|
128
|
+
}): Promise<Record<string, unknown>>;
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=companies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAYH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAClB,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,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