desearch-mcp-server 0.3.1 → 0.3.2

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+
5
+ People Search summaries show the result fields the API returns since 2026-10-20.
6
+
7
+ - Task summaries (`people-search`, `people-search-status`, `people-search-control`, `people-search-tasks`) carry `completion_reason` once the search has ended, `coverage_limited: true` when a budget stopped it before `count`, and `warnings`. A `partial_enrichment` warning keeps `code`, `platform`, `attempted`, `failed`, and `by_reason`, without the long message; a warning code this server does not know keeps its `message`.
8
+ - The `next` hint of a completed search says when a budget stopped it early, when its searches found nobody (`no_candidates`), and when nobody fit (`zero_qualified`).
9
+ - Each person carries `fully_verified` and `unverified_criteria`: up to five criteria their own profile or posts do not confirm, labelled `(unknown)`, `(not met)`, or `(applies)` for a disqualifier that applies. It follows the rule of the API's CSV `unverified_criteria` column. A person whose profile could not be read after search carries `enrichment: "failed"` and `enrichment_error`.
10
+ - The `people-search-status` and `people-search-tasks` descriptions mention these fields.
11
+
3
12
  ## 0.3.1
4
13
 
5
14
  - `x-search` filters `min_retweets`, `min_replies`, and `min_likes` are integers in the tool input schema. Each property has its own JSON Schema `type`.
package/README.md CHANGED
@@ -181,6 +181,36 @@ Then poll with `{"task_id": "3f1c2b9e-8d4a-4c1e-9b7a-2e5f6a7b8c9d"}` on `people-
181
181
 
182
182
  The output above is shortened to one person. CSV and JSON Lines downloads (`/export` routes) are not MCP tools; call the API directly for a file.
183
183
 
184
+ When the search has ended, the task also says why and how complete it is, and each person says what their own profile confirms (0.3.2 and later):
185
+
186
+ ```json
187
+ {
188
+ "status": "completed",
189
+ "done": true,
190
+ "completion_reason": "cost_limit",
191
+ "coverage_limited": true,
192
+ "warnings": [
193
+ { "code": "partial_enrichment", "platform": "linkedin", "attempted": 20, "failed": 7, "by_reason": { "not_found": 7 } }
194
+ ],
195
+ "people": [
196
+ {
197
+ "handle": "example_engineer",
198
+ "score": 74,
199
+ "fully_verified": false,
200
+ "unverified_criteria": ["Profile fit: Software Engineer based in Georgia (unknown)"],
201
+ "enrichment": "failed",
202
+ "enrichment_error": "not_found"
203
+ }
204
+ ],
205
+ "next": "Finished early: a budget stopped it (cost_limit) before it found 10 people, so more people may match. You have every person it found."
206
+ }
207
+ ```
208
+
209
+ - `completion_reason` is one of `count_reached`, `rounds_exhausted`, `no_candidates`, `zero_qualified`, `candidate_budget`, `cost_limit`, `time_limit`, `cancelled`, or `failed`. It is left out while the search runs.
210
+ - `coverage_limited` appears (as `true`) only when a budget stopped the search before it found `count` people. The status is still `completed`.
211
+ - `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`.
212
+ - `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.
213
+
184
214
  ## Prerequisites 📋
185
215
 
