@@ -16,12 +16,6 @@ describeWithMongoDB("count tool", (integration) => {
16
16
type : "object" ,
17
17
required : false ,
18
18
} ,
19
- {
20
- name : "filter" ,
21
- description : "Alternative name for query parameter. The query filter to count documents." ,
22
- type : "object" ,
23
- required : false ,
24
- } ,
25
19
...databaseCollectionParameters ,
26
20
] ) ;
27
21
@@ -85,43 +79,6 @@ describeWithMongoDB("count tool", (integration) => {
85
79
expect ( content ) . toEqual ( `Found ${ testCase . expectedCount } documents in the collection "foo"` ) ;
86
80
} ) ;
87
81
}
88
-
89
- it ( "correctly filters documents when using 'filter' parameter" , async ( ) => {
90
- await integration . connectMcpClient ( ) ;
91
-
92
- // Using 'filter' parameter - should work correctly after the fix
93
- const response = await integration . mcpClient ( ) . callTool ( {
94
- name : "count" ,
95
- arguments : {
96
- database : integration . randomDbName ( ) ,
97
- collection : "foo" ,
98
- filter : { age : { $lt : 15 } } ,
99
- } ,
100
- } ) ;
101
-
102
- const content = getResponseContent ( response . content ) ;
103
- expect ( content ) . toEqual ( 'Found 2 documents in the collection "foo"' ) ;
104
- } ) ;
105
-
106
- it ( "prioritizes filter over query when both are provided" , async ( ) => {
107
- await integration . connectMcpClient ( ) ;
108
-
109
- // Using both 'filter' and 'query' parameters
110
- const response = await integration . mcpClient ( ) . callTool ( {
111
- name : "count" ,
112
- arguments : {
113
- database : integration . randomDbName ( ) ,
114
- collection : "foo" ,
115
- filter : { age : { $lt : 15 } } ,
116
- query : { age : { $gt : 10 } } ,
117
- } ,
118
- } ) ;
119
-
120
- const content = getResponseContent ( response . content ) ;
121
- // Filter takes precedence over query
122
- // Filter is { age: { $lt: 15 } } which matches 2 documents
123
- expect ( content ) . toEqual ( 'Found 2 documents in the collection "foo"' ) ;
124
- } ) ;
125
82
} ) ;
126
83
127
84
validateAutoConnectBehavior ( integration , "count" , ( ) => {
0 commit comments