Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/resources/tools/looker/looker-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 18 additions & 9 deletions internal/tools/looker/lookeragent/lookeragent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 != "" {
Expand Down