feat(tools/looker): Looker agent management from MCP#2830
feat(tools/looker): Looker agent management from MCP#2830drstrangelooker wants to merge 24 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates a new tool into the system that allows for the programmatic management of Looker Agents. This enhancement provides LLMs with direct capabilities to interact with Looker Agent resources, streamlining automation and extending the platform's reach into Looker's agent ecosystem. The changes include the core implementation of the tool, its registration within the command-line interface, and comprehensive user documentation. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
@hiracky16 lets continue from here so that all the tests run properly. |
|
Do you want this to be in a prebuilt tool set? Also we should have some integration tests in |
There was a problem hiding this comment.
Code Review
This pull request introduces a new looker-agent tool, enabling LLMs to perform CRUD operations (list, get, create, delete) on Looker agents. The changes include the tool's core implementation, registration, documentation, and unit tests. Feedback from the review suggests adhering to naming conventions for tool names as per the style guide, utilizing NewStringParameterWithAllowedValues for more robust parameter validation, and dynamically referencing the tool's name in debug logs for improved maintainability.
|
@hiracky16 I didn't realise you weren't a googler. You may not be able to commit to this branch. If you fork this branch and the set PRs against it I'll merge them in. |
|
@drstrangelooker Thank you for the suggestion. I've significantly expanded the description field in the documentation to include detailed instructions for LLMs, explaining each operation and its required parameters. This should make it much easier for agents to use the tool correctly. |
## Description Addresses the feedback from the maintainers regarding the `looker-agent` tool.
1 similar comment
…r for agent tool (#2864) ## Description This PR significantly enhances the `looker-agent` tool by adding missing parameters required for effective agent management. In the initial implementation, only `name` and `description` (internal) were supported. However, crucial fields for Looker AI Agents such as `instructions` (system prompt), `sources` (data models/explores), and `code_interpreter` were missing. This update fills those gaps and also introduces an update operation. ## Changes - New Parameters: Added `instructions`, `sources` (JSON-encoded array), and `code_interpreter` (boolean) to both `create` and `update` operations. - Update Operation: Implemented the `update` operation to allow modification of existing agents. - Robustness: - Updated error handling to use `http.StatusBadRequest` for client-side validation errors. - Added safety checks for parameter access to prevent runtime panics. - Enhanced Testing: Rewrote and expanded unit tests to cover all new parameters, operations, and validation logic (including MCP manifest verification). - Documentation: Updated the tool's documentation with detailed LLM instructions and usage examples for all new fields. ## Impact The `looker-agent` tool is now fully capable of managing the complete lifecycle and configuration of Looker AI Agents, enabling sophisticated analytical workflows. ## Verification - Comprehensive unit tests added and passed: go test -v ./internal/tools/looker/lookeragent/... - Verified MCP manifest generation and schema correctness.
|
@drstrangelooker Please let me know if there's anything else needed to merge #2830! I'm happy to make further adjustments as required. |
…nality (#2887) …ort agent instructions/update ## Description This PR addresses CI failures observed in #2830 and enhances the `looker-agent` tool with missing functionality and improved robustness. Based on the CI results in #2830, I have fixed the linting issues and the documentation build error. I have also taken this opportunity to implement essential missing features such as agent instructions and update operations. ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [ ] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@hiracky16 I had to refactor the docs to go with the changed documentation structure. |
20e68e0 to
12f5de2
Compare
|
Got this feedback... This new tool doesn't align well with our Style Guide https://mcp-toolbox.dev/reference/style-guide/. Not blocking, but take a look
The most significant violation is the combination of list, get, create, update, and delete operations into a single tool via an operation parameter. Style Guide Rule: "Never mix read and write logic in a single function. This enables clear consent models where users can auto-approve low-risk reads but must manually approve destructive writes" (source). Recommendation: Split the tool into separate tools: list_agents, get_agent, create_agent, update_agent, and delete_agent.
The current tool defines 6 parameters (operation, agent_id, name, instructions, sources, code_interpreter) (source). Style Guide Rule: "Aim for fewer than 5 parameters per tool" (source). Recommendation: Splitting the tool into specific actions (as suggested in point 1) will naturally reduce the parameter count for each tool to a more manageable number (e.g., delete_agent would only need 1 parameter). |
The old doc workflow is deprecated. The doc changes can be previewed in the Cloudfare link. It will be auto-updated with the "deploy doc preview" label. |
|
@hiracky16 I refactored this into 5 tools and set the annotations. Can you take a look and test everything in your environment? |
7845c92 to
0d100d2
Compare
|
@drstrangelooker |
| codeInterpreterParameter := parameters.NewBooleanParameterWithDefault("code_interpreter", false, "Optional. Enables Code Interpreter for this Agent.") | ||
| params := parameters.Parameters{nameParameter, instructionsParameter, sourcesParameter, codeInterpreterParameter} | ||
|
|
||
| annotations := cfg.Annotations |
There was a problem hiding this comment.
I think we shouldn't allow the Toolbox user to overwrite the readOnly annotation for this tool, because it will never be readOnly. If the Toolbox user mis-configure it to be not read-only, it will mislead the client to allow the LLM to execute this tool without end-user approval. Should we fetch the user annotations first, and append readOnly on top of that?
| params := parameters.Parameters{agentIdParameter} | ||
|
|
||
| annotations := cfg.Annotations | ||
| if annotations == nil { |
There was a problem hiding this comment.
Same for this tool - we should make sure the readOnly and destructive annotations cannot be overwritten.
|
|
||
| annotations := cfg.Annotations | ||
| if annotations == nil { | ||
| readOnlyHint := false |
|
|
||
| go 1.25.7 | ||
|
|
||
| toolchain go1.26.1 |
Description
Looker agent management from MCP
PR Checklist
CONTRIBUTING.md
bug/issue
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
!if this involve a breaking change🛠️ Fixes #2827