@@ -150,14 +150,14 @@ def test_mcp_client():
150150
151151 # With the new MCPToolResult, structured content is in its own field
152152 assert "structuredContent" in result
153- assert result ["structuredContent" ][ "result" ] == {"echoed" : "STRUCTURED_DATA_TEST" }
153+ assert result ["structuredContent" ] == {"echoed" : "STRUCTURED_DATA_TEST" , 'message_length' : 20 }
154154
155155 # Verify the result is an MCPToolResult (at runtime it's just a dict, but type-wise it should be MCPToolResult)
156156 assert result ["status" ] == "success"
157157 assert result ["toolUseId" ] == tool_use_id
158158
159159 assert len (result ["content" ]) == 1
160- assert json .loads (result ["content" ][0 ]["text" ]) == {"echoed" : "STRUCTURED_DATA_TEST" }
160+ assert json .loads (result ["content" ][0 ]["text" ]) == {"echoed" : "STRUCTURED_DATA_TEST" , 'message_length' : 20 }
161161
162162
163163def test_can_reuse_mcp_client ():
@@ -200,14 +200,14 @@ async def test_mcp_client_async_structured_content():
200200 assert "structuredContent" in result
201201 # "result" nesting is not part of the MCP Structured Content specification,
202202 # but rather a FastMCP implementation detail
203- assert result ["structuredContent" ][ "result" ] == {"echoed" : "ASYNC_STRUCTURED_TEST" }
203+ assert result ["structuredContent" ] == {"echoed" : "ASYNC_STRUCTURED_TEST" , 'message_length' : 21 }
204204
205205 # Verify basic MCPToolResult structure
206206 assert result ["status" ] in ["success" , "error" ]
207207 assert result ["toolUseId" ] == tool_use_id
208208
209209 assert len (result ["content" ]) == 1
210- assert json .loads (result ["content" ][0 ]["text" ]) == {"echoed" : "ASYNC_STRUCTURED_TEST" }
210+ assert json .loads (result ["content" ][0 ]["text" ]) == {"echoed" : "ASYNC_STRUCTURED_TEST" , 'message_length' : 21 }
211211
212212
213213def test_mcp_client_without_structured_content ():
0 commit comments