mcp: add CallToolResult.getError (#481)

Provide a way for middleware to get the error from a tool call,
demonstrating that we can add this functionality without making a
breaking change.

Leave getError unexported for now; we can export it (and setError) at
any time.

For #64.
This commit is contained in:
Jonathan Amsterdam 2025-09-18 08:08:23 -04:00 • committed by GitHub
commit 140b93980c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -499,7 +499,7 @@ func TestContentUnmarshal(t *testing.T) {
if err := json.Unmarshal(data, out); err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(in, out); diff != "" {
if diff := cmp.Diff(in, out, ctrCmpOpts...); diff != "" {
t.Errorf("mismatch (-want, +got):\n%s", diff)
}
}