@ulinkly/mcp-server 0.1.1 → 0.1.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/README.md +3 -3
- package/dist/tools/account.js +36 -8
- package/dist/tools/account.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,9 +129,9 @@ The following ULink tools are available to the LLM, organized by category.
|
|
|
129
129
|
|
|
130
130
|
#### Account & Billing
|
|
131
131
|
|
|
132
|
-
- `get_subscription`: Gets
|
|
133
|
-
- `list_plans`: Lists all available subscription plans with pricing and limits.
|
|
134
|
-
- `get_usage`: Gets usage statistics for the current billing period (clicks, links, API calls).
|
|
132
|
+
- `get_subscription`: Gets a project's subscription plan, status, and renewal date. Accepts an optional `projectId`.
|
|
133
|
+
- `list_plans`: Lists all available subscription plans with pricing and limits. Accepts an optional `billingPeriod` (monthly/yearly).
|
|
134
|
+
- `get_usage`: Gets a project's usage statistics for the current billing period (clicks, links, API calls). Accepts an optional `projectId`.
|
|
135
135
|
|
|
136
136
|
## Environment Variables
|
|
137
137
|
|
package/dist/tools/account.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { apiRequest } from "../client/ulink-api.js";
|
|
2
3
|
export function registerAccountTools(server) {
|
|
3
4
|
// -----------------------------------------------------------------------
|
|
@@ -5,11 +6,20 @@ export function registerAccountTools(server) {
|
|
|
5
6
|
// -----------------------------------------------------------------------
|
|
6
7
|
server.registerTool("get_subscription", {
|
|
7
8
|
title: "Get Subscription",
|
|
8
|
-
description: "Retrieve the
|
|
9
|
+
description: "Retrieve the active subscription for a specific project, including plan name, billing period, status, and renewal date. Subscriptions are per-project.",
|
|
9
10
|
annotations: { readOnlyHint: true },
|
|
10
|
-
|
|
11
|
+
inputSchema: {
|
|
12
|
+
projectId: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe("The project ID to get the subscription for. If omitted, the API returns the subscription for the user's first project.")
|
|
15
|
+
.optional(),
|
|
16
|
+
},
|
|
17
|
+
}, async ({ projectId }) => {
|
|
11
18
|
try {
|
|
12
|
-
const
|
|
19
|
+
const qs = projectId
|
|
20
|
+
? `?projectId=${encodeURIComponent(projectId)}`
|
|
21
|
+
: "";
|
|
22
|
+
const data = await apiRequest("GET", `/subscriptions/current${qs}`);
|
|
13
23
|
return {
|
|
14
24
|
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
15
25
|
};
|
|
@@ -28,9 +38,18 @@ export function registerAccountTools(server) {
|
|
|
28
38
|
title: "List Plans",
|
|
29
39
|
description: "List all available ULink subscription plans with their features, limits, and pricing. Useful for comparing plans or determining upgrade options.",
|
|
30
40
|
annotations: { readOnlyHint: true },
|
|
31
|
-
|
|
41
|
+
inputSchema: {
|
|
42
|
+
billingPeriod: z
|
|
43
|
+
.enum(["monthly", "yearly"])
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Billing period to show pricing for (default: monthly)."),
|
|
46
|
+
},
|
|
47
|
+
}, async ({ billingPeriod }) => {
|
|
32
48
|
try {
|
|
33
|
-
const
|
|
49
|
+
const qs = billingPeriod
|
|
50
|
+
? `?billingPeriod=${encodeURIComponent(billingPeriod)}`
|
|
51
|
+
: "";
|
|
52
|
+
const data = await apiRequest("GET", `/subscriptions/plans${qs}`);
|
|
34
53
|
return {
|
|
35
54
|
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
36
55
|
};
|
|
@@ -47,11 +66,20 @@ export function registerAccountTools(server) {
|
|
|
47
66
|
// -----------------------------------------------------------------------
|
|
48
67
|
server.registerTool("get_usage", {
|
|
49
68
|
title: "Get Usage",
|
|
50
|
-
description: "Retrieve
|
|
69
|
+
description: "Retrieve usage statistics for a specific project's active billing period, including link clicks, links created, and API calls against plan limits. Usage is per-project.",
|
|
51
70
|
annotations: { readOnlyHint: true },
|
|
52
|
-
|
|
71
|
+
inputSchema: {
|
|
72
|
+
projectId: z
|
|
73
|
+
.string()
|
|
74
|
+
.describe("The project ID to get usage for. If omitted, the API returns usage for the user's first project.")
|
|
75
|
+
.optional(),
|
|
76
|
+
},
|
|
77
|
+
}, async ({ projectId }) => {
|
|
53
78
|
try {
|
|
54
|
-
const
|
|
79
|
+
const qs = projectId
|
|
80
|
+
? `?projectId=${encodeURIComponent(projectId)}`
|
|
81
|
+
: "";
|
|
82
|
+
const data = await apiRequest("GET", `/subscriptions/me/usage${qs}`);
|
|
55
83
|
return {
|
|
56
84
|
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
57
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,0EAA0E;IAC1E,mBAAmB;IACnB,0EAA0E;IAC1E,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,wJAAwJ;QAC1J,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;QACnC,WAAW,EAAE;YACX,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CACP,wHAAwH,CACzH;iBACA,QAAQ,EAAE;SACd;KACF,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,SAAS;gBAClB,CAAC,CAAC,cAAc,kBAAkB,CAAC,SAAS,CAAC,EAAE;gBAC/C,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAI,GAAG,MAAM,UAAU,CAC3B,KAAK,EACL,yBAAyB,EAAE,EAAE,CA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