Skip to content

Commit cf45994

Browse files
authored
Merge pull request #10 from syucream/syucream/schemas
fix required params and schemas
2 parents 64aea89 + 64651d9 commit cf45994

File tree

3 files changed

+70
-15
lines changed

3 files changed

+70
-15
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lightdash-mcp-server",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "A MCP(Model Context Protocol) server that accesses to lightdash( https://www.lightdash.com/ )",
55
"main": "dist/index.js",
66
"type": "module",

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
119119

120120
server.setRequestHandler(CallToolRequestSchema, async (request) => {
121121
try {
122-
if (!request.params.arguments) {
123-
throw new Error('Arguments are required');
122+
if (!request.params) {
123+
throw new Error('Params are required');
124124
}
125125

126126
switch (request.params.name) {

src/schemas.ts

+67-12
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,103 @@ import { z } from 'zod';
33
export const ListProjectsSchema = z.object({});
44

55
export const GetProjectSchema = z.object({
6-
projectUuid: z.string(),
6+
projectUuid: z
7+
.string()
8+
.uuid()
9+
.describe(
10+
'The UUID of the project. You can obtain it from the project list.'
11+
),
712
});
813

914
export const ListSpacesSchema = z.object({
10-
projectUuid: z.string(),
15+
projectUuid: z
16+
.string()
17+
.uuid()
18+
.describe(
19+
'The UUID of the project. You can obtain it from the project list.'
20+
),
1121
});
1222

1323
export const ListChartsSchema = z.object({
14-
projectUuid: z.string(),
24+
projectUuid: z
25+
.string()
26+
.uuid()
27+
.describe(
28+
'The UUID of the project. You can obtain it from the project list.'
29+
),
1530
});
1631

1732
export const ListDashboardsSchema = z.object({
18-
projectUuid: z.string(),
33+
projectUuid: z
34+
.string()
35+
.uuid()
36+
.describe(
37+
'The UUID of the project. You can obtain it from the project list.'
38+
),
1939
});
2040

2141
export const GetCustomMetricsSchema = z.object({
22-
projectUuid: z.string(),
42+
projectUuid: z
43+
.string()
44+
.uuid()
45+
.describe(
46+
'The UUID of the project. You can obtain it from the project list.'
47+
),
2348
});
2449

2550
export const GetCatalogSchema = z.object({
26-
projectUuid: z.string(),
51+
projectUuid: z
52+
.string()
53+
.uuid()
54+
.describe(
55+
'The UUID of the project. You can obtain it from the project list.'
56+
),
2757
});
2858

2959
export const GetMetricsCatalogSchema = z.object({
30-
projectUuid: z.string(),
60+
projectUuid: z
61+
.string()
62+
.uuid()
63+
.describe(
64+
'The UUID of the project. You can obtain it from the project list.'
65+
),
3166
});
3267

3368
export const GetChartsAsCodeSchema = z.object({
34-
projectUuid: z.string(),
69+
projectUuid: z
70+
.string()
71+
.uuid()
72+
.describe(
73+
'The UUID of the project. You can obtain it from the project list.'
74+
),
3575
});
3676

3777
export const GetDashboardsAsCodeSchema = z.object({
38-
projectUuid: z.string(),
78+
projectUuid: z
79+
.string()
80+
.uuid()
81+
.describe(
82+
'The UUID of the project. You can obtain it from the project list.'
83+
),
3984
});
4085

4186
export const GetMetadataSchema = z.object({
42-
projectUuid: z.string(),
43-
table: z.string(),
87+
projectUuid: z
88+
.string()
89+
.uuid()
90+
.describe(
91+
'The UUID of the project. You can obtain it from the project list.'
92+
),
93+
table: z.string().min(1, 'Table name cannot be empty'),
4494
});
4595

4696
export const GetAnalyticsSchema = z.object({
47-
projectUuid: z.string(),
97+
projectUuid: z
98+
.string()
99+
.uuid()
100+
.describe(
101+
'The UUID of the project. You can obtain it from the project list.'
102+
),
48103
table: z.string(),
49104
});
50105

0 commit comments

Comments
 (0)