From Prompt to Production: LookML Authoring in MCP-Toolbox

The AI era presents new opportunities for interacting with and leveraging new tools to gain information from your data. With the release of MCP Toolbox v0.18.0, you can now use AI agents to author and manage LookML directly from a prompt, bringing Looker code development to the new tools you use every day, and streamlining your workflow.

The Rise of the AI Data Analyst

AI-powered data agents can understand your data, suggest improvements to your LookML models, and write the code for you. Powered by LLMs like Gemini, these agents can translate natural language prompts into complex actions, including code generation.

The key to unlocking this potential lies in providing these agents with the right context and tools. This is where Looker’s semantic layer, LookML, and the MCP Toolbox come into play. LookML provides the structured, governed, and reusable definitions of your business logic, while the MCP Toolbox acts as the bridge, allowing AI agents to securely interact with and, now, modify your Looker instance’s codebase.

The LookML Authoring Toolkit is Here

With the latest release of the MCP Toolbox, we are shipping a powerful new suite of tools specifically for authoring LookML.

With version v0.18.0, you can empower an AI agent to:

  • Analyze your existing LookML models: The agent can inspect your Explores, identify areas for improvement, and suggest changes based on best practices.

  • Generate new LookML views and models: Provide the agent with a natural language description of the data you want to model, and it will generate the corresponding LookML code for a new view or model file.

  • Refactor and optimize your LookML: The agent can help you streamline your LookML projects by identifying redundant code, improving performance, and ensuring consistency across your models.

Your New LookML Workflow in Action

Here’s how you can leverage the new LookML authoring tools:

  1. Prompt: You, the developer, provide a prompt to your AI agent. This could be something simple like, “Create a new view for our users table based on the schema in our BigQuery database,” or a more complex request like, “Add a year-over-year measure to our orders Explore.”

  2. Agent’s Action: The agent leverages the new LookML authoring tools in the MCP Toolbox. It inspects your database schema, analyzes your existing LookML, and writes the code to fulfill your request.

  3. Code Generation: The agent generates the complete, syntactically correct LookML code. This could be a brand new view file ready for your project or a set of new measures to be added to an existing file.

  4. Review and Deploy: You review the generated code directly in your development environment. Once satisfied, you can commit it to your project repository, putting it through your standard CI/CD and review process.

Introducing the New Tools

  • dev_mode: Turn dev mode on and off for the session. LookML authoring must be done in dev mode. Also queries run in dev mode use the modified LookML so you can test the impact of your changes.

  • get_projects: Get the list of available LookML projects.

  • get_project_files: Get the list of LookML files in a project.

  • get_project_file: Get the content of a LookML file.

  • create_project_file: Create a new LookML file.

  • update_project_file: Modify an existing LookML file.

  • delete_project_file: Delete a LookML file.\

There are no tools for committing the changes or promoting them to production. For security, those actions must still be done by the LookML developer in the Looker UI.

Empower Your AI Agent to Author LookML Today

To get started with AI-powered LookML authoring, download and install the MCP -Toolbox server following the instructions at https://googleapis.github.io/genai-toolbox/how-to/connect-ide/looker_mcp/.

The combination of AI agents, Looker’s semantic layer, and the now-shipping LookML authoring tools in MCP Toolbox v0.18.0 empowers you to do more from the cutting-edge tools you are leveraging today. Start building with the future of data modeling.

6 Likes