@spacelr/mcp 0.0.13 → 0.2.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/dist/index.mjs +280 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1228,7 +1228,7 @@ function registerDatabaseTools(server, api) {
|
|
|
1228
1228
|
server.registerTool(
|
|
1229
1229
|
"database_collections_update_metadata",
|
|
1230
1230
|
{
|
|
1231
|
-
description: "Update a collection's realtime delivery mode
|
|
1231
|
+
description: "Update a collection's realtime delivery mode, stream retention, write rate-limit override, or search filter requirements. `realtimeMode: 'stream'` switches the collection to Redis Streams for durable event replay (needed for chat, notifications, activity feeds). `realtimeMode: 'pubsub'` (default) is fire-and-forget, used for dashboards and list views. Exactly one of `streamRetention.maxLen` (approx. entry count) or `streamRetention.maxAgeMs` (retention age in ms) may be set. `writeThrottle` overrides the default per-collection write rate limit (10 writes / 10 s) \u2014 set `enabled: false` to disable entirely (e.g. audit logs), or override `limit` / `windowMs`. `searchConfig.requireFilter` declares top-level filter keys that callers MUST include in every `collection.search()` call to prevent unindexable full-scan regex queries \u2014 affects ALL callers immediately (no deprecation window). Response may include `warnings[]` if the project exceeds the 50-collection soft cap.",
|
|
1232
1232
|
inputSchema: {
|
|
1233
1233
|
projectId: z4.string(),
|
|
1234
1234
|
name: z4.string(),
|
|
@@ -1239,17 +1239,55 @@ function registerDatabaseTools(server, api) {
|
|
|
1239
1239
|
}).refine(
|
|
1240
1240
|
(r) => !(r.maxLen !== void 0 && r.maxAgeMs !== void 0),
|
|
1241
1241
|
{ message: "Set at most one of maxLen or maxAgeMs" }
|
|
1242
|
-
).optional()
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1242
|
+
).optional(),
|
|
1243
|
+
writeThrottle: z4.object({
|
|
1244
|
+
enabled: z4.boolean().optional().describe("When false, skip write throttling entirely for this collection"),
|
|
1245
|
+
limit: z4.number().int().min(1).max(1e4).optional().describe("Max writes per window (1..10000)"),
|
|
1246
|
+
windowMs: z4.number().int().min(1e3).max(36e5).optional().describe("Window duration in ms (1000..3_600_000 = 1s to 1h)")
|
|
1247
|
+
}).refine(
|
|
1248
|
+
(t) => t.enabled !== void 0 || t.limit !== void 0 || t.windowMs !== void 0,
|
|
1249
|
+
{ message: "writeThrottle must set at least one of enabled, limit, or windowMs" }
|
|
1250
|
+
).optional(),
|
|
1251
|
+
searchConfig: z4.object({
|
|
1252
|
+
requireFilter: z4.array(
|
|
1253
|
+
z4.string().regex(/^[a-zA-Z0-9_]+$/, "Top-level field names only (no dots, alphanumeric + underscore)").max(64).refine(
|
|
1254
|
+
(k) => !["__proto__", "constructor", "prototype"].includes(k),
|
|
1255
|
+
{ message: "Reserved JS object keys (__proto__, constructor, prototype) are not allowed" }
|
|
1256
|
+
)
|
|
1257
|
+
).min(1).max(10).optional().describe(
|
|
1258
|
+
"Top-level filter keys required on every search() call. Empty array rejected \u2014 to CLEAR an existing requirement, pass `searchConfig: {}` (an empty object). Omitting `searchConfig` entirely is a no-op (no change). Duplicate keys are deduplicated server-side, but you should send a deduplicated list."
|
|
1259
|
+
)
|
|
1260
|
+
// `searchConfig.fields` is intentionally NOT exposed here. The
|
|
1261
|
+
// backend DTO accepts it but treats it as "Reserved: future
|
|
1262
|
+
// allow-list of searchable fields. Stored but not enforced.".
|
|
1263
|
+
// Surfacing it via MCP would let callers persist values that
|
|
1264
|
+
// have no observable effect today and may take on different
|
|
1265
|
+
// semantics when enforcement ships. Add back once the feature
|
|
1266
|
+
// is live.
|
|
1267
|
+
}).strict().optional()
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
async ({ projectId, name, realtimeMode, streamRetention, writeThrottle, searchConfig }) => {
|
|
1246
1271
|
try {
|
|
1247
1272
|
const body = {};
|
|
1248
1273
|
if (realtimeMode !== void 0) body.realtimeMode = realtimeMode;
|
|
1249
1274
|
if (streamRetention !== void 0) body.streamRetention = streamRetention;
|
|
1275
|
+
if (writeThrottle !== void 0) body.writeThrottle = writeThrottle;
|
|
1276
|
+
if (searchConfig !== void 0) {
|
|
1277
|
+
const normalized = {};
|
|
1278
|
+
if (searchConfig.requireFilter !== void 0) {
|
|
1279
|
+
normalized.requireFilter = Array.from(new Set(searchConfig.requireFilter));
|
|
1280
|
+
}
|
|
1281
|
+
body.searchConfig = normalized;
|
|
1282
|
+
}
|
|
1250
1283
|
if (Object.keys(body).length === 0) {
|
|
1251
1284
|
return {
|
|
1252
|
-
content: [
|
|
1285
|
+
content: [
|
|
1286
|
+
{
|
|
1287
|
+
type: "text",
|
|
1288
|
+
text: "At least one of realtimeMode, streamRetention, writeThrottle, or searchConfig must be provided"
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1253
1291
|
isError: true
|
|
1254
1292
|
};
|
|
1255
1293
|
}
|
|
@@ -3499,8 +3537,143 @@ function registerCronJobTools(server, api) {
|
|
|
3499
3537
|
);
|
|
3500
3538
|
}
|
|
3501
3539
|
|
|
3502
|
-
// libs/mcp-server/src/tools/
|
|
3540
|
+
// libs/mcp-server/src/tools/schedules.ts
|
|
3503
3541
|
import { z as z10 } from "zod";
|
|
3542
|
+
var STATUS_VALUES = ["scheduled", "fired", "failed", "cancelled"];
|
|
3543
|
+
function registerScheduleTools(server, api) {
|
|
3544
|
+
server.registerTool(
|
|
3545
|
+
"schedules_list",
|
|
3546
|
+
{
|
|
3547
|
+
description: "List one-shot scheduled function invocations for a project",
|
|
3548
|
+
inputSchema: {
|
|
3549
|
+
projectId: z10.string(),
|
|
3550
|
+
functionId: z10.string().optional(),
|
|
3551
|
+
status: z10.enum(STATUS_VALUES).optional(),
|
|
3552
|
+
limit: z10.number().int().min(1).max(200).optional(),
|
|
3553
|
+
offset: z10.number().int().min(0).optional()
|
|
3554
|
+
}
|
|
3555
|
+
},
|
|
3556
|
+
async ({ projectId, functionId, status, limit, offset }) => {
|
|
3557
|
+
try {
|
|
3558
|
+
const result = await api.get(
|
|
3559
|
+
`/projects/${encodeURIComponent(projectId)}/schedules`,
|
|
3560
|
+
{ params: { functionId, status, limit, offset } }
|
|
3561
|
+
);
|
|
3562
|
+
return {
|
|
3563
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
3564
|
+
};
|
|
3565
|
+
} catch (error) {
|
|
3566
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3567
|
+
return {
|
|
3568
|
+
content: [{ type: "text", text: `Failed to list schedules: ${message}` }],
|
|
3569
|
+
isError: true
|
|
3570
|
+
};
|
|
3571
|
+
}
|
|
3572
|
+
}
|
|
3573
|
+
);
|
|
3574
|
+
server.registerTool(
|
|
3575
|
+
"schedules_get",
|
|
3576
|
+
{
|
|
3577
|
+
description: "Get a single scheduled invocation by ID",
|
|
3578
|
+
inputSchema: {
|
|
3579
|
+
projectId: z10.string(),
|
|
3580
|
+
scheduleId: z10.string()
|
|
3581
|
+
}
|
|
3582
|
+
},
|
|
3583
|
+
async ({ projectId, scheduleId }) => {
|
|
3584
|
+
try {
|
|
3585
|
+
const result = await api.get(
|
|
3586
|
+
`/projects/${encodeURIComponent(projectId)}/schedules/${encodeURIComponent(scheduleId)}`
|
|
3587
|
+
);
|
|
3588
|
+
return {
|
|
3589
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
3590
|
+
};
|
|
3591
|
+
} catch (error) {
|
|
3592
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3593
|
+
return {
|
|
3594
|
+
content: [{ type: "text", text: `Failed to get schedule: ${message}` }],
|
|
3595
|
+
isError: true
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
);
|
|
3600
|
+
server.registerTool(
|
|
3601
|
+
"schedules_create",
|
|
3602
|
+
{
|
|
3603
|
+
description: "Schedule a one-shot function invocation. `executeAt` must be ISO-8601 within the configured max-delay window (default 90 days). Repeating with the same `idempotencyKey` returns the existing schedule.",
|
|
3604
|
+
inputSchema: {
|
|
3605
|
+
projectId: z10.string(),
|
|
3606
|
+
functionId: z10.string().regex(/^[a-f0-9]{24}$/i),
|
|
3607
|
+
executeAt: z10.string().describe("ISO-8601 timestamp"),
|
|
3608
|
+
payload: z10.record(z10.string(), z10.unknown()).optional(),
|
|
3609
|
+
idempotencyKey: z10.string().min(1).max(256).optional(),
|
|
3610
|
+
maxAttempts: z10.number().int().min(0).max(10).optional()
|
|
3611
|
+
}
|
|
3612
|
+
},
|
|
3613
|
+
async ({
|
|
3614
|
+
projectId,
|
|
3615
|
+
functionId,
|
|
3616
|
+
executeAt,
|
|
3617
|
+
payload,
|
|
3618
|
+
idempotencyKey,
|
|
3619
|
+
maxAttempts
|
|
3620
|
+
}) => {
|
|
3621
|
+
try {
|
|
3622
|
+
const body = { functionId, executeAt };
|
|
3623
|
+
if (payload !== void 0) body.payload = payload;
|
|
3624
|
+
if (idempotencyKey !== void 0) body.idempotencyKey = idempotencyKey;
|
|
3625
|
+
if (maxAttempts !== void 0) body.maxAttempts = maxAttempts;
|
|
3626
|
+
const result = await api.post(
|
|
3627
|
+
`/projects/${encodeURIComponent(projectId)}/schedules`,
|
|
3628
|
+
{ body }
|
|
3629
|
+
);
|
|
3630
|
+
return {
|
|
3631
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
3632
|
+
};
|
|
3633
|
+
} catch (error) {
|
|
3634
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3635
|
+
return {
|
|
3636
|
+
content: [{ type: "text", text: `Failed to create schedule: ${message}` }],
|
|
3637
|
+
isError: true
|
|
3638
|
+
};
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
);
|
|
3642
|
+
server.registerTool(
|
|
3643
|
+
"schedules_cancel",
|
|
3644
|
+
{
|
|
3645
|
+
description: "Cancel a scheduled invocation. Idempotent \u2014 returns the existing record if already in a terminal state (fired/failed/cancelled).",
|
|
3646
|
+
inputSchema: {
|
|
3647
|
+
projectId: z10.string(),
|
|
3648
|
+
scheduleId: z10.string()
|
|
3649
|
+
}
|
|
3650
|
+
},
|
|
3651
|
+
async ({ projectId, scheduleId }) => {
|
|
3652
|
+
try {
|
|
3653
|
+
const result = await api.delete(
|
|
3654
|
+
`/projects/${encodeURIComponent(projectId)}/schedules/${encodeURIComponent(scheduleId)}`
|
|
3655
|
+
);
|
|
3656
|
+
return {
|
|
3657
|
+
content: [
|
|
3658
|
+
{
|
|
3659
|
+
type: "text",
|
|
3660
|
+
text: result ? JSON.stringify(result, null, 2) : "Schedule cancelled"
|
|
3661
|
+
}
|
|
3662
|
+
]
|
|
3663
|
+
};
|
|
3664
|
+
} catch (error) {
|
|
3665
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3666
|
+
return {
|
|
3667
|
+
content: [{ type: "text", text: `Failed to cancel schedule: ${message}` }],
|
|
3668
|
+
isError: true
|
|
3669
|
+
};
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
);
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
// libs/mcp-server/src/tools/webhooks.ts
|
|
3676
|
+
import { z as z11 } from "zod";
|
|
3504
3677
|
var WEBHOOK_EVENT_TYPES = [
|
|
3505
3678
|
"user.created",
|
|
3506
3679
|
"user.updated",
|
|
@@ -3524,7 +3697,7 @@ function registerWebhookTools(server, api) {
|
|
|
3524
3697
|
{
|
|
3525
3698
|
description: "List all webhooks for a project",
|
|
3526
3699
|
inputSchema: {
|
|
3527
|
-
projectId:
|
|
3700
|
+
projectId: z11.string()
|
|
3528
3701
|
}
|
|
3529
3702
|
},
|
|
3530
3703
|
async ({ projectId }) => {
|
|
@@ -3547,8 +3720,8 @@ function registerWebhookTools(server, api) {
|
|
|
3547
3720
|
{
|
|
3548
3721
|
description: "Get a single webhook by ID",
|
|
3549
3722
|
inputSchema: {
|
|
3550
|
-
projectId:
|
|
3551
|
-
webhookId:
|
|
3723
|
+
projectId: z11.string(),
|
|
3724
|
+
webhookId: z11.string()
|
|
3552
3725
|
}
|
|
3553
3726
|
},
|
|
3554
3727
|
async ({ projectId, webhookId }) => {
|
|
@@ -3571,12 +3744,12 @@ function registerWebhookTools(server, api) {
|
|
|
3571
3744
|
{
|
|
3572
3745
|
description: "Create a new webhook for a project. WARNING: The response includes a secret that will be visible in the conversation context. Events include: user.created, user.updated, user.deleted, user.login, user.email_verified, user.password_reset_requested, user.password_reset, user.2fa_verified, database.insert, database.update, database.delete, storage.upload, storage.delete, project.created, project.updated.",
|
|
3573
3746
|
inputSchema: {
|
|
3574
|
-
projectId:
|
|
3575
|
-
url:
|
|
3576
|
-
events:
|
|
3577
|
-
description:
|
|
3578
|
-
headers:
|
|
3579
|
-
active:
|
|
3747
|
+
projectId: z11.string(),
|
|
3748
|
+
url: z11.string().url(),
|
|
3749
|
+
events: z11.array(z11.enum(WEBHOOK_EVENT_TYPES)).min(1),
|
|
3750
|
+
description: z11.string().optional(),
|
|
3751
|
+
headers: z11.record(z11.string(), z11.string()).optional(),
|
|
3752
|
+
active: z11.boolean().optional()
|
|
3580
3753
|
}
|
|
3581
3754
|
},
|
|
3582
3755
|
async ({ projectId, url, events, description, headers, active }) => {
|
|
@@ -3603,13 +3776,13 @@ function registerWebhookTools(server, api) {
|
|
|
3603
3776
|
{
|
|
3604
3777
|
description: "Update an existing webhook",
|
|
3605
3778
|
inputSchema: {
|
|
3606
|
-
projectId:
|
|
3607
|
-
webhookId:
|
|
3608
|
-
url:
|
|
3609
|
-
events:
|
|
3610
|
-
description:
|
|
3611
|
-
headers:
|
|
3612
|
-
active:
|
|
3779
|
+
projectId: z11.string(),
|
|
3780
|
+
webhookId: z11.string(),
|
|
3781
|
+
url: z11.string().url().optional(),
|
|
3782
|
+
events: z11.array(z11.enum(WEBHOOK_EVENT_TYPES)).min(1).optional(),
|
|
3783
|
+
description: z11.string().optional(),
|
|
3784
|
+
headers: z11.record(z11.string(), z11.string()).optional(),
|
|
3785
|
+
active: z11.boolean().optional()
|
|
3613
3786
|
}
|
|
3614
3787
|
},
|
|
3615
3788
|
async ({ projectId, webhookId, url, events, description, headers, active }) => {
|
|
@@ -3644,8 +3817,8 @@ function registerWebhookTools(server, api) {
|
|
|
3644
3817
|
{
|
|
3645
3818
|
description: "Delete a webhook",
|
|
3646
3819
|
inputSchema: {
|
|
3647
|
-
projectId:
|
|
3648
|
-
webhookId:
|
|
3820
|
+
projectId: z11.string(),
|
|
3821
|
+
webhookId: z11.string()
|
|
3649
3822
|
}
|
|
3650
3823
|
},
|
|
3651
3824
|
async ({ projectId, webhookId }) => {
|
|
@@ -3668,8 +3841,8 @@ function registerWebhookTools(server, api) {
|
|
|
3668
3841
|
{
|
|
3669
3842
|
description: "Send a test ping to a webhook",
|
|
3670
3843
|
inputSchema: {
|
|
3671
|
-
projectId:
|
|
3672
|
-
webhookId:
|
|
3844
|
+
projectId: z11.string(),
|
|
3845
|
+
webhookId: z11.string()
|
|
3673
3846
|
}
|
|
3674
3847
|
},
|
|
3675
3848
|
async ({ projectId, webhookId }) => {
|
|
@@ -3692,10 +3865,10 @@ function registerWebhookTools(server, api) {
|
|
|
3692
3865
|
{
|
|
3693
3866
|
description: "List webhook delivery logs for a project",
|
|
3694
3867
|
inputSchema: {
|
|
3695
|
-
projectId:
|
|
3696
|
-
webhookId:
|
|
3697
|
-
limit:
|
|
3698
|
-
offset:
|
|
3868
|
+
projectId: z11.string(),
|
|
3869
|
+
webhookId: z11.string().optional(),
|
|
3870
|
+
limit: z11.number().int().min(1).max(100).optional(),
|
|
3871
|
+
offset: z11.number().int().min(0).optional()
|
|
3699
3872
|
}
|
|
3700
3873
|
},
|
|
3701
3874
|
async ({ projectId, webhookId, limit, offset }) => {
|
|
@@ -3718,8 +3891,8 @@ function registerWebhookTools(server, api) {
|
|
|
3718
3891
|
{
|
|
3719
3892
|
description: "Retry a failed webhook delivery",
|
|
3720
3893
|
inputSchema: {
|
|
3721
|
-
projectId:
|
|
3722
|
-
deliveryId:
|
|
3894
|
+
projectId: z11.string(),
|
|
3895
|
+
deliveryId: z11.string()
|
|
3723
3896
|
}
|
|
3724
3897
|
},
|
|
3725
3898
|
async ({ projectId, deliveryId }) => {
|
|
@@ -3740,14 +3913,14 @@ function registerWebhookTools(server, api) {
|
|
|
3740
3913
|
}
|
|
3741
3914
|
|
|
3742
3915
|
// libs/mcp-server/src/tools/notifications.ts
|
|
3743
|
-
import { z as
|
|
3916
|
+
import { z as z12 } from "zod";
|
|
3744
3917
|
function registerNotificationTools(server, api) {
|
|
3745
3918
|
server.registerTool(
|
|
3746
3919
|
"notification_templates_list",
|
|
3747
3920
|
{
|
|
3748
3921
|
description: "List all notification templates for a project (includes system defaults)",
|
|
3749
3922
|
inputSchema: {
|
|
3750
|
-
projectId:
|
|
3923
|
+
projectId: z12.string()
|
|
3751
3924
|
}
|
|
3752
3925
|
},
|
|
3753
3926
|
async ({ projectId }) => {
|
|
@@ -3770,7 +3943,7 @@ function registerNotificationTools(server, api) {
|
|
|
3770
3943
|
{
|
|
3771
3944
|
description: "Get a single notification template by ID",
|
|
3772
3945
|
inputSchema: {
|
|
3773
|
-
id:
|
|
3946
|
+
id: z12.string()
|
|
3774
3947
|
}
|
|
3775
3948
|
},
|
|
3776
3949
|
async ({ id }) => {
|
|
@@ -3793,15 +3966,15 @@ function registerNotificationTools(server, api) {
|
|
|
3793
3966
|
{
|
|
3794
3967
|
description: "Create a new project-specific notification template. Variables use Handlebars syntax in titleTemplate and bodyTemplate.",
|
|
3795
3968
|
inputSchema: {
|
|
3796
|
-
projectId:
|
|
3797
|
-
type:
|
|
3798
|
-
name:
|
|
3799
|
-
titleTemplate:
|
|
3800
|
-
bodyTemplate:
|
|
3801
|
-
icon:
|
|
3802
|
-
defaultUrl:
|
|
3803
|
-
variables:
|
|
3804
|
-
isActive:
|
|
3969
|
+
projectId: z12.string(),
|
|
3970
|
+
type: z12.string(),
|
|
3971
|
+
name: z12.string(),
|
|
3972
|
+
titleTemplate: z12.string(),
|
|
3973
|
+
bodyTemplate: z12.string(),
|
|
3974
|
+
icon: z12.string().optional(),
|
|
3975
|
+
defaultUrl: z12.string().optional(),
|
|
3976
|
+
variables: z12.array(z12.string()).optional(),
|
|
3977
|
+
isActive: z12.boolean().optional()
|
|
3805
3978
|
}
|
|
3806
3979
|
},
|
|
3807
3980
|
async ({ projectId, type, name, titleTemplate, bodyTemplate, icon, defaultUrl, variables, isActive }) => {
|
|
@@ -3829,14 +4002,14 @@ function registerNotificationTools(server, api) {
|
|
|
3829
4002
|
{
|
|
3830
4003
|
description: "Update an existing notification template",
|
|
3831
4004
|
inputSchema: {
|
|
3832
|
-
id:
|
|
3833
|
-
name:
|
|
3834
|
-
titleTemplate:
|
|
3835
|
-
bodyTemplate:
|
|
3836
|
-
icon:
|
|
3837
|
-
defaultUrl:
|
|
3838
|
-
variables:
|
|
3839
|
-
isActive:
|
|
4005
|
+
id: z12.string(),
|
|
4006
|
+
name: z12.string().optional(),
|
|
4007
|
+
titleTemplate: z12.string().optional(),
|
|
4008
|
+
bodyTemplate: z12.string().optional(),
|
|
4009
|
+
icon: z12.string().optional(),
|
|
4010
|
+
defaultUrl: z12.string().optional(),
|
|
4011
|
+
variables: z12.array(z12.string()).optional(),
|
|
4012
|
+
isActive: z12.boolean().optional()
|
|
3840
4013
|
}
|
|
3841
4014
|
},
|
|
3842
4015
|
async ({ id, name, titleTemplate, bodyTemplate, icon, defaultUrl, variables, isActive }) => {
|
|
@@ -3873,7 +4046,7 @@ function registerNotificationTools(server, api) {
|
|
|
3873
4046
|
{
|
|
3874
4047
|
description: "Delete a project notification template override (reverts to system default)",
|
|
3875
4048
|
inputSchema: {
|
|
3876
|
-
id:
|
|
4049
|
+
id: z12.string()
|
|
3877
4050
|
}
|
|
3878
4051
|
},
|
|
3879
4052
|
async ({ id }) => {
|
|
@@ -3896,9 +4069,9 @@ function registerNotificationTools(server, api) {
|
|
|
3896
4069
|
{
|
|
3897
4070
|
description: "Preview a compiled notification template with Handlebars variables applied",
|
|
3898
4071
|
inputSchema: {
|
|
3899
|
-
titleTemplate:
|
|
3900
|
-
bodyTemplate:
|
|
3901
|
-
variables:
|
|
4072
|
+
titleTemplate: z12.string(),
|
|
4073
|
+
bodyTemplate: z12.string(),
|
|
4074
|
+
variables: z12.record(z12.string(), z12.string())
|
|
3902
4075
|
}
|
|
3903
4076
|
},
|
|
3904
4077
|
async ({ titleTemplate, bodyTemplate, variables }) => {
|
|
@@ -3921,7 +4094,7 @@ function registerNotificationTools(server, api) {
|
|
|
3921
4094
|
{
|
|
3922
4095
|
description: "Get push notification provider configuration for a project (VAPID, FCM, APNS). WARNING: Response may include sensitive credentials that will be visible in the conversation context.",
|
|
3923
4096
|
inputSchema: {
|
|
3924
|
-
projectId:
|
|
4097
|
+
projectId: z12.string()
|
|
3925
4098
|
}
|
|
3926
4099
|
},
|
|
3927
4100
|
async ({ projectId }) => {
|
|
@@ -3944,24 +4117,24 @@ function registerNotificationTools(server, api) {
|
|
|
3944
4117
|
{
|
|
3945
4118
|
description: "Update push notification provider configuration. Supports VAPID, FCM, and APNS providers. WARNING: privateKey and serviceAccountJson values are sensitive credentials that will be visible in the conversation context.",
|
|
3946
4119
|
inputSchema: {
|
|
3947
|
-
projectId:
|
|
3948
|
-
vapid:
|
|
3949
|
-
publicKey:
|
|
3950
|
-
privateKey:
|
|
3951
|
-
subject:
|
|
3952
|
-
enabled:
|
|
4120
|
+
projectId: z12.string(),
|
|
4121
|
+
vapid: z12.object({
|
|
4122
|
+
publicKey: z12.string().optional(),
|
|
4123
|
+
privateKey: z12.string().optional(),
|
|
4124
|
+
subject: z12.string().optional(),
|
|
4125
|
+
enabled: z12.boolean().optional()
|
|
3953
4126
|
}).optional(),
|
|
3954
|
-
fcm:
|
|
3955
|
-
serviceAccountJson:
|
|
3956
|
-
enabled:
|
|
4127
|
+
fcm: z12.object({
|
|
4128
|
+
serviceAccountJson: z12.string().optional(),
|
|
4129
|
+
enabled: z12.boolean().optional()
|
|
3957
4130
|
}).optional(),
|
|
3958
|
-
apns:
|
|
3959
|
-
keyId:
|
|
3960
|
-
teamId:
|
|
3961
|
-
privateKey:
|
|
3962
|
-
bundleId:
|
|
3963
|
-
production:
|
|
3964
|
-
enabled:
|
|
4131
|
+
apns: z12.object({
|
|
4132
|
+
keyId: z12.string().optional(),
|
|
4133
|
+
teamId: z12.string().optional(),
|
|
4134
|
+
privateKey: z12.string().optional(),
|
|
4135
|
+
bundleId: z12.string().optional(),
|
|
4136
|
+
production: z12.boolean().optional(),
|
|
4137
|
+
enabled: z12.boolean().optional()
|
|
3965
4138
|
}).optional()
|
|
3966
4139
|
}
|
|
3967
4140
|
},
|
|
@@ -3995,8 +4168,8 @@ function registerNotificationTools(server, api) {
|
|
|
3995
4168
|
{
|
|
3996
4169
|
description: "Delete push notification provider configuration. Specify a provider to delete only that one, or omit to delete all.",
|
|
3997
4170
|
inputSchema: {
|
|
3998
|
-
projectId:
|
|
3999
|
-
provider:
|
|
4171
|
+
projectId: z12.string(),
|
|
4172
|
+
provider: z12.enum(["vapid", "fcm", "apns"]).optional()
|
|
4000
4173
|
}
|
|
4001
4174
|
},
|
|
4002
4175
|
async ({ projectId, provider }) => {
|
|
@@ -4040,12 +4213,12 @@ function registerNotificationTools(server, api) {
|
|
|
4040
4213
|
{
|
|
4041
4214
|
description: "Send a push notification to selected users",
|
|
4042
4215
|
inputSchema: {
|
|
4043
|
-
projectId:
|
|
4044
|
-
userIds:
|
|
4045
|
-
title:
|
|
4046
|
-
body:
|
|
4047
|
-
icon:
|
|
4048
|
-
url:
|
|
4216
|
+
projectId: z12.string(),
|
|
4217
|
+
userIds: z12.array(z12.string()).min(1),
|
|
4218
|
+
title: z12.string(),
|
|
4219
|
+
body: z12.string(),
|
|
4220
|
+
icon: z12.string().optional(),
|
|
4221
|
+
url: z12.string().optional()
|
|
4049
4222
|
}
|
|
4050
4223
|
},
|
|
4051
4224
|
async ({ projectId, userIds, title, body: notifBody, icon, url }) => {
|
|
@@ -4071,11 +4244,11 @@ function registerNotificationTools(server, api) {
|
|
|
4071
4244
|
{
|
|
4072
4245
|
description: "Broadcast a push notification to all subscribed users in a project",
|
|
4073
4246
|
inputSchema: {
|
|
4074
|
-
projectId:
|
|
4075
|
-
title:
|
|
4076
|
-
body:
|
|
4077
|
-
icon:
|
|
4078
|
-
url:
|
|
4247
|
+
projectId: z12.string(),
|
|
4248
|
+
title: z12.string(),
|
|
4249
|
+
body: z12.string(),
|
|
4250
|
+
icon: z12.string().optional(),
|
|
4251
|
+
url: z12.string().optional()
|
|
4079
4252
|
}
|
|
4080
4253
|
},
|
|
4081
4254
|
async ({ projectId, title, body: notifBody, icon, url }) => {
|
|
@@ -4099,20 +4272,20 @@ function registerNotificationTools(server, api) {
|
|
|
4099
4272
|
}
|
|
4100
4273
|
|
|
4101
4274
|
// libs/mcp-server/src/tools/auditLogs.ts
|
|
4102
|
-
import { z as
|
|
4275
|
+
import { z as z13 } from "zod";
|
|
4103
4276
|
function registerAuditLogTools(server, api) {
|
|
4104
4277
|
server.registerTool(
|
|
4105
4278
|
"audit_logs_list",
|
|
4106
4279
|
{
|
|
4107
4280
|
description: "List audit logs for a project. Filter by entity type, action, and date range.",
|
|
4108
4281
|
inputSchema: {
|
|
4109
|
-
projectId:
|
|
4110
|
-
entityType:
|
|
4111
|
-
action:
|
|
4112
|
-
startDate:
|
|
4113
|
-
endDate:
|
|
4114
|
-
limit:
|
|
4115
|
-
offset:
|
|
4282
|
+
projectId: z13.string(),
|
|
4283
|
+
entityType: z13.enum(["user", "client", "project", "auth", "database", "storage"]).optional(),
|
|
4284
|
+
action: z13.string().optional(),
|
|
4285
|
+
startDate: z13.string().datetime().optional(),
|
|
4286
|
+
endDate: z13.string().datetime().optional(),
|
|
4287
|
+
limit: z13.number().int().min(1).max(100).optional(),
|
|
4288
|
+
offset: z13.number().int().min(0).optional()
|
|
4116
4289
|
}
|
|
4117
4290
|
},
|
|
4118
4291
|
async ({ projectId, entityType, action, startDate, endDate, limit, offset }) => {
|
|
@@ -4137,8 +4310,8 @@ function registerAuditLogTools(server, api) {
|
|
|
4137
4310
|
{
|
|
4138
4311
|
description: "Get a single audit log entry by ID",
|
|
4139
4312
|
inputSchema: {
|
|
4140
|
-
projectId:
|
|
4141
|
-
logId:
|
|
4313
|
+
projectId: z13.string(),
|
|
4314
|
+
logId: z13.string()
|
|
4142
4315
|
}
|
|
4143
4316
|
},
|
|
4144
4317
|
async ({ projectId, logId }) => {
|
|
@@ -4169,13 +4342,14 @@ function registerAllTools(server, api) {
|
|
|
4169
4342
|
registerFunctionTools(server, api);
|
|
4170
4343
|
registerEmailTemplateTools(server, api);
|
|
4171
4344
|
registerCronJobTools(server, api);
|
|
4345
|
+
registerScheduleTools(server, api);
|
|
4172
4346
|
registerWebhookTools(server, api);
|
|
4173
4347
|
registerNotificationTools(server, api);
|
|
4174
4348
|
registerAuditLogTools(server, api);
|
|
4175
4349
|
}
|
|
4176
4350
|
|
|
4177
4351
|
// libs/mcp-server/src/prompts/database.ts
|
|
4178
|
-
import { z as
|
|
4352
|
+
import { z as z14 } from "zod";
|
|
4179
4353
|
function registerDatabasePrompts(server) {
|
|
4180
4354
|
server.registerPrompt(
|
|
4181
4355
|
"setup-collection",
|
|
@@ -4183,9 +4357,9 @@ function registerDatabasePrompts(server) {
|
|
|
4183
4357
|
title: "Setup Database Collection",
|
|
4184
4358
|
description: "Guide for creating a new database collection with proper security rules. Collections MUST have rules defined before data can be inserted.",
|
|
4185
4359
|
argsSchema: {
|
|
4186
|
-
projectId:
|
|
4187
|
-
collectionName:
|
|
4188
|
-
access:
|
|
4360
|
+
projectId: z14.string().describe("Project ID"),
|
|
4361
|
+
collectionName: z14.string().describe("Name of the collection to create"),
|
|
4362
|
+
access: z14.enum(["public-read", "authenticated", "admin-only"]).optional().describe("Access level (default: admin-only)")
|
|
4189
4363
|
}
|
|
4190
4364
|
},
|
|
4191
4365
|
async ({ projectId, collectionName, access }) => {
|
|
@@ -4250,7 +4424,7 @@ function registerDatabasePrompts(server) {
|
|
|
4250
4424
|
title: "Database Workflow Guide",
|
|
4251
4425
|
description: "Explains how the Spacelr database system works: rules-first approach, collection lifecycle, and security model.",
|
|
4252
4426
|
argsSchema: {
|
|
4253
|
-
projectId:
|
|
4427
|
+
projectId: z14.string().describe("Project ID")
|
|
4254
4428
|
}
|
|
4255
4429
|
},
|
|
4256
4430
|
async ({ projectId }) => {
|
|
@@ -4299,7 +4473,7 @@ function registerDatabasePrompts(server) {
|
|
|
4299
4473
|
}
|
|
4300
4474
|
|
|
4301
4475
|
// libs/mcp-server/src/prompts/functions.ts
|
|
4302
|
-
import { z as
|
|
4476
|
+
import { z as z15 } from "zod";
|
|
4303
4477
|
function registerFunctionPrompts(server) {
|
|
4304
4478
|
server.registerPrompt(
|
|
4305
4479
|
"deploy-function",
|
|
@@ -4307,9 +4481,9 @@ function registerFunctionPrompts(server) {
|
|
|
4307
4481
|
title: "Deploy a Serverless Function",
|
|
4308
4482
|
description: "Step-by-step guide for creating, deploying, and testing a serverless function. Covers the full lifecycle from creation to execution.",
|
|
4309
4483
|
argsSchema: {
|
|
4310
|
-
projectId:
|
|
4311
|
-
name:
|
|
4312
|
-
useCase:
|
|
4484
|
+
projectId: z15.string().describe("Project ID"),
|
|
4485
|
+
name: z15.string().describe("Function name"),
|
|
4486
|
+
useCase: z15.string().optional().describe('What the function should do (e.g. "fetch data from API and store in DB")')
|
|
4313
4487
|
}
|
|
4314
4488
|
},
|
|
4315
4489
|
async ({ projectId, name, useCase }) => {
|