Skip to content

Commit cffef1b

Browse files
committed
add ToolResultContent._meta
1 parent 8b02940 commit cffef1b

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/types.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,13 +1186,21 @@ export const ToolChoiceSchema = z
11861186
* The result of a tool execution, provided by the user (server).
11871187
* Represents the outcome of invoking a tool requested via ToolCallContent.
11881188
*/
1189-
export const ToolResultContentSchema = z.object({
1190-
type: z.literal("tool_result"),
1191-
toolUseId: z.string().describe("The unique identifier for the corresponding tool call."),
1192-
content: z.array(ContentBlockSchema).default([]),
1193-
structuredContent: z.object({}).passthrough().optional(),
1194-
isError: z.optional(z.boolean()),
1195-
})
1189+
export const ToolResultContentSchema = z
1190+
.object({
1191+
type: z.literal("tool_result"),
1192+
toolUseId: z.string().describe("The unique identifier for the corresponding tool call."),
1193+
content: z.array(ContentBlockSchema).default([]),
1194+
structuredContent: z.object({}).passthrough().optional(),
1195+
isError: z.optional(z.boolean()),
1196+
1197+
/**
1198+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1199+
* for notes on _meta usage.
1200+
*/
1201+
_meta: z.optional(z.object({}).passthrough()),
1202+
})
1203+
.passthrough();
11961204

11971205
export const UserMessageContentSchema = z.discriminatedUnion("type", [
11981206
TextContentSchema,

0 commit comments

Comments
 (0)