CallToolResult type missing member structuredContent
Describe the bug
When a tool call is made to any tool with a defined outputSchema, the server absolutely blows up if the function implementing the tool call does not include structuredContent.
This structuredContent is included in the data.result of the server's response.
On client side, it definitely gets parsed and included in the CallToolResult object returned by session.call_tool().
All great so far.
However, the definition of CallToolResult class does not allow for a member named structuredContent.
(it also does not allow for a member named structured_content so that's not the issue).
To Reproduce Steps to reproduce the behavior:
- Implement a tool "get_structure" with an outputSchema using the ModelContentProtocol typescript SDK.
- Call that tool from the python SDK:
python result:CallToolResult = await session.call_tool(name="get_structure",arguments={}) print(f"result.structuredContent = {result.structuredContent}") - Notice that the print succeeds
- Notice that pyright complains that Attribute "structuredContent" is unknown
Expected behavior There should be an optional member called structuredContent in the declaration of CallToolResult:
structuredContent: dict[str, Any] | list[Any] | str | int | float | bool | None = None
Screenshots
Additional context Add any other context about the problem here.
I think outputSchema and CallToolResult.structuredContent support is WIP in #685
TypeScript SDK has better support for this.
structuredContent support added in #993 (v1.10.0)