Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/mongodb/create/insertMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class InsertManyTool extends MongoDBToolBase {
protected argsShape = {
...DbOperationArgs,
documents: z
.array(z.object({}).passthrough().describe("An individual MongoDB document"))
.array(z.record(z.string(), z.unknown()).describe("An individual MongoDB document"))
.describe(
"The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany()"
),
Expand Down
3 changes: 1 addition & 2 deletions src/tools/mongodb/delete/deleteMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export class DeleteManyTool extends MongoDBToolBase {
protected argsShape = {
...DbOperationArgs,
filter: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.optional()
.describe(
"The query filter, specifying the deletion criteria. Matches the syntax of the filter argument of db.collection.deleteMany()"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/mongodb/read/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ToolArgs, OperationType } from "../../tool.js";
import { EJSON } from "bson";

export const AggregateArgs = {
pipeline: z.array(z.object({}).passthrough()).describe("An array of aggregation stages to execute"),
pipeline: z.array(z.record(z.string(), z.unknown())).describe("An array of aggregation stages to execute"),
};

export class AggregateTool extends MongoDBToolBase {
Expand Down
3 changes: 1 addition & 2 deletions src/tools/mongodb/read/count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { z } from "zod";

export const CountArgs = {
query: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.optional()
.describe(
"The query filter to count documents. Matches the syntax of the filter argument of db.collection.count()"
Expand Down
6 changes: 2 additions & 4 deletions src/tools/mongodb/read/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { EJSON } from "bson";

export const FindArgs = {
filter: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.optional()
.describe("The query filter, matching the syntax of the query argument of db.collection.find()"),
projection: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.optional()
.describe("The projection, matching the syntax of the projection argument of db.collection.find()"),
limit: z.number().optional().default(10).describe("The maximum number of documents to return"),
Expand Down
6 changes: 2 additions & 4 deletions src/tools/mongodb/update/updateMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ export class UpdateManyTool extends MongoDBToolBase {
protected argsShape = {
...DbOperationArgs,
filter: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.optional()
.describe(
"The selection criteria for the update, matching the syntax of the filter argument of db.collection.updateOne()"
),
update: z
.object({})
.passthrough()
.record(z.string(), z.unknown())
.describe("An update document describing the modifications to apply using update operator expressions"),
upsert: z
.boolean()
Expand Down
Loading