Skip to content

Build and run agents you can see, understand and trust.

test(mcp): derive the expected tool description from __doc__ (#2611)

GGbondd18876bd41c5
diff --git a/tests/mcp_sse_client_test.py b/tests/mcp_sse_client_test.py
index cc8715d58..326255279 100644
--- a/tests/mcp_sse_client_test.py
+++ b/tests/mcp_sse_client_test.py
@@ -332,10 +332,11 @@ class SseSchemaDefsPreservationTest(IsolatedAsyncioTestCase):
"type": "function",
"function": {
"name": "mcp__test_defs_client__tool_with_model",
- "description": "A tool whose parameter uses a "
- "Pydantic sub-model.\n\n Args:\n "
- "name: Item name.\n "
- "config: Item configuration.\n ",
+ # FastMCP forwards the tool's ``__doc__`` verbatim;
+ # deriving the expectation from it keeps the test
+ # correct under Python 3.13+, where the compiler
+ # strips common leading whitespace from docstrings.
+ "description": tool_with_model.__doc__,
"parameters": {
"$defs": {
"_ItemConfig": {