File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { AggregationCursor, FindCursor } from "mongodb";
44import { CallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
55import { OperationType , ToolArgs } from "../../tool.js" ;
66import { DbOperationArgs , MongoDBToolBase } from "../mongodbTool.js" ;
7- import { FindArgs , limitArg } from "./find.js" ;
7+ import { FindArgs } from "./find.js" ;
88import { jsonExportFormat } from "../../../common/exportsManager.js" ;
99import { AggregateArgs } from "./aggregate.js" ;
1010
@@ -21,7 +21,7 @@ export class ExportTool extends MongoDBToolBase {
2121 name : z . literal ( "find" ) ,
2222 arguments : z . object ( {
2323 ...FindArgs ,
24- limit : limitArg ,
24+ limit : FindArgs . limit . removeDefault ( ) ,
2525 } ) ,
2626 } ) ,
2727 z . object ( {
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import { ToolArgs, OperationType } from "../../tool.js";
55import { SortDirection } from "mongodb" ;
66import { checkIndexUsage } from "../../../helpers/indexCheck.js" ;
77
8- export const limitArg = z . number ( ) . optional ( ) . describe ( "The maximum number of documents to return" ) ;
9-
108export const FindArgs = {
119 filter : z
1210 . object ( { } )
@@ -18,7 +16,7 @@ export const FindArgs = {
1816 . passthrough ( )
1917 . optional ( )
2018 . describe ( "The projection, matching the syntax of the projection argument of db.collection.find()" ) ,
21- limit : limitArg . default ( 10 ) ,
19+ limit : z . number ( ) . optional ( ) . default ( 10 ) . describe ( "The maximum number of documents to return" ) ,
2220 sort : z
2321 . object ( { } )
2422 . catchall ( z . custom < SortDirection > ( ) )
You can’t perform that action at this time.
0 commit comments