Skip to content

Commit 5823363

Browse files
committed
feat: add ListDatabases output schema for tool and UI validation
1 parent 59c36fc commit 5823363

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

src/ui/components/ListDatabases/schema.ts renamed to src/schemas/listDatabases.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { z } from "zod";
22

33
/**
44
* Shared schema for the list-databases tool output.
5+
* This schema is used by both the tool (for MCP protocol validation)
6+
* and the UI component (for rendering validation).
57
*/
68
export const ListDatabasesOutputSchema = {
79
databases: z.array(

src/tools/mongodb/metadata/listDatabases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MongoDBToolBase } from "../mongodbTool.js";
33
import type * as bson from "bson";
44
import type { OperationType } from "../../tool.js";
55
import { formatUntrustedData } from "../../tool.js";
6-
import { ListDatabasesOutputSchema, type ListDatabasesOutput } from "../../../ui/components/ListDatabases/schema.js";
6+
import { ListDatabasesOutputSchema, type ListDatabasesOutput } from "../../../schemas/listDatabases.js";
77

88
export { ListDatabasesOutputSchema, type ListDatabasesOutput };
99

src/ui/components/ListDatabases/ListDatabases.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TableHead,
1212
} from "@leafygreen-ui/table";
1313
import { tableStyles } from "./ListDatabases.styles.js";
14-
import { ListDatabasesOutputSchema, type ListDatabasesOutput } from "./schema.js";
14+
import { ListDatabasesOutputSchema, type ListDatabasesOutput } from "../../../schemas/listDatabases.js";
1515

1616
const HeaderCell = LGHeaderCell as React.FC<React.ComponentPropsWithoutRef<"th">>;
1717
const Cell = LGCell as React.FC<React.ComponentPropsWithoutRef<"td">>;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export { ListDatabases } from "./ListDatabases.js";
2-
export { ListDatabasesOutputSchema, type ListDatabasesOutput } from "./schema.js";

src/ui/generated/tools/list-databases.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)