8000 feat(tool/looker): add data app extension, dashboard, and layout tools by brettguenther · Pull Request #4411 · googleapis/mcp-toolbox · GitHub
[go: up one dir, main page]

Skip to content

feat(tool/looker): add data app extension, dashboard, and layout tools - #4411

Open
brettguenther wants to merge 4 commits into
googleapis:mainfrom
brettguenther:feat/looker-data-app-extensions
Open

brettguenther wants to merge 4 commits into
googleapis:mainfrom
brettguenther:feat/looker-data-app-extensions

Conversation

@brettguenther
Copy link
Copy Markdown
Contributor

Description

Adds native Looker MCP tools and dashboard element support for building, deploying, and managing Looker Data Applications and full-bleed dashboard containers:

create_data_app_extension & update_data_app_extension: Targets Looker's /api/4.0/data_app_extension endpoints with server-enforced dashboard-tile mount points, sandboxed entitlements, and automatic publishedAt metadata stamping via EnsureDataAppMeta.
update_dashboard: Updates Looker dashboards (PATCH /api/4.0/dashboards/:id), enabling full-bleed container styling (show_dashboard_header: false, margins 0, spacing 0, shadows false), titles, and descriptions.
update_dashboard_layout: Updates dashboard layouts (PATCH /api/4.0/dashboard_layouts/:id), enabling switching layout type to "extension" (frameless 100% viewport) and toggling active tabs.
add_dashboard_element & update_dashboard_element: Adds type: "extension" and extension_id support (db:: / app::) with automatic type inference, query generation bypass, and default title_hidden: true.

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
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure you have manually reviewed the entire diff before requesting a
    review
  • 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 #4410

…ard element support

Add native support for Looker Data App Extensions and full-bleed extension
dashboard element mounting and updating.

1. Implement looker-create-data-app-extension tool:
   - Target POST /api/4.0/data_app_extension via Looker SDK transport.
   - Enforce dashboard-tile-only mount points and sandboxed core API entitlements.
   - Validate label, code (up to 5 MB), and auto-generate or validate unique system name.
   - Inject window.__lookerDataAppMeta with publishedAt UTC timestamp.

2. Implement looker-update-data-app-extension tool:
   - Target PATCH /api/4.0/data_app_extension/:data_app_extension_id via Looker SDK transport.
   - Update JavaScript ES module source code in-place on existing tiles.
   - Support optional dashboard_id for contextual edit authorization in shared folders.
   - Validate id formatting and prevent path traversal.

3. Enhance add_dashboard_element and update_dashboard_element:
   - Add type: "extension" and extension_id parameters.
   - Automatically infer type: "extension" when extension_id is present.
   - Bypass query creation and route extension_id directly to WriteDashboardElement.
   - Default title_hidden to true for extension tiles.
   - Automatically configure host dashboard for full-bleed rendering (layout type="extension"
     and zeroed margins/padding/header via best-effort PATCH).

4. Prebuilt configs, integration tests, and documentation:
   - Register tools in looker.yaml prebuilt config under looker-dev and looker_tools groups.
   - Add comprehensive unit tests and integration test parameter manifests.
   - Add Hugo documentation guides with strict H2 ordering and CI validation.
…ools for atomic full-bleed parity

- Add looker-update-dashboard tool for updating dashboard containers, titles, descriptions, and full-bleed appearance settings (show_dashboard_header, margins, tile spacing, shadows)
- Add looker-update-dashboard-layout tool for updating dashboard layouts, switching layout types (extension vs newspaper), active states, and labels
- Remove implicit ConfigureExtensionDashboard side-effects from add_dashboard_element and update_dashboard_element in favor of explicit atomic tools
- Register both tools across prebuilt configs, imports, annotations tests, and integration test suites
- Document the 5-step atomic publishing lifecycle in documentation
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new Looker tools (create_data_app_extension, update_data_app_extension, update_dashboard, and update_dashboard_layout) and updates existing ones (add_dashboard_element and update_dashboard_element) to support Looker Data Applications and Data App Extensions. Feedback on the changes includes removing a redundant wde.Title assignment in lookercommon.go, validating that at least one updatable field is provided in lookerupdatedashboardlayout.go before invoking the update API, and removing the enum field from the expected MCP manifest schema in looker_integration_test.go as allowed values are not emitted in the generated schema.

Comment thread tests/looker/looker_integration_test.go Resolved
@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@drstrangelooker
Copy link
Copy Markdown
Contributor

The integration test failed.

 got map["update_dashboard_layout":map["authRequired":[] "description":"Simple tool to test end to end functionality." "parameters":[map["authServices":[] "description":"The ID of the dashboard layout to update." "name":"dashboard_layout_id" "required":%!q(bool=true) "type":"string"] map["authServices":[] "description":"The layout type for this dashboard layout: 'newspaper' (responsive 24-column grid), 'extension' (frameless full-bleed single extension tile), or 'grid'." "name":"type" "required":%!q(bool=false) "type":"string"] map["authServices":[] "description":"Whether to make this layout the active layout for the dashboard." "name":"active" "required":%!q(bool=false) "type":"boolean"] map["authServices":[] "description":"The display label for this layout tab." "name":"label" "required":%!q(bool=false) "type":"string"]]]]
want map["update_dashboard_layout":map["authRequired":[] "description":"Simple tool to test end to end functionality." "parameters":[map["authServices":[] "description":"The ID of the dashboard layout to update." "name":"dashboard_layout_id" "required":%!q(bool=true) "type":"string"] map["authServices":[] "description":"The layout type for this dashboard layout: 'newspaper' (responsive 24-column grid), 'extension' (frameless full-bleed single extension tile), or 'grid'." "enum":["newspaper" "extension" "grid"] "name":"type" "required":%!q(bool=false) "type":"string"] map["authServices":[] "description":"Whether to make this layout the active layout for the dashboard." "name":"active" "required":%!q(bool=false) "type":"boolean"] map["authServices":[] "description":"The display label for this layout tab." "name":"label" "required":%!q(bool=false) "type":"string"]]]]

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Looker tool(s) to create data apps

3 participants

0