From 01c6adc05462053e468878838f623e8f74e13cdf Mon Sep 17 00:00:00 2001 From: hiracky16 Date: Mon, 30 Mar 2026 06:58:54 +0900 Subject: [PATCH 1/2] fix(tools/looker): address all feedback, enhance robustness, and support agent instructions/update --- .../en/resources/tools/looker/looker-agent.md | 2 +- .../looker/lookeragent/lookeragent_test.go | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/en/resources/tools/looker/looker-agent.md b/docs/en/resources/tools/looker/looker-agent.md index 4d12c015e914..239ed67137ca 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. | | `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 != "" { From 3dda9dda4cf1b60e9208557ddfaa9d7599d76074 Mon Sep 17 00:00:00 2001 From: Noriaki Hiraki Date: Mon, 30 Mar 2026 07:07:27 +0900 Subject: [PATCH 2/2] Update docs/en/resources/tools/looker/looker-agent.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- docs/en/resources/tools/looker/looker-agent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/resources/tools/looker/looker-agent.md b/docs/en/resources/tools/looker/looker-agent.md index 239ed67137ca..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. | +| 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