Skip to content

Commit 5f779a3

Browse files
authored
fix: updates count tool (#254)
1 parent 76cb0d7 commit 5f779a3

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/tools/mongodb/read/count.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ export const CountArgs = {
88
.record(z.string(), z.unknown())
99
.optional()
1010
.describe(
11-
"The query filter to count documents. Matches the syntax of the filter argument of db.collection.count()"
11+
"A filter/query parameter. Allows users to filter the documents to count. Matches the syntax of the filter argument of db.collection.count()."
1212
),
1313
};
1414

1515
export class CountTool extends MongoDBToolBase {
1616
protected name = "count";
17-
protected description = "Gets the number of documents in a MongoDB collection";
17+
protected description =
18+
"Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter";
1819
protected argsShape = {
1920
...DbOperationArgs,
2021
...CountArgs,

tests/integration/tools/mongodb/read/count.test.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@ import {
88
} from "../../../helpers.js";
99

1010
describeWithMongoDB("count tool", (integration) => {
11-
validateToolMetadata(integration, "count", "Gets the number of documents in a MongoDB collection", [
12-
{
13-
name: "query",
14-
description:
15-
"The query filter to count documents. Matches the syntax of the filter argument of db.collection.count()",
16-
type: "object",
17-
required: false,
18-
},
19-
...databaseCollectionParameters,
20-
]);
11+
validateToolMetadata(
12+
integration,
13+
"count",
14+
"Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter",
15+
[
16+
{
17+
name: "query",
18+
description:
19+
"A filter/query parameter. Allows users to filter the documents to count. Matches the syntax of the filter argument of db.collection.count().",
20+
type: "object",
21+
required: false,
22+
},
23+
...databaseCollectionParameters,
24+
]
25+
);
2126

2227
validateThrowsForInvalidArguments(integration, "count", [
2328
{},

0 commit comments

Comments
 (0)