diff --git a/docs/en/resources/tools/looker/looker-agent.md b/docs/en/resources/tools/looker/looker-agent.md index 4d12c015e914..ba185e8f1e2b 100644 --- a/docs/en/resources/tools/looker/looker-agent.md +++ b/docs/en/resources/tools/looker/looker-agent.md @@ -52,7 +52,7 @@ tools: | `agent_id` | `string` | No | The ID of the agent. Required for `get`, `update`, and `delete` operations. | | `name` | `string` | No | The name of the agent. Required for `create` operation. | | `instructions` | `string` | No | The instructions (system prompt) for the agent. Used for `create` and `update` operations. | -| `sources` | `array` | No | Optional. A list of JSON-encoded data sources (e.g., `["{\"model\": \"m\", \"explore\": \"e\"}"]`). | +| sources | array | No | Optional. A list of JSON-encoded data sources, where each is a string with 'model' and 'explore' keys. | | `code_interpreter` | `boolean` | No | Optional. Enables Code Interpreter for this Agent. | ## Operations diff --git a/internal/tools/looker/lookeragent/lookeragent_test.go b/internal/tools/looker/lookeragent/lookeragent_test.go index 8f8d99611a43..7adf346b542c 100644 --- a/internal/tools/looker/lookeragent/lookeragent_test.go +++ b/internal/tools/looker/lookeragent/lookeragent_test.go @@ -94,7 +94,7 @@ func TestFailParseFromYamlLookerAgent(t *testing.T) { method: GOT description: some description `, - err: "error unmarshaling tool: unable to parse tool \"agent_manage\" as type \"looker-agent\": [3:1] unknown field \"method\"\n 1 | authRequired: []\n 2 | description: some description\n> 3 | method: GOT\n ^\n 4 | name: agent_manage\n 5 | source: my-instance\n 6 | type: looker-agent", + err: "unknown field \"method\"", }, } for _, tc := range tcs { @@ -116,9 +116,18 @@ type MockSource struct { sources.Source } -func (m MockSource) UseClientAuthorization() bool { return false } -func (m MockSource) GetAuthTokenHeaderName() string { return "Authorization" } -func (m MockSource) LookerApiSettings() *rtl.ApiSettings { return &rtl.ApiSettings{} } +func (m MockSource) UseClientAuthorization() bool { + return false +} + +func (m MockSource) GetAuthTokenHeaderName() string { + return "Authorization" +} + +func (m MockSource) LookerApiSettings() *rtl.ApiSettings { + return &rtl.ApiSettings{} +} + func (m MockSource) GetLookerSDK(string) (*v4.LookerSDK, error) { return &v4.LookerSDK{}, nil } @@ -137,14 +146,14 @@ func TestInvokeLookerAgentValidation(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %s", err) } - + cfg := lkr.Config{ Name: "agent_manage", Type: "looker-agent", Source: "my-instance", Description: "test description", } - + tool, err := cfg.Initialize(nil) if err != nil { t.Fatalf("failed to initialize tool: %v", err) @@ -225,7 +234,7 @@ func TestManifestLookerAgent(t *testing.T) { Source: "my-instance", Description: "test description", } - + tool, err := cfg.Initialize(nil) if err != nil { t.Fatalf("failed to initialize tool: %v", err) @@ -258,7 +267,7 @@ func TestMcpManifestLookerAgent(t *testing.T) { Source: "my-instance", Description: "test description", } - + tool, err := cfg.Initialize(nil) if err != nil { t.Fatalf("failed to initialize tool: %v", err) @@ -290,7 +299,7 @@ func TestMcpManifestLookerAgent(t *testing.T) { if opParam == nil { t.Fatal("operation parameter not found via GetParameters") } - + gotAllowed := opParam.GetAllowedValues() wantAllowed := []any{"list", "get", "create", "update", "delete"} if diff := cmp.Diff(wantAllowed, gotAllowed, cmpopts.SortSlices(func(a, b any) bool { return a.(string) < b.(string) })); diff != "" {