desearch-mcp-server 0.3.1 → 0.3.3
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 +13 -0
- package/README.md +30 -0
- package/build/people.d.ts +17 -3
- package/build/people.d.ts.map +1 -1
- package/build/people.js +78 -6
- package/build/server.d.ts +1 -1
- package/build/server.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
- `unverified_criteria` reads each check's `is_disqualifier`, which the API returns since 2026-10-20, and falls back to the keyword rule for checks scored before it, like the API's CSV `unverified_criteria` column.
|
|
6
|
+
|
|
7
|
+
## 0.3.2
|
|
8
|
+
|
|
9
|
+
People Search summaries show the result fields the API returns since 2026-10-20.
|
|
10
|
+
|
|
11
|
+
- 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`.
|
|
12
|
+
- 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`).
|
|
13
|
+
- 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`.
|
|
14
|
+
- The `people-search-status` and `people-search-tasks` descriptions mention these fields.
|
|
15
|
+
|
|
3
16
|
## 0.3.1
|
|
4
17
|
|
|
5
18
|
- `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
|
-
/**
|
|
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
|
|
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. */
|
package/build/people.d.ts.map
CHANGED
|
@@ -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,wBAAwB,CAAC;AACjE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;CAY4B,CAAC;AAE/D,eAAO,MAAM,0BAA0B,oKAU7B,CAAC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AE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,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,40 @@ function numberOf(value) {
|
|
|
221
221
|
function stringOf(value) {
|
|
222
222
|
return typeof value === "string" && value.trim() !== "" ? value : undefined;
|
|
223
223
|
}
|
|
224
|
+
// A check's `is_disqualifier` says whether it is a disqualifier. Checks scored before the
|
|
225
|
+
// flag existed fall back to the worker's keyword rule, which also sets the flag; the API's
|
|
226
|
+
// CSV `unverified_criteria` column (desearch-public-api src/utils/people_criteria.py) does the same.
|
|
227
|
+
const DISQUALIFIER_CRITERION = /\b(disqualif(?:y|ier|iers)|exclude|excluding|not a fit|not qualified)\b/i;
|
|
228
|
+
const MAX_UNVERIFIED = 5;
|
|
229
|
+
const MAX_CRITERION_CHARS = 120;
|
|
230
|
+
/**
|
|
231
|
+
* The criteria a person's own profile and posts do not confirm, as short strings:
|
|
232
|
+
* a criterion that is not met ("(unknown)" or "(not met)"), or a disqualifier that
|
|
233
|
+
* applies ("(applies)"). Empty for results scored before criteria checks existed.
|
|
234
|
+
*/
|
|
235
|
+
export function unverifiedCriteria(score) {
|
|
236
|
+
const out = [];
|
|
237
|
+
for (const check of arrayOf(objectOf(score).criteria_checks).map(objectOf)) {
|
|
238
|
+
const criterion = stringOf(check.criterion);
|
|
239
|
+
if (!criterion)
|
|
240
|
+
continue;
|
|
241
|
+
const met = check.verdict === "met";
|
|
242
|
+
const disqualifier = typeof check.is_disqualifier === "boolean"
|
|
243
|
+
? check.is_disqualifier
|
|
244
|
+
: DISQUALIFIER_CRITERION.test(criterion);
|
|
245
|
+
if (met !== disqualifier)
|
|
246
|
+
continue;
|
|
247
|
+
const label = disqualifier ? "applies" : check.verdict === "not_met" ? "not met" : "unknown";
|
|
248
|
+
const text = criterion.length > MAX_CRITERION_CHARS ? `${criterion.slice(0, MAX_CRITERION_CHARS - 3)}...` : criterion;
|
|
249
|
+
out.push(`${text} (${label})`);
|
|
250
|
+
}
|
|
251
|
+
return out.length > MAX_UNVERIFIED
|
|
252
|
+
? [...out.slice(0, MAX_UNVERIFIED), `and ${out.length - MAX_UNVERIFIED} more`]
|
|
253
|
+
: out;
|
|
254
|
+
}
|
|
224
255
|
/**
|
|
225
256
|
* 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.
|
|
257
|
+
* how well they fit and why, what their profile does not confirm, and how to reach them.
|
|
227
258
|
*/
|
|
228
259
|
export function compactPerson(person) {
|
|
229
260
|
const p = objectOf(person);
|
|
@@ -246,6 +277,11 @@ export function compactPerson(person) {
|
|
|
246
277
|
score: numberOf(score.value),
|
|
247
278
|
why: stringOf(score.summary),
|
|
248
279
|
reasons: arrayOf(score.reasons).filter((r) => typeof r === "string").slice(0, 3),
|
|
280
|
+
fully_verified: typeof score.fully_verified === "boolean" ? score.fully_verified : undefined,
|
|
281
|
+
unverified_criteria: unverifiedCriteria(score),
|
|
282
|
+
// Only when the profile could not be read after search: it was scored on the search hit.
|
|
283
|
+
enrichment: attributes.enrichment === "failed" ? "failed" : undefined,
|
|
284
|
+
enrichment_error: attributes.enrichment === "failed" ? stringOf(attributes.enrichment_error) : undefined,
|
|
249
285
|
contacts: arrayOf(p.contacts)
|
|
250
286
|
.map(objectOf)
|
|
251
287
|
.filter((c) => stringOf(c.value))
|
|
@@ -265,7 +301,29 @@ export function compactPerson(person) {
|
|
|
265
301
|
: undefined,
|
|
266
302
|
});
|
|
267
303
|
}
|
|
268
|
-
/**
|
|
304
|
+
/** Warning codes this server knows; another code keeps the API's message. */
|
|
305
|
+
const KNOWN_WARNING_CODES = new Set(["partial_enrichment"]);
|
|
306
|
+
/**
|
|
307
|
+
* A task warning without its long message: `partial_enrichment` means `failed` of
|
|
308
|
+
* `attempted` profile lookups could not be read, so those people were scored on the
|
|
309
|
+
* search hit (`by_reason` says why).
|
|
310
|
+
*/
|
|
311
|
+
function compactWarning(warning) {
|
|
312
|
+
const w = objectOf(warning);
|
|
313
|
+
const code = stringOf(w.code);
|
|
314
|
+
return compact({
|
|
315
|
+
code,
|
|
316
|
+
platform: w.platform,
|
|
317
|
+
attempted: numberOf(w.attempted),
|
|
318
|
+
failed: numberOf(w.failed),
|
|
319
|
+
by_reason: isPlainObject(w.by_reason) ? w.by_reason : undefined,
|
|
320
|
+
message: code && KNOWN_WARNING_CODES.has(code) ? undefined : stringOf(w.message),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Task fields an agent polls on. `progress` is the worker's counters, passed through.
|
|
325
|
+
* `completion_reason` appears once the task has ended, `coverage_limited` only when true.
|
|
326
|
+
*/
|
|
269
327
|
export function compactTask(task, options = {}) {
|
|
270
328
|
const t = objectOf(task);
|
|
271
329
|
const status = typeof t.status === "string" ? t.status : undefined;
|
|
@@ -279,6 +337,9 @@ export function compactTask(task, options = {}) {
|
|
|
279
337
|
metadata: t.metadata,
|
|
280
338
|
count: t.count,
|
|
281
339
|
result_count: t.result_count,
|
|
340
|
+
completion_reason: stringOf(t.completion_reason),
|
|
341
|
+
coverage_limited: t.coverage_limited === true ? true : undefined,
|
|
342
|
+
warnings: arrayOf(t.warnings).map(compactWarning),
|
|
282
343
|
progress: options.progress ? t.progress : undefined,
|
|
283
344
|
errors: options.progress ? t.errors : undefined,
|
|
284
345
|
reserved_cost_usd: t.reserved_cost_usd,
|
|
@@ -292,8 +353,9 @@ export function compactTask(task, options = {}) {
|
|
|
292
353
|
/**
|
|
293
354
|
* One sentence on what to do next, so an agent does not have to infer it from the status.
|
|
294
355
|
* `nextCursor` is the results cursor when the caller just read a page of people.
|
|
356
|
+
* `task` adds why a completed search ended (`completion_reason`, `coverage_limited`).
|
|
295
357
|
*/
|
|
296
|
-
export function peopleNextStep(status, nextCursor, hasMore = false) {
|
|
358
|
+
export function peopleNextStep(status, nextCursor, hasMore = false, task = {}) {
|
|
297
359
|
const again = nextCursor === undefined
|
|
298
360
|
? "people-search-status again"
|
|
299
361
|
: `people-search-status again with cursor "${nextCursor}"`;
|
|
@@ -313,6 +375,16 @@ export function peopleNextStep(status, nextCursor, hasMore = false) {
|
|
|
313
375
|
case "cancelling":
|
|
314
376
|
return "Cancelling. Call people-search-status again to read the final status.";
|
|
315
377
|
case "completed":
|
|
378
|
+
if (task.coverage_limited === true) {
|
|
379
|
+
const wanted = typeof task.count === "number" ? `${task.count} people` : "the count you asked for";
|
|
380
|
+
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.`;
|
|
381
|
+
}
|
|
382
|
+
if (task.completion_reason === "no_candidates") {
|
|
383
|
+
return "Finished: its searches found nobody to check. Try a broader description.";
|
|
384
|
+
}
|
|
385
|
+
if (task.completion_reason === "zero_qualified") {
|
|
386
|
+
return "Finished: it checked the people its searches found and none fit. Try a broader description.";
|
|
387
|
+
}
|
|
316
388
|
return "Finished. You have every person this search found.";
|
|
317
389
|
case "partial":
|
|
318
390
|
return "Finished with partial results: some searches failed. You have every person it found.";
|
|
@@ -351,7 +423,7 @@ export async function readPeopleStatus(client, args) {
|
|
|
351
423
|
const status = typeof summary.status === "string" ? summary.status : undefined;
|
|
352
424
|
const includePeople = args.include_people !== false;
|
|
353
425
|
if (!includePeople) {
|
|
354
|
-
return { ...summary, next: peopleNextStep(status) };
|
|
426
|
+
return { ...summary, next: peopleNextStep(status, undefined, false, summary) };
|
|
355
427
|
}
|
|
356
428
|
let nextCursor = args.cursor ?? "0";
|
|
357
429
|
let hasMore = false;
|
|
@@ -369,14 +441,14 @@ export async function readPeopleStatus(client, args) {
|
|
|
369
441
|
people,
|
|
370
442
|
next_cursor: nextCursor,
|
|
371
443
|
has_more: hasMore,
|
|
372
|
-
next: peopleNextStep(status, nextCursor, hasMore),
|
|
444
|
+
next: peopleNextStep(status, nextCursor, hasMore, summary),
|
|
373
445
|
};
|
|
374
446
|
}
|
|
375
447
|
/** `people-search-control`: pause, resume, or cancel a task. */
|
|
376
448
|
export async function controlPeopleTask(client, args) {
|
|
377
449
|
const task = compactTask(await client.controlTask(args.task_id, args.action));
|
|
378
450
|
const status = typeof task.status === "string" ? task.status : undefined;
|
|
379
|
-
return { ...task, next: peopleNextStep(status) };
|
|
451
|
+
return { ...task, next: peopleNextStep(status, undefined, false, task) };
|
|
380
452
|
}
|
|
381
453
|
/** `people-search-tasks`: the caller's tasks, newest first. */
|
|
382
454
|
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.
|
|
4
|
+
export declare const SERVER_VERSION = "0.3.3";
|
|
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.
|
|
8
|
+
export const SERVER_VERSION = "0.3.3";
|
|
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.
|
|
3
|
+
"version": "0.3.3",
|
|
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",
|