Manage with an agent¶
The most convenient way to configure a semantic layer is by using an AI agent. With the Motley MCP connector active, it has direct access to your semantic layer and can inspect, create, and refine models in conversation.
MCP tools¶
| Tool | What it means in practice |
|---|---|
| List all models | See every model defined for a source |
| Inspect a model | Drill into a specific model: SQL definition, fields, and sample rows |
| Create a model | Provide a description to create a model with desired dimensions and measures |
| Edit a model | Add, remove, or modify dimensions and measures on any existing model |
If you have existing data definitions¶
If you already have documented metrics, SQL views, or a dbt project, share that context with your agent and ask it to create models from it:
"Here's our dbt schema for the orders table — create a Motley model from it."
"We define monthly recurring revenue as the sum of subscription amounts where status is 'active'. Create a model for that."
If you're starting from scratch¶
Ask an agent to survey what's available and propose a starting point:
"List the tables in our analytics source and suggest which ones to model first."
"Create a model for weekly signups from the users table, grouped by plan type and country."
It will create the model, confirm the dimensions and measures it generated, and let you refine anything before moving on.
Editing an existing model¶
Once a model exists, you can ask an agent to modify it directly:
"Add an average order value measure to the orders model."
"The revenue measure should use sum, not count."
"Remove the internal_cost dimension from the transactions model."
Changes take effect immediately and apply to all subsequent document generations from that source.