@pdpp/mcp-server 0.7.10 → 0.8.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/package.json +2 -2
- package/src/tools.js +28 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdpp/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Local stdio MCP adapter for grant-scoped PDPP reads and event-subscription management.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"mcp",
|
|
32
32
|
"model-context-protocol"
|
|
33
33
|
],
|
|
34
|
-
"license": "
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
37
|
"url": "git+https://github.com/vana-com/pdpp.git",
|
package/src/tools.js
CHANGED
|
@@ -1663,12 +1663,39 @@ function summarizeSearch(body, results) {
|
|
|
1663
1663
|
const cursorText = nextCursor ? ` next_cursor=${formatScalar(nextCursor)}.` : '';
|
|
1664
1664
|
const firstFetchText = results[0]?.id ? ` first_fetch_id=${formatInlineValue(results[0].id)}` : '';
|
|
1665
1665
|
const sourceMixText = formatSearchSourceMix(body);
|
|
1666
|
+
const recallText = formatSearchRecallWarning(body);
|
|
1666
1667
|
const previews = results.slice(0, SEARCH_TEXT_PREVIEW_LIMIT).map(formatSearchPreviewLine);
|
|
1667
1668
|
const previewText = previews.length > 0 ? ` Top results:\n${previews.join('\n')}` : '';
|
|
1668
1669
|
const fetchHint = previews.length > 0
|
|
1669
1670
|
? '\nFetch a hit with `fetch` using the shown id as-is; ids are self-contained. Pass connection_id only when shown separately.'
|
|
1670
1671
|
: '';
|
|
1671
|
-
return `search: ${results.length} hit(s).${hasMore}${cursorText}${firstFetchText}${sourceMixText}${previewText}${fetchHint} Search envelope metadata: structuredContent.data; flattened results: structuredContent.results.`;
|
|
1672
|
+
return `search: ${results.length} hit(s).${hasMore}${cursorText}${firstFetchText}${sourceMixText}${recallText}${previewText}${fetchHint} Search envelope metadata: structuredContent.data; flattened results: structuredContent.results.`;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
// Mirror — never reinterpret — the RS recall disclosure. The warning is driven
|
|
1676
|
+
// strictly by `meta.recall` from `/v1/search`; the adapter does NOT infer
|
|
1677
|
+
// completeness from `has_more`, page size, or the hit count. A complete
|
|
1678
|
+
// (`all_matches`) recall emits no extra warning, keeping the common case terse.
|
|
1679
|
+
// Spec: openspec/changes/disclose-lexical-recall-windows.
|
|
1680
|
+
function formatSearchRecallWarning(body) {
|
|
1681
|
+
const meta = objectValue(envelopeField(body, 'meta'));
|
|
1682
|
+
const recall = objectValue(meta?.recall);
|
|
1683
|
+
if (!recall) return '';
|
|
1684
|
+
if (recall.ranking_scope === 'candidate_window' || recall.complete === false) {
|
|
1685
|
+
const facts = [];
|
|
1686
|
+
if (typeof recall.ranked_candidate_count === 'number') {
|
|
1687
|
+
facts.push(`ranked_candidate_count=${recall.ranked_candidate_count}`);
|
|
1688
|
+
}
|
|
1689
|
+
if (typeof recall.candidate_window_limit === 'number') {
|
|
1690
|
+
facts.push(`candidate_window_limit=${recall.candidate_window_limit}`);
|
|
1691
|
+
}
|
|
1692
|
+
if (typeof recall.truncated_source_count === 'number') {
|
|
1693
|
+
facts.push(`truncated_source_count=${recall.truncated_source_count}`);
|
|
1694
|
+
}
|
|
1695
|
+
const factsText = facts.length > 0 ? ` (${facts.join(', ')})` : '';
|
|
1696
|
+
return ` Recall: results were ranked over a bounded candidate window, not all matches — more matches may exist${factsText}; do not treat this page as exhaustive.`;
|
|
1697
|
+
}
|
|
1698
|
+
return '';
|
|
1672
1699
|
}
|
|
1673
1700
|
|
|
1674
1701
|
function formatSearchSourceMix(body) {
|