From f67838e03730531d4ad3a48ac4d2c8b01fe8689d Mon Sep 17 00:00:00 2001
From: gagik <me@gagik.co>
Date: Mon, 28 Apr 2025 15:33:53 +0200
Subject: [PATCH 1/2] fix: use record instead of passthrough object

---
 src/tools/mongodb/create/insertMany.ts | 2 +-
 src/tools/mongodb/delete/deleteMany.ts | 3 +--
 src/tools/mongodb/read/aggregate.ts    | 2 +-
 src/tools/mongodb/read/count.ts        | 3 +--
 src/tools/mongodb/read/find.ts         | 6 ++----
 src/tools/mongodb/update/updateMany.ts | 6 ++----
 6 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/tools/mongodb/create/insertMany.ts b/src/tools/mongodb/create/insertMany.ts
index eb624275d..f28d79d5d 100644
--- a/src/tools/mongodb/create/insertMany.ts
+++ b/src/tools/mongodb/create/insertMany.ts
@@ -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()"
             ),
diff --git a/src/tools/mongodb/delete/deleteMany.ts b/src/tools/mongodb/delete/deleteMany.ts
index 9e6e9fdea..6b8351efb 100644
--- a/src/tools/mongodb/delete/deleteMany.ts
+++ b/src/tools/mongodb/delete/deleteMany.ts
@@ -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()"
diff --git a/src/tools/mongodb/read/aggregate.ts b/src/tools/mongodb/read/aggregate.ts
index c5824785f..c1a46c71b 100644
--- a/src/tools/mongodb/read/aggregate.ts
+++ b/src/tools/mongodb/read/aggregate.ts
@@ -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 {
diff --git a/src/tools/mongodb/read/count.ts b/src/tools/mongodb/read/count.ts
index 188648d5a..bd86169b5 100644
--- a/src/tools/mongodb/read/count.ts
+++ b/src/tools/mongodb/read/count.ts
@@ -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()"
diff --git a/src/tools/mongodb/read/find.ts b/src/tools/mongodb/read/find.ts
index e0f806b0d..c117cf58f 100644
--- a/src/tools/mongodb/read/find.ts
+++ b/src/tools/mongodb/read/find.ts
@@ -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"),
diff --git a/src/tools/mongodb/update/updateMany.ts b/src/tools/mongodb/update/updateMany.ts
index c11d8a49a..187e4633d 100644
--- a/src/tools/mongodb/update/updateMany.ts
+++ b/src/tools/mongodb/update/updateMany.ts
@@ -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()

From e839c6b62fd90922181698e09a64728a1fccd964 Mon Sep 17 00:00:00 2001
From: gagik <me@gagik.co>
Date: Mon, 28 Apr 2025 16:18:21 +0200
Subject: [PATCH 2/2] chore: force ci run