Skip to content

Commit a97704b

Browse files
committed
docs: move validation guidance to README.v2
1 parent 61a417f commit a97704b

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -394,23 +394,6 @@ Structured results are automatically validated against the output schema
394394
generated from the annotation. This ensures the tool returns well-typed,
395395
validated 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
415398
returned. Unstructured results are provided for backward compatibility
416399
with previous versions of the MCP specification, and are quirks-compatible

README.v2.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,23 @@ Structured results are automatically validated against the output schema
393393
generated from the annotation. This ensures the tool returns well-typed,
394394
validated 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
397414
returned. Unstructured results are provided for backward compatibility
398415
with previous versions of the MCP specification, and are quirks-compatible

0 commit comments

Comments
 (0)