Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

tool response error #198

Open
Open
@Pratik-Kumar-Cse

Description

@Pratik-Kumar-Cse

Describe the bug
If return the tool response like this

return types.CallToolResult(
content=[types.TextContent(type="text", text=json.dumps(result, indent=2))]
)

after tool call this issue coming

error:

meta=None content=[TextContent(type='text', text="9 validation errors for CallToolResult\ncontent.0.TextContent\n Input should be a valid dictionary or instance of TextContent [type=model_type, input_value=('meta', None), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.0.ImageContent\n Input should be a valid dictionary or instance of ImageContent [type=model_type, input_value=('meta', None), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.0.EmbeddedResource\n Input should be a valid dictionary or instance of EmbeddedResource [type=model_type, input_value=('meta', None), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.1.TextContent\n Input should be a valid dictionary or instance of TextContent [type=model_type, input_value=('content', [TextContent(...n}', annotations=None)]), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.1.ImageContent\n Input should be a valid dictionary or instance of ImageContent [type=model_type, input_value=('content', [TextContent(...n}', annotations=None)]), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.1.EmbeddedResource\n Input should be a valid dictionary or instance of EmbeddedResource [type=model_type, input_value=('content', [TextContent(...n}', annotations=None)]), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.2.TextContent\n Input should be a valid dictionary or instance of TextContent [type=model_type, input_value=('isError', False), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.2.ImageContent\n Input should be a valid dictionary or instance of ImageContent [type=model_type, input_value=('isError', False), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type\ncontent.2.EmbeddedResource\n Input should be a valid dictionary or instance of EmbeddedResource [type=model_type, input_value=('isError', False), input_type=tuple]\n For further information visit https://errors.pydantic.dev/2.10/v/model_type", annotations=None)] isError=True

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions