Jump to a workflow
Embed a Dashboard
Most common starting point
Multi-Tenant Embeds
Per-client dashboards
Tenant Discovery
Find valid client IDs
Query Data
Natural language to SQL
Semantic Layer
Better AI querying
Customer Widgets
Per-customer widget edits
SQL Migration
Dry-run then apply metrics
Workspace Metrics
Unattached metric drafts
Brand & Theme
Colors, fonts, layout
Access & Filters
Self-serve, filters, i18n
Scheduled Reports
Report metadata
Embed an Existing Dashboard
The most common workflow. You have a dashboard built in the Databrain UI and want to embed it in your application. Ask your AI assistant:“Embed my sales dashboard in my React app”What happens:
Discover data apps
The assistant calls
list_data_apps and asks which data app to use when more than one exists.Select workspace and dashboard
It calls
list_workspaces, then list_dashboards scoped to the selected workspace.Create or reuse embed
It checks
list_embeds, then calls create_embed with dashboardId, workspaceName, and accessSettings: { datamartName } if a new embed is needed.embed-existing-dashboard
What you get: A working embed ID, a guest token payload pattern, and frontend code for React, Next.js, Vue, Angular, Svelte, SolidJS, or vanilla JS.
Multi-Tenant / Per-Client Embeds
Each customer gets their own dashboard copy with a stableclientId.
Ask your AI assistant:
“Create per-client dashboard embeds for my SaaS app”What happens:
- Lists data apps and ensures an API token exists.
- Calls
list_tenantsto discover validclientIdvalues from the tenancy database. - Lists dashboards and asks which source or template dashboard to use.
- Verifies the datamart and tenancy model.
- Calls
create_embedonce per customer withclientId. - Generates guest tokens and frontend code.
embed-blank-dashboard
clientId must match between dashboard embed creation and guest token generation. For create_embed, pass only accessSettings: { datamartName } plus flags the user explicitly requests; the tool fills required access defaults.Discover Tenants / Client IDs
Find valid customer identifiers before creating guest tokens, customer dashboards, widgets, demo links, or scheduled-report views. Ask your AI assistant:“List tenants for my Demo Workspace”
“Find client IDs matching Acme before I edit a dashboard”What happens:
Resolve the workspace
The assistant uses
workspaceName or workspaceId; if needed, it calls list_workspaces first.Read the tenancy source
It calls
list_tenants, optionally with searchValue, datasourceId, datamartId, or limit.Prefer
list_tenants when you need the authoritative customer list. list_embeds can show embed configuration, but tenant lookup comes from the workspace tenancy database.Query Data with Natural Language
Ask questions about your data and get answers with chart suggestions. Ask your AI assistant:“What was total revenue last month?”
“Show me the monthly revenue trend for the past year”
“Compare sales by region, broken down by quarter”What happens:
Populate if needed
If descriptions are missing, it improves them with
update_semantic_layer or starts semantic-layer generation with start_semantic_layer_generation.“Now show only the top 5 regions”Prompt name:
query-data
Populate the Semantic Layer
Bootstrap table and column descriptions to enable natural language querying. Ask your AI assistant:“Check the semantic layer quality for my orders datamart and add descriptions”What happens:
Generate descriptions
Generates business-friendly table and column descriptions, synonyms, and example questions.
Push updates
Writes metadata with
update_semantic_layer or starts semantic-layer auto-generation with start_semantic_layer_generation.populate-semantic-layer
Customize a Customer Dashboard
Add, remove, or modify widgets for one customer’s dashboard without affecting the template or other customers. Ask your AI assistant:“Add the Calls per Day widget to Acme’s dashboard”
“Remove the billing widget for this client only”
“Generate a widget showing disqualification reasons and add it to a client’s embed”What happens:
Identify customer and dashboard
The assistant asks for
clientId and dashboardName; if you do not know the clientId, it calls list_tenants. It asks for workspaceName only if the dashboard name is ambiguous.Survey widgets
It calls
list_widgets and presents widget names, publish state, metricId, and externalMetricId.Add, update, or remove
It calls
add_widget, generate_widget, update_widget, or remove_widget depending on the requested change. Customer-scoped writes are blocked when the dashboard is not tenant-scoped for that clientId.customize-customer-dashboard
SQL-to-Metric Migration
Turn warehouse-validated SQL into a Databrain metric/widget on a customer dashboard with a production-safe validation and apply flow. Ask your AI assistant:“Validate this SQL as a new metric on my operations dashboard”
“Dry-run creating this converted query as a metric, then show me the plan”What happens:
Resolve context
Calls
list_workspaces, list_dashboards, and list_widgets to confirm the target workspace, dashboard, client, and existing metric IDs.Validate without saving
Calls
validate_metric_spec to resolve data app, datasource, embed ID, dashboard ID, and conflicts.Dry-run the write
Calls
create_or_update_metric_from_query with mode: "dry_run" and shows the exact plan.Apply after explicit approval
Calls
create_or_update_metric_from_query with mode: "apply" and confirm: "APPLY_TO_PRODUCTION" only after the user approves.sql-to-metric-migration
Create an Unattached Workspace Metric
Create a workspace-level metric from validated SQL without attaching it to a dashboard. This is useful when you want to stage a metric as unpublished first, then decide later where it should be exposed. Ask your AI assistant:“Create an unpublished workspace metric from this validated SQL, but do not attach it to a dashboard”
“Dry-run a workspace metric called Revenue by Region in my Analytics workspace”What happens:
Dry-run the metric
It calls
create_workspace_metric with mode: "dry_run" to validate the name, SQL, metric ID, datasource, and publish state without writing.Review the plan
It shows the validation result and confirms that the metric will be workspace-level, unpublished by default, and not attached to any dashboard.
sql-to-metric-migration instead when the metric should become a customer-dashboard widget.
Brand and Theme an Embed
Customize colors, fonts, chart styles, responsive breakpoints, cards, and access presets to match your product. Ask your AI assistant:“Make my embed match our brand: primary color #4F46E5, dark mode, Inter font”
“Apply the corporate theme preset and hide the dashboard name”What happens:
- Identifies the target embed via
list_embedsorget_embed_details. - Applies theme changes through
customize_embed_theme. - Uses
update_embedfor advanced patches such as UI options, filters, localization, or permissions. - Regenerates the guest token if the frontend needs the new configuration.
brand-my-embed
Configure Embed Access, Filters, and Localization
Enable self-serve analytics, add filters, localize embed text, or tighten permissions after an embed already exists. Ask your AI assistant:“Enable metric creation on my embed with the visual builder”
“Add a date range filter and a region dropdown to my dashboard”
“Set up French translations for my embed”
“Lock down this embed so users can only view, not edit”What happens:
Inspect current settings
The assistant calls
list_embeds or get_embed_details to inspect the current access settings, filters, localization, and options.Patch the embed
It calls
update_embed for access settings, filters, localization, permissions, and advanced embed options. For self-serve metric creation, it sets metric-creation access flags and the requested mode, such as DRAG_DROP or CHAT.Refresh runtime configuration
If frontend behavior depends on guest-token permissions or filters, it regenerates the guest token with
generate_guest_token.brand-my-embed.
Scheduled Reports Metadata
Review scheduled report configuration for a customer/dashboard scope. Ask your AI assistant:“List scheduled reports for this client’s dashboard”What happens:
- Resolves the dashboard by
dashboardNameand optionalworkspaceName, or byembedId. - Calls
list_scheduled_reportswithclientId. - Returns schedule metadata such as subject, next scheduled time, recipient count, chart count, and download format.
This workflow lists configured schedules only.

