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:
parent
b615fa49b1
commit
140b93980c
1 changed files with 91 additions and 11 deletions
|
|
@ -72,7 +72,7 @@ func TestContentUnmarshalNil(t *testing.T) {
|
|||
}
|
||||
|
||||
// Verify that the Content field was properly populated
|
||||
if cmp.Diff(tt.want, tt.content) != "" {
|
||||
if cmp.Diff(tt.want, tt.content, ctrCmpOpts...) != "" {
|
||||
t.Errorf("Content is not equal: %v", cmp.Diff(tt.content, tt.content))
|
||||
}
|
||||
})
|
||||
|
|
@ -222,3 +222,5 @@ func TestContentUnmarshalNilWithInvalidContent(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
var ctrCmpOpts = []cmp.Option{cmp.AllowUnexported(mcp.CallToolResult{})}
|
||||
|
|
|
|||
Loading…
Reference in a new issue