mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-11 23:55:07 -05:00
update tools.go
This commit is contained in:
@@ -320,7 +320,7 @@ func TestMcpEndpointWithoutInitialized(t *testing.T) {
|
||||
Params: map[string]any{
|
||||
"name": "prompt2",
|
||||
"arguments": map[string]any{
|
||||
"arg1": 42, // prompt2 expects a string, we send a number
|
||||
"arg1": 42,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -329,7 +329,7 @@ func TestMcpEndpointWithoutInitialized(t *testing.T) {
|
||||
"id": "prompts-get-invalid-args",
|
||||
"error": map[string]any{
|
||||
"code": -32602.0,
|
||||
"message": `invalid arguments for prompt "prompt2": unable to parse value for "arg1": %!q(float64=42) not type "string"`,
|
||||
"message": `invalid arguments for prompt "prompt2": unable to parse value for %q): %!q(float64=42) not type "string"`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -311,8 +311,8 @@ func RunToolInvokeTest(t *testing.T, select1Want string, options ...InvokeTestOp
|
||||
enabled: true,
|
||||
requestHeader: map[string]string{},
|
||||
requestBody: bytes.NewBuffer([]byte(`{}`)),
|
||||
wantBody: "",
|
||||
wantStatusCode: http.StatusBadRequest,
|
||||
wantBody: `{"error":"parameter \"name\" is required"}`,
|
||||
wantStatusCode: http.StatusOK,
|
||||
},
|
||||
{
|
||||
name: "Invoke my-tool with insufficient parameters",
|
||||
@@ -320,8 +320,8 @@ func RunToolInvokeTest(t *testing.T, select1Want string, options ...InvokeTestOp
|
||||
enabled: true,
|
||||
requestHeader: map[string]string{},
|
||||
requestBody: bytes.NewBuffer([]byte(`{"id": 1}`)),
|
||||
wantBody: "",
|
||||
wantStatusCode: http.StatusBadRequest,
|
||||
wantBody: `{"error":"parameter \"name\" is required"}`,
|
||||
wantStatusCode: http.StatusOK,
|
||||
},
|
||||
{
|
||||
name: "invoke my-array-tool",
|
||||
|
||||
Reference in New Issue
Block a user