Skip to content

CallToolResult type missing member structuredContent #810

Closed

Description

@stevemadere

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:

  1. Implement a tool "get_structure" with an outputSchema using the ModelContentProtocol typescript SDK.
  2. Call that tool from the python SDK:
    python result:CallToolResult = await session.call_tool(name="get_structure",arguments={}) print(f"result.structuredContent = {result.structuredContent}")
  3. Notice that the print succeeds
  4. 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

Image

Additional context
Add any other context about the problem here.

Activity

  1. imfing commented on May 26, 2025

    @imfing

    I think outputSchema and CallToolResult.structuredContent support is WIP in #685

    TypeScript SDK has better support for this.

  2. self-assigned this
    on Jul 9, 2025
  3. bhosmer-ant commented on Jul 9, 2025

    @bhosmer-ant
    Contributor

    structuredContent support added in #993 (v1.10.0)

  4. moved this from To triage to Done in 🐛 🛠on Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions