Your first agent configuration with MCP and Looker

By Google Cloud Tech

Share:

Key Concepts

  • Looker: A business intelligence and data analytics platform used for data modeling, governance, and visualization.
  • Agent Development Kit (ADK): An open-source framework by Google designed to build and manage AI agents at scale.
  • MCP (Model Context Protocol): A standard protocol that allows AI models to interact with external data sources and tools.
  • LLM (Large Language Model): The AI engine that interprets user prompts and decides which tools to invoke based on provided descriptions.
  • Toolbox: A collection of pre-built functions (e.g., get_connections) that allow an agent to perform specific actions within Looker.
  • YAML Configuration: A file format (tools.yaml) used to define data sources and map specific Looker tools to the agent.

1. Overview of Looker and AI Integration

The integration of Looker with Large Language Models (LLMs) enhances the model's ability to provide robust, data-grounded responses. By utilizing the Agent Development Kit (ADK), developers can move beyond simple chat interfaces to create "agentic systems" that can actively query, analyze, and interact with enterprise data stored in Looker.

2. Step-by-Step Implementation Process

Phase 1: Environment Setup and Authentication

  1. Credential Retrieval: Access the Looker account settings to generate a Client ID and Client Secret. These must be stored securely as environment variables.
  2. Development Environment: Use a Python virtual environment (e.g., via the uv package manager).
  3. Installation: Install the Google ADK and necessary dependencies (refer to the project documentation for specific requirements).

Phase 2: Agent Initialization

  • Use the command adk create [agent_name] to generate the project structure, which includes:
    • An agent Python file.
    • An environment configuration file.
    • An initialization file.

Phase 3: Defining Tools via tools.yaml

The tools.yaml file acts as the bridge between the LLM and Looker.

  • Source Definition: Define the Looker instance URL and map the credentials from environment variables.
  • Tool Designation: Define specific tools (e.g., get_connections).
    • Crucial Step: Provide a clear, descriptive string for each tool. The LLM relies entirely on this description to determine when to invoke the tool during a conversation.

Phase 4: Configuring the Agent Python File

  • Import necessary packages, including MCP toolsets and server parameters.
  • Initialize the MCP Server using standard IO parameters to establish the connection to Looker.
  • Define the Root Agent, which acts as the interface between the user's natural language prompt and the LLM's decision-making process.

3. Testing and Validation

  • ADK Web: Use the adk web command to launch a local interface.
  • Verification: Query the agent with prompts like, "What tools do you have available to you?"
  • Iterative Development: By modifying the tools.yaml file and restarting the application, developers can dynamically add or remove capabilities (such as fetching dashboards, looks, or explores) without rewriting the core agent logic.

4. Key Arguments and Perspectives

  • Grounded AI: The presenter emphasizes that connecting LLMs to Looker ensures that AI responses are "grounded in your enterprise data," reducing hallucinations and increasing the utility of the AI.
  • Modularity: The use of the MCP toolbox allows for a modular approach. Developers can start with a single tool and scale to complex workflows (e.g., health analysis, dashboard retrieval) as needed.
  • Developer Experience: The ADK is presented as a "proven at Google scale" framework, suggesting that this methodology is suitable for production-grade enterprise applications.

5. Synthesis and Conclusion

The process of creating an agentic system for Looker involves securing API credentials, defining tool capabilities in a YAML configuration, and wrapping these in an ADK-based Python agent. By leveraging the Model Context Protocol, developers can transform Looker from a static visualization tool into an active participant in AI-driven workflows. The primary takeaway is that the clarity of tool descriptions in the configuration file is the most critical factor in ensuring the LLM correctly utilizes the Looker API to provide actionable data insights.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video