186
216
  - An [Desearch API Key](https://console.desearch.ai/api-keys)
package/build/people.d.ts CHANGED
@@ -81,20 +81,34 @@ export declare function createPeopleClient(apiKey: string, baseUrl?: string): Pe
81
81
  * Throws when a filter does not apply to the platform, so no billed call is made.
82
82
  */
83
83
  export declare function peopleSearchBody(args: PeopleSearchArgs): Record<string, unknown>;
84
+ /**
85
+ * The criteria a person's own profile and posts do not confirm, as short strings:
86
+ * a criterion that is not met ("(unknown)" or "(not met)"), or a disqualifier that
87
+ * applies ("(applies)"). Empty for results scored before criteria checks existed.
88
+ */
89
+ export declare function unverifiedCriteria(score: unknown): string[];
84
90
  /**
85
91
  * One person as an agent needs it: who they are, how big their audience is,
86
- * how well they fit and why, and how to reach them.
92
+ * how well they fit and why, what their profile does not confirm, and how to reach them.
87
93
  */
88
94
  export declare function compactPerson(person: unknown): Record<string, unknown>;
89
- /** Task fields an agent polls on. `progress` is the worker's counters, passed through. */
95
+ /**
96
+ * Task fields an agent polls on. `progress` is the worker's counters, passed through.
97
+ * `completion_reason` appears once the task has ended, `coverage_limited` only when true.
98
+ */
90
99
  export declare function compactTask(task: unknown, options?: {
91
100
  progress?: boolean;
92
101
  }): Record<string, unknown>;
93
102
  /**
94
103
  * One sentence on what to do next, so an agent does not have to infer it from the status.
95
104
  * `nextCursor` is the results cursor when the caller just read a page of people.
105
+ * `task` adds why a completed search ended (`completion_reason`, `coverage_limited`).
96
106
  */
97
- export declare function peopleNextStep(status: string | undefined, nextCursor?: string, hasMore?: boolean): string;
107
+ export declare function peopleNextStep(status: string | undefined, nextCursor?: string, hasMore?: boolean, task?: {
108
+ completion_reason?: unknown;
109
+ coverage_limited?: unknown;
110
+ count?: unknown;
111
+ }): string;
98
112
  /** `people-search`: start a billed background search and return the task to poll. */
99
113
  export declare function startPeopleSearch(client: PeopleClient, args: PeopleSearchArgs): Promise<Record<string, unknown>>;
100
114
  /** `people-search-status`: task status and progress, plus a page of people when there are any. */
@@ -1 +1 @@
1
- {"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../people.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D,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;AACzD,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAMpD,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,kFAQzB,CAAC;AAEX,eAAO,MAAM,oBAAoB,0CAA2C,CAAC;AAE7E,eAAO,MAAM,sBAAsB,wCAAyC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B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AC,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,+EAA+E;AAC/E,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqBlC"}
package/build/people.js CHANGED
@@ -221,9 +221,37 @@ function numberOf(value) {
221
221
  function stringOf(value) {
222
222
  return typeof value === "string" && value.trim() !== "" ? value : undefined;
223
223
  }
224
+ // Same rule as the API's CSV `unverified_criteria` column (desearch-public-api
225
+ // src/routers/people.py) and the console: a criterion naming a disqualifier.
226
+ const DISQUALIFIER_CRITERION = /\b(disqualif(?:y|ier|iers)|exclude|excluding|not a fit|not qualified)\b/i;
227
+ const MAX_UNVERIFIED = 5;
228
+ const MAX_CRITERION_CHARS = 120;
229
+ /**
230
+ * The criteria a person's own profile and posts do not confirm, as short strings:
231
+ * a criterion that is not met ("(unknown)" or "(not met)"), or a disqualifier that
232
+ * applies ("(applies)"). Empty for results scored before criteria checks existed.
233
+ */
234
+ export function unverifiedCriteria(score) {
235
+ const out = [];
236
+ for (const check of arrayOf(objectOf(score).criteria_checks).map(objectOf)) {
237
+ const criterion = stringOf(check.criterion);
238
+ if (!criterion)
239
+ continue;
240
+ const met = check.verdict === "met";
241
+ const disqualifier = DISQUALIFIER_CRITERION.test(criterion);
242
+ if (met !== disqualifier)
243
+ continue;
244
+ const label = disqualifier ? "applies" : check.verdict === "not_met" ? "not met" : "unknown";
245
+ const text = criterion.length > MAX_CRITERION_CHARS ? `${criterion.slice(0, MAX_CRITERION_CHARS - 3)}...` : criterion;
246
+ out.push(`${text} (${label})`);
247
+ }
248
+ return out.length > MAX_UNVERIFIED
249
+ ? [...out.slice(0, MAX_UNVERIFIED), `and ${out.length - MAX_UNVERIFIED} more`]
250
+ : out;
251
+ }
224
252
  /**
225
253
  * One person as an agent needs it: who they are, how big their audience is,
226
- * how well they fit and why, and how to reach them.
254
+ * how well they fit and why, what their profile does not confirm, and how to reach them.
227
255
  */
228
256
  export function compactPerson(person) {
229
257
  const p = objectOf(person);
@@ -246,6 +274,11 @@ export function compactPerson(person) {
246
274
  score: numberOf(score.value),
247
275
  why: stringOf(score.summary),
248
276
  reasons: arrayOf(score.reasons).filter((r) => typeof r === "string").slice(0, 3),
277
+ fully_verified: typeof score.fully_verified === "boolean" ? score.fully_verified : undefined,
278
+ unverified_criteria: unverifiedCriteria(score),
279
+ // Only when the profile could not be read after search: it was scored on the search hit.
280
+ enrichment: attributes.enrichment === "failed" ? "failed" : undefined,
281
+ enrichment_error: attributes.enrichment === "failed" ? stringOf(attributes.enrichment_error) : undefined,
249
282
  contacts: arrayOf(p.contacts)
250
283
  .map(objectOf)
251
284
  .filter((c) => stringOf(c.value))
@@ -265,7 +298,29 @@ export function compactPerson(person) {
265
298
  : undefined,
266
299
  });
267
300
  }
268
- /** Task fields an agent polls on. `progress` is the worker's counters, passed through. */
301
+ /** Warning codes this server knows; another code keeps the API's message. */
302
+ const KNOWN_WARNING_CODES = new Set(["partial_enrichment"]);
303
+ /**
304
+ * A task warning without its long message: `partial_enrichment` means `failed` of
305
+ * `attempted` profile lookups could not be read, so those people were scored on the
306
+ * search hit (`by_reason` says why).
307
+ */
308
+ function compactWarning(warning) {
309
+ const w = objectOf(warning);
310
+ const code = stringOf(w.code);
311
+ return compact({
312
+ code,
313
+ platform: w.platform,
314
+ attempted: numberOf(w.attempted),
315
+ failed: numberOf(w.failed),
316
+ by_reason: isPlainObject(w.by_reason) ? w.by_reason : undefined,
317
+ message: code && KNOWN_WARNING_CODES.has(code) ? undefined : stringOf(w.message),
318
+ });
319
+ }
320
+ /**
321
+ * Task fields an agent polls on. `progress` is the worker's counters, passed through.
322
+ * `completion_reason` appears once the task has ended, `coverage_limited` only when true.
323
+ */
269
324
  export function compactTask(task, options = {}) {
270
325
  const t = objectOf(task);
271
326
  const status = typeof t.status === "string" ? t.status : undefined;
@@ -279,6 +334,9 @@ export function compactTask(task, options = {}) {
279
334
  metadata: t.metadata,
280
335
  count: t.count,
281
336
  result_count: t.result_count,
337
+ completion_reason: stringOf(t.completion_reason),
338
+ coverage_limited: t.coverage_limited === true ? true : undefined,
339
+ warnings: arrayOf(t.warnings).map(compactWarning),
282
340
  progress: options.progress ? t.progress : undefined,
283
341
  errors: options.progress ? t.errors : undefined,
284
342
  reserved_cost_usd: t.reserved_cost_usd,
@@ -292,8 +350,9 @@ export function compactTask(task, options = {}) {
292
350
  /**
293
351
  * One sentence on what to do next, so an agent does not have to infer it from the status.
294
352
  * `nextCursor` is the results cursor when the caller just read a page of people.
353
+ * `task` adds why a completed search ended (`completion_reason`, `coverage_limited`).
295
354
  */
296
- export function peopleNextStep(status, nextCursor, hasMore = false) {
355
+ export function peopleNextStep(status, nextCursor, hasMore = false, task = {}) {
297
356
  const again = nextCursor === undefined
298
357
  ? "people-search-status again"
299
358
  : `people-search-status again with cursor "${nextCursor}"`;
@@ -313,6 +372,16 @@ export function peopleNextStep(status, nextCursor, hasMore = false) {
313
372
  case "cancelling":
314
373
  return "Cancelling. Call people-search-status again to read the final status.";
315
374
  case "completed":
375
+ if (task.coverage_limited === true) {
376
+ const wanted = typeof task.count === "number" ? `${task.count} people` : "the count you asked for";
377
+ return `Finished early: a budget stopped it (${String(task.completion_reason)}) before it found ${wanted}, so more people may match. You have every person it found.`;
378
+ }
379
+ if (task.completion_reason === "no_candidates") {
380
+ return "Finished: its searches found nobody to check. Try a broader description.";
381
+ }
382
+ if (task.completion_reason === "zero_qualified") {
383
+ return "Finished: it checked the people its searches found and none fit. Try a broader description.";
384
+ }
316
385
  return "Finished. You have every person this search found.";
317
386
  case "partial":
318
387
  return "Finished with partial results: some searches failed. You have every person it found.";
@@ -351,7 +420,7 @@ export async function readPeopleStatus(client, args) {
351
420
  const status = typeof summary.status === "string" ? summary.status : undefined;
352
421
  const includePeople = args.include_people !== false;
353
422
  if (!includePeople) {
354
- return { ...summary, next: peopleNextStep(status) };
423
+ return { ...summary, next: peopleNextStep(status, undefined, false, summary) };
355
424
  }
356
425
  let nextCursor = args.cursor ?? "0";
357
426
  let hasMore = false;
@@ -369,14 +438,14 @@ export async function readPeopleStatus(client, args) {
369
438
  people,
370
439
  next_cursor: nextCursor,
371
440
  has_more: hasMore,
372
- next: peopleNextStep(status, nextCursor, hasMore),
441
+ next: peopleNextStep(status, nextCursor, hasMore, summary),
373
442
  };
374
443
  }
375
444
  /** `people-search-control`: pause, resume, or cancel a task. */
376
445
  export async function controlPeopleTask(client, args) {
377
446
  const task = compactTask(await client.controlTask(args.task_id, args.action));
378
447
  const status = typeof task.status === "string" ? task.status : undefined;
379
- return { ...task, next: peopleNextStep(status) };
448
+ return { ...task, next: peopleNextStep(status, undefined, false, task) };
380
449
  }
381
450
  /** `people-search-tasks`: the caller's tasks, newest first. */
382
451
  export async function listPeopleTasks(client, args) {
package/build/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type PeopleClient } from "./people.js";
3
3
  export declare const SERVER_NAME = "Desearch";
4
- export declare const SERVER_VERSION = "0.3.1";
4
+ export declare const SERVER_VERSION = "0.3.2";
5
5
  interface XSearchPayload {
6
6
  query: string;
7
7
  sort?: "Top" | "Latest";
package/build/server.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { PEOPLE_CONTROL_ACTIONS, 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, createPeopleClient, listPeopleProfiles, listPeopleTasks, readPeopleStatus, startPeopleSearch, } from "./people.js";
6
6
  import { AI_SEARCH_TOOLS, WEB_LINK_TOOLS, toolIdSchema } from "./tool-sources.js";
7
7
  export const SERVER_NAME = "Desearch";
8
- export const SERVER_VERSION = "0.3.1";
8
+ export const SERVER_VERSION = "0.3.2";
9
9
  // desearch-js 1.5 publishes a default class. Node16 resolution types that package
10
10
  // as a module namespace, so the constructor is applied through a cast.
11
11
  const Desearch = DesearchImport;
@@ -734,7 +734,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
734
734
  return fail("People Search error", error);
735
735
  }
736
736
  }, undefined, BILLED_TASK);
737
- registerTool(server, apiKey, "people-search-status", "Get People Search Status", "Status, progress, and cost of one People Search task, plus a page of the people found so far: name, handle, url, platform, audience, location, fit score, why they matched, contacts, and links. Free. People arrive while the search runs: pass the returned next_cursor as cursor on the next call to get only the people found since then. When done is true and has_more is false you have everyone the search found.", strictArgs({
737
+ registerTool(server, apiKey, "people-search-status", "Get People Search Status", "Status, progress, and cost of one People Search task, plus a page of the people found so far: name, handle, url, platform, audience, location, fit score, why they matched, contacts, and links. Free. People arrive while the search runs: pass the returned next_cursor as cursor on the next call to get only the people found since then. When done is true and has_more is false you have everyone the search found. An ended task has completion_reason (why it stopped), coverage_limited: true when a budget stopped it before count (more people may match), and warnings such as partial_enrichment (some profiles could not be read, so those people were scored on the search hit; they show enrichment: failed). Each person has fully_verified (every criterion confirmed by their own profile or posts) and unverified_criteria (criteria that are unknown or not met, or a disqualifier that applies). These are information only: the person still qualified.", strictArgs({
738
738
  task_id: peopleTaskId,
739
739
  cursor: z
740
740
  .string()
@@ -773,7 +773,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
773
773
  return fail("People Search Control error", error);
774
774
  }
775
775
  }, undefined, TASK_CONTROL);
776
- registerTool(server, apiKey, "people-search-tasks", "List People Search Tasks", "Your People Search tasks, newest first, with status, counts, cost, and the metadata labels set on people-search. Free. Use it to find a task_id (filter by metadata to find the searches of one campaign), or to see which searches are still queued, running, or paused: a new search is refused while too many are active.", strictArgs({
776
+ registerTool(server, apiKey, "people-search-tasks", "List People Search Tasks", "Your People Search tasks, newest first, with status, counts, cost, why each ended search stopped (completion_reason, coverage_limited), and the metadata labels set on people-search. Free. Use it to find a task_id (filter by metadata to find the searches of one campaign), or to see which searches are still queued, running, or paused: a new search is refused while too many are active.", strictArgs({
777
777
  platform: peoplePlatform.optional().describe("Only tasks on this platform: 'x', 'youtube', 'linkedin', or 'tiktok'."),
778
778
  status: z
779
779
  .array(z.enum(PEOPLE_TASK_STATUSES))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desearch-mcp-server",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "mcpName": "io.github.Desearch-ai/mcp-desearch",
5
5
  "description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, page extraction, X data, and People Search (find people and creators on X, YouTube, LinkedIn, and TikTok) tools for AI agents.",
6
6
  "license": "MIT",