uniqueness-mcp 0.4.0 → 0.4.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/index.mjs +21 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const BASE = process.env.UNIQUENESS_API_URL || "https://uniquenessengine.com";
|
|
|
15
15
|
const KEY = process.env.UNIQUENESS_API_KEY || "";
|
|
16
16
|
|
|
17
17
|
// Keep in step with mcp/package.json — cli/release-parity.test.ts asserts they match.
|
|
18
|
-
const server = new McpServer({ name: "uniqueness", version: "0.4.
|
|
18
|
+
const server = new McpServer({ name: "uniqueness", version: "0.4.2" });
|
|
19
19
|
|
|
20
20
|
server.tool(
|
|
21
21
|
"get_connection_brief",
|
|
@@ -23,7 +23,9 @@ server.tool(
|
|
|
23
23
|
"verified personal + professional signal, each claim grounded in a source (`evidence_quote` + " +
|
|
24
24
|
"`source_url`), identity-gated (returns needs_review rather than guessing). Each delivered brief " +
|
|
25
25
|
"carries a `usage` object (cache_status, credits_charged, credits_remaining) and a `capabilities` " +
|
|
26
|
-
"block;
|
|
26
|
+
"block; optional `usage.card_gate_notice` is the server-authored pre-wall next action and should " +
|
|
27
|
+
"be shown as-is rather than inferred from the balance. A refusal or 0-fact brief is free. " +
|
|
28
|
+
"The response is COMPACT by default (identity + " +
|
|
27
29
|
"top-ranked facts + capabilities) — pass detail:'full' for the complete brief; set detail " +
|
|
28
30
|
"explicitly. The removed fields outreach_angles / gift_hook / safe_to_use_in_outreach are declared " +
|
|
29
31
|
"in `capabilities`, never returned. Machine-readable contract: " +
|
|
@@ -69,7 +71,23 @@ server.tool(
|
|
|
69
71
|
});
|
|
70
72
|
const subJson = await sub.json().catch(() => ({}));
|
|
71
73
|
if (sub.status === 401) return { isError: true, content: [{ type: "text", text: "401 unauthorized — invalid API key." }] };
|
|
72
|
-
if (sub.status === 402)
|
|
74
|
+
if (sub.status === 402) {
|
|
75
|
+
if (subJson.error === "payment_method_required") {
|
|
76
|
+
const reason = subJson.reason === "daily_free_budget_reached"
|
|
77
|
+
? "The shared daily free lookup budget is used. It resets daily; cached lookups still work. A completed purchase removes this cap."
|
|
78
|
+
: subJson.reason === "uncached_live_run"
|
|
79
|
+
? "A card is required for another uncached live lookup. Any remaining credits still work on cached lookups."
|
|
80
|
+
: "This lookup is blocked by the card gate. Cached lookups still work.";
|
|
81
|
+
const setup = subJson.setup_url
|
|
82
|
+
? ` POST ${subJson.setup_url} with the Bearer key and follow the Stripe URL it returns.`
|
|
83
|
+
: "";
|
|
84
|
+
return { isError: true, content: [{ type: "text", text: `Card gate: ${reason}${setup}` }] };
|
|
85
|
+
}
|
|
86
|
+
if (subJson.error === "insufficient_credits") {
|
|
87
|
+
return { isError: true, content: [{ type: "text", text: "Out of credits. Add credits or save a card with POST /api/billing/setup." }] };
|
|
88
|
+
}
|
|
89
|
+
return { isError: true, content: [{ type: "text", text: subJson.error || "Payment required." }] };
|
|
90
|
+
}
|
|
73
91
|
|
|
74
92
|
// Fast path: cache hit / immediate brief.
|
|
75
93
|
let brief = subJson.brief || null;
|