uniqueness-mcp 0.4.0 → 0.4.1
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 +18 -2
- 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.1" });
|
|
19
19
|
|
|
20
20
|
server.tool(
|
|
21
21
|
"get_connection_brief",
|
|
@@ -69,7 +69,23 @@ server.tool(
|
|
|
69
69
|
});
|
|
70
70
|
const subJson = await sub.json().catch(() => ({}));
|
|
71
71
|
if (sub.status === 401) return { isError: true, content: [{ type: "text", text: "401 unauthorized — invalid API key." }] };
|
|
72
|
-
if (sub.status === 402)
|
|
72
|
+
if (sub.status === 402) {
|
|
73
|
+
if (subJson.error === "payment_method_required") {
|
|
74
|
+
const reason = subJson.reason === "daily_free_budget_reached"
|
|
75
|
+
? "The shared daily free lookup budget is used. It resets daily; cached lookups still work. A completed purchase removes this cap."
|
|
76
|
+
: subJson.reason === "uncached_live_run"
|
|
77
|
+
? "A card is required for another uncached live lookup. Any remaining credits still work on cached lookups."
|
|
78
|
+
: "This lookup is blocked by the card gate. Cached lookups still work.";
|
|
79
|
+
const setup = subJson.setup_url
|
|
80
|
+
? ` POST ${subJson.setup_url} with the Bearer key and follow the Stripe URL it returns.`
|
|
81
|
+
: "";
|
|
82
|
+
return { isError: true, content: [{ type: "text", text: `Card gate: ${reason}${setup}` }] };
|
|
83
|
+
}
|
|
84
|
+
if (subJson.error === "insufficient_credits") {
|
|
85
|
+
return { isError: true, content: [{ type: "text", text: "Out of credits. Add credits or save a card with POST /api/billing/setup." }] };
|
|
86
|
+
}
|
|
87
|
+
return { isError: true, content: [{ type: "text", text: subJson.error || "Payment required." }] };
|
|
88
|
+
}
|
|
73
89
|
|
|
74
90
|
// Fast path: cache hit / immediate brief.
|
|
75
91
|
let brief = subJson.brief || null;
|