File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -394,23 +394,6 @@ Structured results are automatically validated against the output schema
394394generated from the annotation. This ensures the tool returns well-typed,
395395validated data that clients can easily process.
396396
397- ##### Validation Timing and Side Effects
398-
399- Output-schema validation happens after the tool function returns. If a tool
400- performs side effects before returning, those side effects are not rolled back
401- when structured-output validation fails.
402-
403- A validation failure means the tool implementation and its declared schema are
404- out of sync. Treat it as a server bug, not as a signal that the operation was
405- safe to retry.
406-
407- For tools with important side effects, prefer patterns that make the state
408- explicit, for example:
409-
410- - return an operation or job identifier and expose completion state separately
411- - separate "start work" from "fetch result" into different tools or resources
412- - keep the structured result shape stable and version schema changes carefully
413-
414397** Note:** For backward compatibility, unstructured results are also
415398returned. Unstructured results are provided for backward compatibility
416399with previous versions of the MCP specification, and are quirks-compatible
Original file line number Diff line number Diff line change @@ -393,6 +393,23 @@ Structured results are automatically validated against the output schema
393393generated from the annotation. This ensures the tool returns well-typed,
394394validated data that clients can easily process.
395395
396+ ##### Validation Timing and Side Effects
397+
398+ Output-schema validation happens after the tool function returns. If a tool
399+ performs side effects before returning, those side effects are not rolled back
400+ when structured-output validation fails.
401+
402+ A validation failure means the tool implementation and its declared schema are
403+ out of sync. Treat it as a server bug, not as a signal that the operation was
404+ safe to retry.
405+
406+ For tools with important side effects, prefer patterns that make the state
407+ explicit, for example:
408+
409+ - return an operation or job identifier and expose completion state separately
410+ - separate "start work" from "fetch result" into different tools or resources
411+ - keep the structured result shape stable and version schema changes carefully
412+
396413** Note:** For backward compatibility, unstructured results are also
397414returned. Unstructured results are provided for backward compatibility
398415with previous versions of the MCP specification, and are quirks-compatible
You can’t perform that action at this time.
0 commit comments