Skip to content
Merged
10 changes: 10 additions & 0 deletions mcp/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ func (r CallToolResult) MarshalJSON() ([]byte, error) {
}
m["content"] = content

// Marshal StructuredContent if present
if r.StructuredContent != nil {
m["structuredContent"] = r.StructuredContent
}

// Marshal IsError if true
if r.IsError {
m["isError"] = r.IsError
Expand Down Expand Up @@ -526,6 +531,11 @@ func (r *CallToolResult) UnmarshalJSON(data []byte) error {
}
}

// Unmarshal StructuredContent if present
if structured, ok := raw["structuredContent"]; ok {
r.StructuredContent = structured
}

// Unmarshal IsError
if isError, ok := raw["isError"]; ok {
if isErrorBool, ok := isError.(bool); ok {
Expand Down
Loading