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
|
|
@ -159,7 +159,7 @@ func TestStreamableTransports(t *testing.T) {
|
|||
want := &CallToolResult{
|
||||
Content: []Content{&TextContent{Text: "hi foo"}},
|
||||
}
|
||||
if diff := cmp.Diff(want, got); diff != "" {
|
||||
if diff := cmp.Diff(want, got, ctrCmpOpts...); diff != "" {
|
||||
t.Errorf("CallTool() returned unexpected content (-want +got):\n%s", diff)
|
||||
}
|
||||
|
||||
|
|
@ -550,8 +550,6 @@ func resp(id int64, result any, err error) *jsonrpc.Response {
|
|||
}
|
||||
}
|
||||
|
||||
var ()
|
||||
|
||||
func TestStreamableServerTransport(t *testing.T) {
|
||||
// This test checks detailed behavior of the streamable server transport, by
|
||||
// faking the behavior of a streamable client using a sequence of HTTP
|
||||
|
|
|
|||
Loading…
Reference in a new issue