Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1831,8 +1831,13 @@ export const ElicitResultSchema = ResultSchema.extend({
/**
* The submitted form data, only present when action is "accept".
* Contains values matching the requested schema.
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
* We normalize null to undefined for leniency while maintaining type compatibility.
*/
content: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional()
content: z.preprocess(
val => (val === null ? undefined : val),
z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional()
)
});

/* Autocomplete */
Expand Down
Loading