ab24c34d89
- pre_parse_json leaves a string alone when json.loads refuses it with something other than JSONDecodeError (over-long integer, deep nesting), so validation rejects it as a bad argument instead of it surfacing as a crash with a traceback per request. - convert_result skips output-schema validation for a returned CallToolResult(is_error=True); an error result has no structured content to check, and the author's message now reaches the client as written. - read_resource checks that Resource.read() returned str or bytes, so a mistyped custom resource is logged as a crash and answered with -32603 rather than "Invalid request parameters" with no log record. - Docs and examples that still said "raise any exception and the model reads it" now say ToolError; deprecated.md lists the deprecated FuncMetadata helper; docstrings spell out the MCPError carve-out and the nested-crash __cause__. - Two tests tightened: the prompt argument-validation test proves the body never ran, and the invalid-types check asserts on validate_arguments.
Python SDK examples
stories/— the canonical reference. One self-verifying example per protocol feature, each with its own README. Start withstories/tools/; the stories README has the full table and how to run them.snippets/— short extracts that were embedded into the v1 README (now on thev1.xbranch); superseded bydocs_src/, which the docs and README embed today. Retained pending consolidation intostories/.servers/everything-server/— the conformance target for the cross-SDK conformance suite. Exercises every server capability in one process.mcpserver/— single-file v1-era examples retained for the migration guide; superseded bystories/and slated for removal.clients/and the remainingservers/directories (simple-*,sse-polling-demo,structured-output-lowlevel) — standalone v1-era projects retained pending consolidation intostories/(thesimple-authpair is still linked fromdocs/run/authorization.mdanddocs/client/oauth-clients.md).
For real-world servers see the servers repository.