This article covers the MCP setup and configuration for using Looker and underlying Gemini LLM with Gemini CLI to enhance and extend Looker operations over MCP.
What is Looker?
Looker is a cloud-based business intelligence (BI) and data analytics platform owned by Google Cloud that enables organizations to analyze, visualize, and share data in real-time. It uses a unique modeling language called LookML to define data relationships, offering a centralized “single source of truth” for metrics. Looker focuses on embedded analytics and live data exploration rather than storing data itself.
More information is available here:
Looker business intelligence platform embedded analytics
Key Features and Capabilities
- LookML (Looker Modeling Language): A code-based modeling language that allows data analysts to define dimensions, aggregates, and calculations, ensuring consistent metrics across the organization.
- Live Data Connection: Looker does not import data; it queries your data warehouse directly (e.g., BigQuery, Snowflake, Redshift) in real-time, ensuring data is always up to date.
- Embedded Analytics: Looker can be embedded into other applications, websites, or portals, allowing businesses to provide data insights directly within their own tools.
- Self-Service BI: Users can explore data, create visualizations, and build custom dashboards using a browser-based interface without needing deep SQL knowledge.
- Workflow Integration: Actionable data insights can be sent directly to other applications, such as triggering an email based on specific business rules.
Looker? I thought Big Query Did everything!
Semantic layer is where all the cool kids hang out.
What is MCP?
Unless you have been living off grid without Internet- MCP is the new universal connector and next “Big Thing”.
More information is here:
What is Model Context Protocol (MCP)? A guide
Google MCP Strategy
Google has gone all-in for all the core Cloud services to provide connections over MCP. An overview is here:
Google Cloud MCP servers overview | Google Cloud Documentation
MCP Toolbox
MCP Toolbox is the “swiss army” knife that connects your data sources to MCP.
Use Looker with MCP, Gemini CLI and other Agents | Google Cloud Documentation
Looker MCP Setup
For a mode detailed step by step setup instructions — there is a full codelab that goes through the setup:
Connect Gemini CLI to Looker with MCP Toolbox | Google Codelabs
and a further deep dive is here:
Use Looker with MCP, Gemini CLI and other Agents | Google Cloud Documentation
Gemini CLI
If not pre-installed you can download the Gemini CLI to interact with the source files and provide real-time assistance:
npm install -g @google/gemini-cli
Testing the Gemini CLI Environment
Once you have all the tools and the correct Node.js version in place- you can test the startup of Gemini CLI. You will need to authenticate with a Key or your Google Account:
▝▜▄ Gemini CLI v0.33.1
▝▜▄
▗▟▀ Logged in with Google /auth
▝▀ Gemini Code Assist Standard /upgrade no sandbox (see /docs) /model Auto (Gemini 3) | 239.8 MB
Google Skills Repository
Google Skills give your MCP client well known approaches to work with the core Google products including Big Query.
The full details are here:
Level Up Your Agents: Announcing Google's Official Skills Repository | Google Cloud Blog
To install the Skills in Gemini CLI:
npx skills install github.com/google/skills
What you talkin ‘bout Willis?
That was a lot of setup! But wait- there is more! So what is different about this lab compared to all the others out there?
This demo is one of the first deep dives into configuring Looker for MCP. Gemini CLI provides a complete working environment with a full MCP client. Looker exposes the key features of the platform over the MCP layer.
Where do I start?
The strategy for configuring Looker with MCP is a incremental step by step approach.
First, the Looker configuration settings are retrieved. Then, these settings are used to configure Gemini CLI. Finally- Gemini CLI is used as a MCP client to the Looker environment. Several samples are run using the Looker MCP Tools directly from Gemini CLI.
Looker Admin Setup
For Looker (Google Cloud core) — Admins do not directly create keys for standard users; instead, they enable the permission for users to manage their own.
Navigate to the Looker Admin Users page (Admin > Users).
- Click Edit next to the specific user.
- Locate the API Keys field and toggle it to Enabled.
- Once enabled, the user can generate their own keys by going to their personal Account settings page (User Icon > Account > API Keys).
Looker Instance URL
To connect to the Looker setup — you need to derive your Looker Base URL. Typically this will be the hostname in the Looker app domain.
For the test instance- this is an example of what the URL looks like (note the HTTPS prefix and no trailing slash):
https://780eb09e-7dab-4076-9ec1-ecf9d8414630.looker.app
Looker User Setup
First Login to your Looker User environment. Go to Profile->Account (in upper right hand side) and bring up the user settings:
If the API Key box is unavailable- contact your Admin to enable the API setup on a per user basis.
Once you have access to create API keys- the settings will look similar to this:
Then click the “Manage” button to setup the API Keys:
Click Create New API key to generate the API Key. Save the Client ID and Client Secret.
Setup the Basic Gemini CLI Environment
At this point you should have a working Shell environment and a working Gemini CLI installation. All of the relevant code examples and documentation is available in GitHub.
The next step is to clone the GitHub repository to your local environment:
cd ~
git clone https://github.com/xbill9/looker-mcp
cd looker-mcp
Then run init.sh from the cloned directory.
The script will attempt to determine your shell environment and set the correct variables:
source init.sh
If your session times out or you need to re-authenticate- you can run the set_env.sh script to reset your environment variables:
source set_env.sh
Variables like PROJECT_ID need to be setup for use in the various build scripts- so the set_env script can be used to reset the environment if you time-out.
Initial Connection
Start up Gemini CLI after all the environment variables have been set:
xbill@penguin:~/looker-mcp$ gemini
▝▜▄ Gemini CLI v0.40.0
▝▜▄
▗▟▀ Signed in with Google /auth
▝▀ Plan: Gemini Code Assist Standard /upgrade
? for shortcuts
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Shift+Tab to accept edits 2 GEMINI.md files · 4 MCP servers · 13 skills
> Type your message or @path/to/file
Then use the /mcp list :
🟢 looker-toolbox - Ready (18 tools)
Tools:
- mcp_looker-toolbox_add_dashboard_element
- mcp_looker-toolbox_add_dashboard_filter
- mcp_looker-toolbox_generate_embed_url
- mcp_looker-toolbox_get_dashboards
- mcp_looker-toolbox_get_dimensions
- mcp_looker-toolbox_get_explores
- mcp_looker-toolbox_get_filters
- mcp_looker-toolbox_get_looks
- mcp_looker-toolbox_get_measures
- mcp_looker-toolbox_get_models
- mcp_looker-toolbox_get_parameters
- mcp_looker-toolbox_make_dashboard
- mcp_looker-toolbox_make_look
- mcp_looker-toolbox_query
- mcp_looker-toolbox_query_sql
- mcp_looker-toolbox_query_url
- mcp_looker-toolbox_run_dashboard
- mcp_looker-toolbox_run_look
All Right Already! Can you actually do something with Looker?
At this point- Gemini CLI is setup with the MCP Toolbox and has direct access to all the Looker MCP Tools. Any operations with the Tools come back directly into the Gemini CLI Context.
To get an overview of Dashboards:
> get_dashboards
Searching Dashboards: Searching for Looker dashboards.
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Action Required │
│ │
│ ? get_dashboards (looker-toolbox MCP Server) {"limit":10} │
│ │
│ MCP Server: looker-toolbox │
│ Tool: get_dashboards │
│ │
│ MCP Tool Details: │
│ (press Ctrl+O to expand MCP tool details) │
│ Allow execution of MCP tool "get_dashboards" from server "looker-toolbox"? │
│ │
│ ● 1. Allow once │
│ 2. Allow tool for this session │
│ 3. Allow all server tools for this session │
│ 4. Allow tool for all future sessions ~/.gemini/policies/auto-saved.toml │
│ 5. No, suggest changes (esc) │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Searching Dashboards: Searching for Looker dashboards.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_dashboards (looker-toolbox MCP Server) {"limit":10} │
│ │
│ {"description":"","id":"2","title":"1) Business Pulse - Basic visualization examples"} │
│ {"description":"","id":"1","title":"2) Business Pulse - Intermediate visualization examples"} │
│ {"description":"","id":"3","title":"3) Business Pulse - Advanced visualization examples"} │
│ {"description":"","id":"4","title":"Agreement for Shared Use of this Looker Instance"} │
│ {"description":"","id":"7","title":"Inventory"} │
│ {"description":"","id":"11","title":"My Dashboard"} │
│ {"description":"","id":"9","title":"Self-serve industry"} │
│ {"description":"","id":"5","title":"test"} │
│ {"description":"","id":"6","title":"test"} │
│ {"description":"","id":"12","title":"test-orders"} │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I have retrieved the following dashboards from Looker:
* Business Pulse - Basic visualization examples (ID: 2)
* Business Pulse - Intermediate visualization examples (ID: 1)
* Business Pulse - Advanced visualization examples (ID: 3)
* Inventory (ID: 7)
* My Dashboard (ID: 11)
* Self-serve industry (ID: 9)
* Agreement for Shared Use of this Looker Instance (ID: 4)
* test (IDs: 5, 6)
* test-orders (ID: 12)
Topic: Finished searching for Looker dashboards.
You can also get models:
> get_models
Retrieving LookML Models: Retrieving available LookML models from Looker.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_models (looker-toolbox MCP Server) {} │
│ │
│ {"connections":["default_bigquery_connection"],"label":"Z) Sample LookML","name":"basic_ecomm","project_name":"sample_thelook_ecommerce"} │
│ {"connections":["default_bigquery_connection"],"label":"Z) Sample │
│ LookML","name":"intermediate_ecomm","project_name":"sample_thelook_ecommerce"} │
│ {"connections":["default_bigquery_connection"],"label":"Z) Sample │
│ LookML","name":"advanced_ecomm","project_name":"sample_thelook_ecommerce"} │
│ {"connections":["default_bigquery_connection"],"label":"Extension-api-explorer","name":"extension-api-explorer","project_name":"marketplac │
│ e_extension_api_explorer"} │
│ {"connections":["american-community-survey"],"label":"Census Data │
│ Block","name":"data_block_acs_bigquery","project_name":"marketplace_acs_census-v2"} │
│ {"connections":["billing-export-sample"],"label":"Google Cloud │
│ Billing","name":"gcp_billing_block","project_name":"marketplace_gcp-billing"} │
│ {"connections":["chrome-ux"],"label":"Chrome-ux-block","name":"chrome-ux-block","project_name":"marketplace_chrome-ux-block"} │
│ {"connections":["london-bicycles"],"label":"London Bicycles","name":"london_bicycles","project_name":"london_bicycles"} │
│ {"connections":["default_bigquery_connection","american-community-survey","gcp-billing-export","billing-export-sample","london-bicycles"," │
│ chrome-ux","crux-demo","self_service_connection"],"label":"Gde Rk","name":"gde_rk","project_name":"gde_rk"} │
│ {"connections":["default_bigquery_connection"],"label":"Data-dictionary","name":"data-dictionary","project_name":"marketplace_extension_da │
│ ta_dictionary"} │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I have retrieved the following LookML models:
* basic_ecomm (Sample LookML)
* intermediate_ecomm (Sample LookML)
* advanced_ecomm (Sample LookML)
* data_block_acs_bigquery (Census Data Block)
* gcp_billing_block (Google Cloud Billing)
* london_bicycles (London Bicycles)
* gde_rk (Gde Rk)
* extension-api-explorer
* chrome-ux-block
* data-dictionary
And drill into the details:
Topic: Finished retrieving LookML models.
Exploring 'basic_ecomm' Model: Exploring the 'basic_ecomm' model by listing its available explores.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_explores (looker-toolbox MCP Server) {"model":"basic_ecomm"} │
│ │
│ { │
│ "group_label": "Z) Sample LookML", │
│ "label": "1) Basic Ecommerce", │
│ "name": "basic_order_items" │
│ } │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The basic_ecomm model contains one explore:
* basic_order_items (Label: 1) Basic Ecommerce)
I can now look into the fields (dimensions and measures) available in this explore. For example:
* get_dimensions(model="basic_ecomm", explore="basic_order_items")
* get_measures(model="basic_ecomm", explore="basic_order_items")
Which would you like to see?
Topic: Finished listing explores for 'basic_ecomm'.
Inspecting 'basic_order_items' Fields: Retrieving dimensions and measures for the 'basic_order_items' explore.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_dimensions (looker-toolbox MCP Server) {"model":"basic_ecomm","explore":"basic_order_items"} │
│ │
│ :"string"} │
│ {"description":"","label":"Basic Users Traffic Source","label_short":"Traffic │
│ Source","name":"basic_users.traffic_source","suggest_dimension":"basic_users.traffic_source","suggest_explore":"basic_order_items","type": │
│ "string"} │
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ get_measures (looker-toolbox MCP Server) {"model":"basic_ecomm","explore":"basic_order_items"} │
│ │
│ {"description":"","label":"Basic Order Items # of Order Items","label_short":"# of Order │
│ Items","name":"basic_order_items.count","type":"count"} │
│ {"description":"","label":"Basic Order Items Average Sale Price","label_short":"Average Sale │
│ Price","name":"basic_order_items.average_sale_price","type":"average"} │
│ {"description":"","label":"Basic Order Items Total Sale Price","label_short":"Total Sale │
│ Price","name":"basic_order_items.total_sale_price","type":"sum"} │
│ {"description":"","label":"Basic Users # of Users","label_short":"# of Users","name":"basic_users.count","type":"count_distinct"} │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I have retrieved the fields for the basic_order_items explore in the basic_ecomm model.
Dimensions (Selected)
* Order Items: id, order_id, product_id, user_id, sale_price, status, is_returned_or_cancelled, created_at_date, etc.
* Users: id, age, city, country, email, first_name, last_name, gender, state, traffic_source, etc.
Measures
* Order Items: # of Order Items (count), Average Sale Price, Total Sale Price.
* Users: # of Users (count_distinct).
Would you like to run a query now? For example, I can find the Total Sale Price by Country:
1 {
2 "model": "basic_ecomm",
3 "explore": "basic_order_items",
4 "fields": ["basic_users.country", "basic_order_items.total_sale_price"],
5 "sorts": ["basic_order_items.total_sale_price desc"]
6 }
Topic: Finished retrieving dimensions and measures for 'basic_order_items'.
and dig deeper on the details:
✦ The query results for Total Sale Price by Country are as follows:
┌────────────────┬──────────────────┐
│ Country │ Total Sale Price │
├────────────────┼──────────────────┤
│ China │ $3,656,547.09 │
│ United States │ $2,398,185.92 │
│ Brasil │ $1,574,674.07 │
│ South Korea │ $594,970.98 │
│ France │ $490,676.84 │
│ United Kingdom │ $479,962.79 │
│ Germany │ $446,794.18 │
│ Spain │ $435,088.01 │
│ Japan │ $270,070.96 │
│ Australia │ $233,582.97 │
│ Belgium │ $132,333.52 │
│ Poland │ $26,173.09 │
│ Colombia │ $1,446.15 │
│ Austria │ $583.15 │
│ España │ $87.99 │
└────────────────┴──────────────────┘
Gemini CLI has full access to the context:
✦ I've generated a bar chart visualization for the "Total Sale Price by Country" data. You can view it here:
View Bar Chart: Total Sale Price by Country (https://780eb09e-7dab-4076-9ec1-ecf9d8414630.looker.app/x/64Y0XsV1oxPpa5fhCjIhje)
What's Next?
We could:
1. Analyze Trends: View "Total Sale Price by Month" to see growth over time.
2. Segment by Traffic Source: See which marketing channels (basic_users.traffic_source) drive the most revenue.
3. Explore More Models: Switch to the intermediate_ecomm or advanced_ecomm models to see more complex relationships and data.
What would you like to explore?
Visualize the Query:
But Wait! There’s More!
Once the Tools are exposed by MCP -they have full access to Looker resources:
✦ I've retrieved the structure of the "Business Pulse - Basic visualization examples" dashboard (ID: 2). It includes several key performance
indicators (KPIs) and visualizations:
Dashboard Tiles:
1. Total Items: Overall volume of items.
2. Average Sale Price: The mean price per item.
3. Unique Users: Count of distinct customers.
4. # of Order Items vs Avg Sale Price Over Time: Correlation and trend analysis.
5. New Users with Orders: Tracking customer acquisition.
6. Highest Spending Users: Identification of VIP customers.
7. New Users by Date and Source: Growth by marketing channel.
8. Users by Traffic Source and Country: Geographical and channel distribution.
Deep Dive: Highest Spending Users
Let's look at the data for one of these tiles—"Highest Spending Users"—to see who the top customers are:
Analyzing Top Customers: Analyzing the 'Highest Spending Users' tile from the dashboard.
and find the biggest customers:
Deep Dive: Highest Spending Users
Let's look at the data for one of these tiles—"Highest Spending Users"—to see who the top customers are:
Analyzing Top Customers: Analyzing the 'Highest Spending Users' tile from the dashboard.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ query (looker-toolbox MCP Server) {"model":"basic_ecomm","fields":["basic_users.first_name","basic_users.last_name","basic_order_items… │
│ │
│ {"basic_order_items.total_sale_price":6942.0700097084045,"basic_users.first_name":"Michael","basic_users.last_name":"Smith"} │
│ {"basic_order_items.total_sale_price":4528.939993858337,"basic_users.first_name":"James","basic_users.last_name":"Smith"} │
│ {"basic_order_items.total_sale_price":4340.889998435974,"basic_users.first_name":"Michael","basic_users.last_name":"Johnson"} │
│ {"basic_order_items.total_sale_price":4325.510012626648,"basic_users.first_name":"Jennifer","basic_users.last_name":"Smith"} │
│ {"basic_order_items.total_sale_price":4184.879993438721,"basic_users.first_name":"Michael","basic_users.last_name":"Williams"} │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The top 5 highest spending users in the system are:
┌──────────────────┬─────────────┐
│ Name │ Total Spent │
├──────────────────┼─────────────┤
│ Michael Smith │ $6,942.07 │
│ James Smith │ $4,528.94 │
│ Michael Johnson │ $4,340.89 │
│ Jennifer Smith │ $4,325.51 │
│ Michael Williams │ $4,184.88 │
└──────────────────┴─────────────┘
And build a Dashboard:
Topic: Finished creating the Look and summarizing progress.
Building 'E-commerce Overview' Dashboard: Creating a new 'E-commerce Overview' dashboard and adding tiles.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ make_dashboard (looker-toolbox MCP Server) {"title":"E-commerce Overview","description":"A custom dashboard showing key e-commerce met… │
│ │
│ { │
│ "id": "13", │
│ "url": "/dashboards/2knvCKoWEAIR0eGVnMHCpR" │
│ } │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ add_dashboard_element (looker-toolbox MCP Server) {"sorts":["basic_order_items.total_sale_price desc"],"model":"basic_ecomm","dashboar… │
│ │
│ { │
│ "result": "Dashboard element added to dashboard 13" │
│ } │
│ │
│ ✓ add_dashboard_element (looker-toolbox MCP Server) {"sorts":["basic_order_items.total_sale_price desc"],"wait_for_previous":false,"mode… │
│ │
│ { │
│ "result": "Dashboard element added to dashboard 13" │
│ } │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ generate_embed_url (looker-toolbox MCP Server) {"type":"dashboards","id":"13"} │
│ │
│ { │
│ "url": │
│ "https://780eb09e-7dab-4076-9ec1-ecf9d8414630.looker.app/login/embed?t=AgEMAAnoTcsRZn80GTacAC8BR03N2zaikccLfI1KTrDZiCzVYrPPKToEc6qnba3aALl │
│ NfjwvHsGRVlh2NmI1VwDFMOkVFOlAOyqVhtGw12OK5isyRe09yAOijS-QTPPh2dhuFXKnvtsxAKz2ntgKkdLYq_EtCbVKAT8XSGaucuQDu9PJvp-xA4YgxcOaDKRs6_jRCIe_pQBxl │
│ zjcrJAVzwkWTc1EhLAvnE6ZC5_0RFDUP9Yvhlt05FkZLfUfg5zeZRUrD1-yFx5jeh5wrQ0nYiNzVuVTVUU5fxLdz8amM-cBW3VViTH_gyRozVltUAQ6DJtQJ5SjBH3uXq5q-aRZDZ4 │
│ K2CgmtMk96s2V_cufYJLXtJLQeYcLq8RtUmfKOj-z7UTQF1geMwUN78fFGJYskLY9tDnwzG8sMaQxi5VE0s5MYUiSL5hgxppPBwjAuQRX" │
│ } │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I've created a custom dashboard titled "E-commerce Overview" (ID: 13) and added two informative tiles to it:
1. Total Sales by Country: A bar chart visualizing revenue across different countries.
2. Top 10 VIP Customers: A grid view of your highest-spending users.
You can view the new dashboard here:
View Dashboard: E-commerce Overview (https://780eb09e-7dab-4076-9ec1-ecf9d8414630.looker.app/dashboards/13)
(Note: If you have embed permissions, you can also use this Private Embed Link
(https://780eb09e-7dab-4076-9ec1-ecf9d8414630.looker.app/login/embed?t=AgEMAAnoTcsRZn80GTacAC8BR03N2zaikccLfI1KTrDZiCzVYrPPKToEc6qnba3aALlNfjwvH
sGRVlh2NmI1VwDFMOkVFOlAOyqVhtGw12OK5isyRe09yAOijS-QTPPh2dhuFXKnvtsxAKz2ntgKkdLYq_EtCbVKAT8XSGaucuQDu9PJvp-xA4YgxcOaDKRs6_jRCIe_pQBxlzjcrJAVzwkWT
c1EhLAvnE6ZC5_0RFDUP9Yvhlt05FkZLfUfg5zeZRUrD1-yFx5jeh5wrQ0nYiNzVuVTVUU5fxLdz8amM-cBW3VViTH_gyRozVltUAQ6DJtQJ5SjBH3uXq5q-aRZDZ4K2CgmtMk96s2V_cufY
JLXtJLQeYcLq8RtUmfKOj-z7UTQF1geMwUN78fFGJYskLY9tDnwzG8sMaQxi5VE0s5MYUiSL5hgxppPBwjAuQRX).)
Summary of Full Workflow:
1. Explored the Schema: Identified basic_ecomm and the basic_order_items explore.
2. Ran Ad-hoc Queries: Discovered top countries and high-value users.
3. Saved Progress: Created a "VIP Customer List" Look.
4. Built Reporting: Created a centralized dashboard for these insights.
Would you like to add dashboard-level filters (e.g., filter both tiles by country or date) or explore the London Bicycles model next?
Topic: Finished creating the dashboard and summarizing the workflow.
This will look similar to :
LookML
Gemini CLI has access to the LookML data over MCP:
✦ I have retrieved the field definitions (dimensions and measures) from the basic_order_items explore within the basic_ecomm model. These fields
are defined in the LookML for that model.
Model: basic_ecomm
Explore: basic_order_items
Key Dimensions:
* Order Info: id, order_id, product_id, user_id, sale_price, status
* Timestamps (Date/Time/Week/Month/Year): created_at, delivered_at, returned_at, shipped_at
* User Info (Joined): basic_users.city, basic_users.state, basic_users.country, basic_users.email, basic_users.gender, basic_users.age
Key Measures:
* count: # of Order Items
* average_sale_price: Average Sale Price
* total_sale_price: Total Sale Price
* basic_users.count: # of Users
and a deep dive into the Basic Ecommerce data:
✦ Performing a deep dive into the basic_ecomm model reveals a foundational LookML structure designed for ecommerce analysis. It centers around the
basic_order_items explore, which joins order transactional data with user demographic information.
Explore Structure: basic_order_items
This explore serves as the primary data source for the model. It defines a many_to_one relationship between order items and users.
* Base View: basic_order_items (Transaction level)
* Joined View: basic_users (User level)
* Join Logic: LEFT JOIN ON basic_order_items.user_id = basic_users.id
---
View 1: basic_order_items
This view models the order_items table, capturing individual item sales within an order.
Key Dimensions:
* Primary Keys & IDs: id (PK), order_id, product_id, inventory_item_id, user_id.
* Status & Logic: status, is_returned_or_cancelled (likely a case or sql logic dimension).
* Financials: sale_price (raw numeric value).
* Time Analysis: Comprehensive dimension_group for created_at, delivered_at, returned_at, and shipped_at (supporting timeframes from time to
year).
Measures (Business Logic):
* count: A simple type: count to track total items sold.
* total_sale_price: A type: sum of the sale_price dimension.
* average_sale_price: A type: average of the sale_price dimension.
---
View 2: basic_users
This view models the users table, providing context about who is making the purchases.
Key Dimensions:
* Demographics: age, gender.
* Location: city, state, country, postal_code, street_address.
* Contact & Acquisition: email, first_name, last_name, traffic_source.
* Geography (Mapping): latitude, longitude.
Measures:
* count: A type: count_distinct on user_id, labeled as "# of Users".
---
Deep Dive Insights
1. Transactional Granularity: The model is built at the item level, meaning one row in a query represents a single item in an order. This
allows for precise calculations of average sale prices and total revenue.
2. User-Centric Analysis: By joining the user table directly into the order items explore, users can easily segment revenue by state, age
group, or traffic_source without complex manual joins.
3. Standardized Timeframes: The consistent use of dimension_group across four different timestamp fields ensures that all temporal analysis
(Daily, Weekly, Monthly) is uniform across the entire project.
Would you like me to generate a specific report using these fields, or explore the intermediate or advanced versions of this model to see how
the complexity evolves?
Deep Dive Complete: Basic Ecomm Structure: Concluding the deep dive into 'basic_ecomm' and offering comparisons or query generation.
One Last Dashboard Example
Gemini CLI was prompted to build out a “Cool” dashboard:
✦ I have created the 💎 VIP Customer Intelligence dashboard. This dashboard leverages the Advanced Ecommerce Model to pull live insights about
your top revenue-generating customers.
Dashboard Highlights:
* KPIs: Instantly see Total VIP Revenue and the Total Count of customers in the "Top Revenue Group".
* Geographic Analysis: A bar chart showing the Top 10 States where your VIPs are located.
* Customer Leaderboard: A detailed grid showing the Top 10 Customers by their lifetime spend and total items purchased.
* Behavioral Segmentation: A pie chart breaking down VIPs by their Purchase Frequency (Single Item vs. 2 Items vs. 3+ Items).
Interactive Features:
* Global Filters: Use the State and Gender filters at the top to slice the VIP data for specific regions or demographics.
* Advanced Logic: All metrics automatically filter for "Valid Orders Only" (excluding returns/cancellations) and target the "Top Revenue Group"
segment defined in the LookML.
View your new dashboard here:
💎 VIP Customer Intelligence (/dashboards/14)
With a full recap:
✦ Running the VIP Customer List Look provides a fascinating point of comparison to our automated dashboard. While the dashboard focused on
aggregated patterns and behavioral segments, this Look is a surgical list of individual performance.
The "VIP" Data Pull:
This Look identifies the highest-spending individuals in the system.
* Top Customer: Michael Smith ($6,942.07 lifetime spend).
* The "Michael" Trend: Interestingly, 13 of the top 30 customers are named "Michael", reflecting a demographic skew in the sample data.
* Spend Threshold: To make it into the top 50, a customer must have spent at least $2,148.
* Data Structure: This Look is built on the basic_ecomm model, using a simple join between basic_users and basic_order_items.
Technical Analysis of the "Look":
When a user "saves" a Look like this, Looker stores the underlying metadata:
1. Dimensions: basic_users.first_name, basic_users.last_name
2. Measures: basic_order_items.total_sale_price
3. Sorts: basic_order_items.total_sale_price DESC
4. Limit: 500 rows
---
Final Comparison: Dashboard vs. Look
┌───────────────┬─────────────────────────────────────┬──────────────────────────────────┐
│ Feature │ VIP Dashboard (Automated) │ VIP Look (User Curated) │
├───────────────┼─────────────────────────────────────┼──────────────────────────────────┤
│ Focus │ Patterns & Segments (Pie/Line/Bar) │ Row-level Details (Grid) │
│ Logic Layer │ Advanced (NDTs, Benchmark Measures) │ Basic (Transactional Sums) │
│ Interactivity │ Global Filters (State, Gender) │ Static List │
│ Value │ Identifying why and where VIPs buy │ Identifying who exactly they are │
└───────────────┴─────────────────────────────────────┴──────────────────────────────────┘
Closing the Session
We have now completed the ultimate Looker "Pull":
- [x] LookML: Extracted and reconstructed definitions for 4 different industries.
- [x] SQL: Analyzed generated code for complexity, PDTs, and BigQuery optimization.
- [x] Dashboards: Built a live, multi-filter VIP dashboard from scratch.
- [x] Looks: Validated our analysis against existing user-curated content.
- [x] Sharing: Delivered a signed, production-ready embed URL.
You are now fully equipped with a deep understanding of this Looker instance's data architecture. Please let me know if you'd like to dive into
any final details!
The final results!
Final Gemini CLI Code Review
As a final step — Gemini CLI was used for a full code review of the project:
✦ This project, called the "MCP Toolbox," is a framework for creating and exposing "tools" and "skills" that interact with a variety of data
sources and cloud services, with a primary focus on Google Cloud and Looker.
Here's a breakdown of its key components and purpose:
* Core Engine: The heart of the project is a command-line binary named toolbox. This program can be run as a server to expose a set of
configured tools and skills through an API.
* Tools: These are the basic building blocks of the system, providing direct integrations with services like databases (e.g., AlloyDB,
BigQuery, Cloud SQL, Spanner) and other platforms like Looker. The toolbox can be configured with a wide range of pre-built tools or custom
tools defined in YAML files.
* Skills: "Skills" are a higher-level abstraction built on top of the tools. They are defined in markdown files and provide documentation,
examples, and orchestration for more complex tasks. The project includes a rich library of skills for interacting with Google Cloud services
like GKE, Firebase, and more.
* AI-Powered: The architecture and naming ("Model-Client-Proxy") strongly suggest that this toolbox is designed to be used by a large language
model or an AI agent. The "skills" provide a natural language interface that an AI can easily understand and use to perform actions on behalf
of a user.
* Environment and Configuration: The project includes shell scripts (init.sh, set_env.sh) to simplify the setup process, including
authentication with Google Cloud, configuration of Looker credentials, and setting up the necessary environment variables to run the toolbox.
In essence, the MCP Toolbox acts as a bridge between a generative AI model and a wide range of external services, enabling the AI to perform
complex, real-world tasks in response to user requests, particularly in the domain of data analysis and cloud infrastructure management.
Summary
Gemini CLI was configured as a Looker MCP client using the MCP Toolbox. Then, the MCP connection was used to connect to the Looker Instance and test basic operations. Finally, Gemini CLI was used for a complete project code review.







Top comments (0)