Jump to a workflow
Embed a Dashboard
Multi-Tenant Embeds
Tenant Discovery
Query Data
Semantic Layer
Customer Widgets
SQL Migration
Workspace Metrics
Brand & Theme
Access & Filters
Scheduled Reports
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
list_data_apps and asks which data app to use when more than one exists.Ensure API token
list_api_tokens and creates one with create_api_token if needed.Select workspace and dashboard
list_workspaces, then list_dashboards scoped to the selected workspace.Create or reuse embed
list_embeds, then calls create_embed with dashboardId, workspaceName, and accessSettings: { datamartName } if a new embed is needed.Verify and generate runtime assets
get_embed_details, generates a server-side guest token with generate_guest_token, and generates framework code with generate_embed_code.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
workspaceName or workspaceId; if needed, it calls list_workspaces first.Read the tenancy source
list_tenants, optionally with searchValue, datasourceId, datamartId, or limit.Pick the right customer
clientId for downstream embed, widget, guest-token, demo-link, or scheduled-report work.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:
Discover datamarts
list_datamarts to see which data models are available.Check semantic layer
get_semantic_layer to verify table and column descriptions exist.Populate if needed
update_semantic_layer or starts semantic-layer generation with start_semantic_layer_generation.Ask the question
ask_question, which converts it to SQL, executes the query, and returns results with a chart suggestion.“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:
Inspect current state
get_semantic_layer to see the completion score and missing metadata.Generate descriptions
Push updates
update_semantic_layer or starts semantic-layer auto-generation with start_semantic_layer_generation.Verify quality
ask_question.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
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
list_widgets and presents widget names, publish state, metricId, and externalMetricId.Add, update, or remove
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.Verify and preview
list_widgets again, then get_demo_link so you can preview exactly what that clientId sees.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
list_workspaces, list_dashboards, and list_widgets to confirm the target workspace, dashboard, client, and existing metric IDs.Validate without saving
validate_metric_spec to resolve data app, datasource, embed ID, dashboard ID, and conflicts.Dry-run the write
create_or_update_metric_from_query with mode: "dry_run" and shows the exact plan.Apply after explicit approval
create_or_update_metric_from_query with mode: "apply" and confirm: "APPLY_TO_PRODUCTION" only after the user approves.Verify
list_widgets and get_demo_link.sql-to-metric-migration
Create an Unattached Workspace Metric
Create or update 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, fix SQL on an existing workspace metric, or refresh Dimensions/Measures after a query change. 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”
“Update the SQL on my existing workspace metric and refresh its Dimensions and Measures”What happens:
Resolve workspace context
workspaceName and datasource context (via list_workspaces / discover_datasource_schema).Dry-run the metric
create_workspace_metric with mode: "dry_run" to validate the name, SQL, optional metricId, datasource, and publish state without writing. When updating, the same metricId must be carried through dry-run and apply.Review the plan
Apply after explicit approval
create_workspace_metric with mode: "apply" and confirm: "APPLY_TO_PRODUCTION" only after you approve the write.sql-to-workspace-metric. Use 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
list_embeds or get_embed_details to inspect the current access settings, filters, localization, and options.Patch the embed
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
generate_guest_token.Verify
get_embed_details and can generate a demo link with get_demo_link for a tenant-scoped dashboard.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.

