Skip to content

Commit e20f572

Browse files
committed
refactor: clean up ListDatabases output schema by removing comments and update UI component to handle data correctly
1 parent c0c9a98 commit e20f572

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/tools/mongodb/metadata/listDatabases.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import type { OperationType } from "../../tool.js";
55
import { formatUntrustedData } from "../../tool.js";
66
import { z } from "zod";
77

8-
/**
9-
* Schema for the list-databases tool output.
10-
* Used by the MCP protocol for structured content validation.
11-
*/
128
export const ListDatabasesOutputSchema = {
139
databases: z.array(
1410
z.object({
@@ -19,7 +15,6 @@ export const ListDatabasesOutputSchema = {
1915
totalCount: z.number(),
2016
};
2117

22-
/** Type derived from the output schema */
2318
export type ListDatabasesOutput = z.infer<z.ZodObject<typeof ListDatabasesOutputSchema>>;
2419

2520
export class ListDatabasesTool extends MongoDBToolBase {

src/ui/components/ListDatabases/ListDatabases.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const ListDatabases = (): React.ReactElement | null => {
5050
</HeaderRow>
5151
</TableHead>
5252
<TableBody>
53-
{data?.databases.map((db) => (
53+
{data.databases.map((db) => (
5454
<Row key={db.name}>
5555
<Cell>{db.name}</Cell>
5656
<Cell>{formatBytes(db.size)}</Cell>

0 commit comments

Comments
 (0)