-
Notifications
You must be signed in to change notification settings - Fork 723
Description
Description
When I use the NewStreamableHttpClient of mcp-go version 0.36.0 to perform the callTool operation, I return mcp.NewToolResultStructuredOnly(result) or mcp.NewToolResultStructured(result, "SUCCESS") on the server side. The result is a struct structure. The local test server result struct is as follows:

However, when I use mcp-client to execute the tool through the tool/call method, the StructuredContent parameter does not exist in the returned result. The parameter is nil:

Debug found that in the ParseCallToolResult of CallTool, there was no operation to parse StructuredContent and assign a value. In the returned result, StructuredContent was nil, which caused this problem.
Code Sample
my mcp-server code:

my mcp-client code:

maybe the problem code in mcp-go 0.36.0

Logs or Error Messages
Environment
- Go version (see
go.mod
): 1.23 - mcp-go version (see
go.mod
): 0.36.0 - Any other relevant environment details: Centos 7.5
Possible Solution
when i add resutl.StructuredContent = jsonContent["StructuredContent"] in utils.ParseCallToolResultParseCallToolResult, it will solve this problem