Skip to content

Commit 913ca2a

Browse files
Address review: use .catchall(z.unknown()) instead of .passthrough()
More semantically correct for JSON Schema objects where additional properties are expected but not validated by Zod.
1 parent 2d3b1a5 commit 913ca2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ export const ToolSchema = BaseMetadataSchema.extend({
964964
properties: z.record(z.string(), AssertObjectSchema).optional(),
965965
required: z.array(z.string()).optional()
966966
})
967-
.passthrough(),
967+
.catchall(z.unknown()),
968968
/**
969969
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
970970
* returned in the structuredContent field of a CallToolResult.
@@ -976,7 +976,7 @@ export const ToolSchema = BaseMetadataSchema.extend({
976976
properties: z.record(z.string(), AssertObjectSchema).optional(),
977977
required: z.array(z.string()).optional()
978978
})
979-
.passthrough()
979+
.catchall(z.unknown())
980980
.optional(),
981981
/**
982982
* Optional additional tool information.

0 commit comments

Comments
 (0)