Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PBI_MCP_AUDITNoTool registry audit (CI)0
PBI_TOOLS_PATHNoPath to pbi-tools executable if not on PATH
PBI_MCP_READONLYNoBlock all write/destructive tools0
PBI_MCP_ALLOW_DMVNoAllow $SYSTEM.* / DISCOVER_* DAX0
PBI_MCP_AUTH_TOKENNoSSE Bearer token (>=32 chars when set)
PBI_MCP_ALLOWED_DIRSNo;-separated filesystem roots; default is cwd
PBI_MCP_ALLOWED_ORIGINSNoExtra Host/Origin allowlist for SSE
PBI_MCP_SECURITY_POLICYNoPath or inline JSON for security_policy.json
PBI_MCP_STRICT_REGISTRYNoStrict registry audit0
PBI_MCP_ALLOW_EXTERNAL_MNoBypass the M function blocklist0
PBI_MCP_PBI_TOOLS_TIMEOUTNopbi-tools subprocess timeout (s)300
PBI_MCP_ALLOW_UI_AUTOMATIONNoRequired for pbi_persist_now (Ctrl+S)0
PBI_MCP_PERSIST_USE_SENDINPUTNoFall back from PostMessage to SendInput0
PBI_MCP_ALLOW_UNAUTHENTICATED_SSENoAcknowledge non-loopback SSE without auth0

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
pbi_delete_relationshipA

Delete a relationship by name or by endpoint columns.

pbi_update_relationshipA

Update properties of an existing relationship (cardinality, direction, is_active, name).

pbi_delete_tableB

Delete a table. Removes associated relationships and measures.

pbi_delete_columnC

Delete a column from a table.

pbi_rename_tableB

Rename a table. Callers are responsible for updating dependent DAX expressions.

pbi_rename_columnC

Rename a column. Callers are responsible for updating dependent DAX.

pbi_rename_measureA

Rename a DAX measure. Callers must update downstream DAX expressions themselves.

pbi_refresh_metadataA

Reload cached TOM schema from the server (cheaper than full reconnect).

pbi_validate_daxA

Parse-check a DAX expression by running a zero/one-row probe and catching errors.

kind='scalar' wraps the expression with EVALUATE ROW("v", ). kind='table' wraps the expression with EVALUATE TOPN(0, ).

semantic=True additionally checks every Table[Column] / [Measure] reference against the live model index and heuristically flags a percent-shaped format_string on a scalar-money expression — the response then carries a semantic block (see pbi_validate_dax_semantic_tool).

pbi_audit_modelC

Detect missing, ambiguous, bidirectional, and orphaned model structures.

pbi_lint_daxC

Validate measures, formats, and measure/column name collisions.

pbi_detect_name_collisionsC

Detect table, column, and measure name collisions before writes.

pbi_detect_dirty_datesC

Detect text columns that look like dirty dates.

pbi_detect_empty_visualsC

Execute lightweight DAX probes to detect visuals with no data.

pbi_detect_circular_dependenciesA

Detect cycles in the measure dependency graph.

Builds a graph of measure → referenced measures (parsed from DAX [Name] tokens that match a known measure name) and runs a DFS to find strongly connected cycles. Self-references are reported separately.

pbi_detect_missing_visualsB

Detect required visuals that are absent from a page.

Each requirement entry is a dict with at least visual_type and optionally count (default 1), contains_field (a reference like Date.Year that must appear in the visual's prototypeQuery), and label (free-form name surfaced in the report).

pbi_export_correction_reportB

Generate a Markdown correction report aggregating all analysis tools.

Output sections: model overview, star-schema verdict, circular dependency scan, optional rubric scoring, audit issues. Writes to output_path and returns the path plus an inline summary.

pbi_export_validation_reportC

Export model, DAX, layout, binding, and score validation as JSON.

pbi_score_rubricA

Aggregate scoring across multiple validators.

Each criterion is a dict with:

  • id (str): unique identifier

  • label (str): human description

  • check (str): one of star_schema, no_circular_deps, power_query_steps, missing_visuals, measure_exists

  • weight (float, default 1.0)

  • params (dict): check-specific parameters

Returns per-criterion verdicts plus a weighted total score in [0, 1].

pbi_validate_power_query_stepsA

Verify that a Power Query (M) expression contains expected step patterns.

Each entry in expected_steps is treated as a substring (or regex if it starts with re:) that must appear at least once in the M expression. Useful for grading exercises: e.g. checking that a postal-code column has been left-padded to 5 chars, or that rows with null customer ids are filtered out.

pbi_validate_star_schemaA

Confirm a model follows star schema topology.

Heuristic: a fact table participates as the many-side in ≥1 relationship, a dimension table participates as the one-side. Tables that are both are flagged as bridge tables. Direct dimension-to-dimension relationships are flagged as snowflake violations. Fact tables wired to other facts are flagged as fact-to-fact (constellation).

Optional fact_table_hints lets callers force-tag tables as facts (matched case-insensitively); useful when a fact table has no incoming relationships yet because the model is being built incrementally.

pbi_validate_filter_expressionB

Validate a DAX boolean filter expression before visual probes.

pbi_generate_measure_testsC

Generate and execute smoke tests for DAX measures.

pbi_validate_relationship_planB

Validate relationship cardinality, direction, duplicates, and ambiguity before creation.

pbi_lint_report_layoutA

Detect overlaps, excessive whitespace, tiny visuals, and missing titles.

Optional knobs to silence noise on intentionally dense pages:

  • ignore_warnings: list of warning types to drop (e.g. ["too_many_visuals", "visual_too_small", "missing_title", "excessive_whitespace", "layout_overloaded"]). Issues are never ignored — only warnings.

  • only_pages: restrict the scan to a list of page display names / internal names. Use to lint just the new pages an LLM produced.

  • max_visuals_per_page: override the default too_many_visuals threshold (defaults to MAX_VISUALS_PER_PAGE). Set high to effectively disable the warning without ignoring it.

pbi_validate_visual_bindingsC

Alias-level visual binding validation with clearer tool naming.

pbi_score_dashboardC

Score dashboard quality across model, DAX, layout, and readability.

pbi_run_scenarioC

Run a complete QA scenario against the active model and optional extracted layout.

pbi_compare_report_versionsC

Compare two extracted report versions by pages, visuals, and layout score.

pbi_validate_pbix_persistenceC

Validate that a patched PBIX still contains a readable, persistent report layout.

pbi_validate_pbix_reopenB

Open a PBIX in Power BI Desktop and scan for visible repair-error signals.

use_windows_ocr defaults to False because the underlying screenshot captures the entire primary desktop, not just the Power BI window. The OCR helper now returns only the matched signal labels and a length — never raw recognized text — so screen contents from other applications cannot leak through the response.

pbi_measure_dependenciesC

Return calc-dependency graph rows (source → referenced object) from DISCOVER_CALC_DEPENDENCY.

pbi_list_rolesA

List all model roles with their members and table filters.

pbi_create_roleC

Create or update a model role.

pbi_delete_roleC

Delete a model role.

pbi_set_role_filterB

Set (or remove when filter_expression is None/empty) the RLS DAX filter on a table for a role.

pbi_add_role_memberA

Add (or update) a member (user/group) on a role.

member_type: 'external' (default, ExternalModelRoleMember — recommended for Power BI service) 'windows' (WindowsModelRoleMember — domain principal SID)

With overwrite=False (default), raises PowerBIDuplicateError if a member with the same member_name already exists on the role. With overwrite=True the existing member's identity_provider is refreshed (when external) and the response carries action="updated".

pbi_remove_role_memberB

Remove a member from a role, matching by MemberName (case-insensitive).

pbi_list_calc_groupsB

List calculation groups and their items.

pbi_create_calc_groupB

Create a calculation group table with its Name column and optional calculation items.

items: list of {name, expression, format_string_expression?, ordinal?}.

pbi_delete_calc_groupC

Delete a calculation group table.

pbi_add_visualA

Add any visual to a report page — the single entry point for visual creation.

visual_type: card, labelled_card, multi_row_card, bar_chart, stacked_bar_chart, stacked_column_chart, clustered_column_chart, hundred_percent_stacked_bar_chart, hundred_percent_stacked_column_chart, ribbon_chart, line_chart, area_chart, stacked_area_chart, hundred_percent_stacked_area_chart, donut, pie_chart, treemap, funnel, table, waterfall, scatter_chart, combo_chart, slicer, gauge, kpi, matrix, map, text_box. config: per-type keys — categorical charts: category_column + value_measure (+ legend_column); axis charts: axis_column + value_measures (list); card/gauge: measure; table: columns (list); matrix: rows + values (lists); scatter: category_column + x_measure + y_measure; combo: category_column + bar_measures + line_measures; kpi: indicator_measure + trend_column; slicer: column (+ slicer_type); map: location (+ measure); text_box: text. Error messages name any missing key. Prefer pbi_add_visual_from_intent when you have a business intent rather than an exact type. dry_run: when True, run all validation and binding logic but skip the layout disk write — response carries dry_run=True and a write_log.

excel_list_sheetsD
excel_read_sheetD
excel_read_cellD
excel_searchD
excel_write_cellD
excel_write_rangeD
excel_create_sheetD
excel_delete_sheetD
excel_format_rangeD
excel_auto_widthD
excel_create_workbookD
excel_workbook_infoD
excel_to_pbi_checkD
pbi_connectC

Connect to Power BI Desktop and report the active instance.

pbi_list_instancesA

List discovered Power BI Desktop instances without forcing a connection.

pbi_list_tablesC

List model tables and columns.

pbi_list_measuresB

List all model measures.

pbi_list_relationshipsB

List model relationships.

pbi_execute_daxC

Execute a DAX or DMV query.

pbi_execute_dax_as_roleB

Execute a DAX query under a specific role context.

pbi_trace_queryC

Execute a DAX query and return result rows with timing diagnostics.

pbi_create_measureC

Create or update a DAX measure.

pbi_delete_measureC

Delete a DAX measure.

pbi_create_relationshipA

Create or update a single-column relationship.

With overwrite=False (default), raises PowerBIDuplicateError when a relationship between the same endpoint columns already exists. With overwrite=True the existing relationship is updated in place (cardinality / direction / is_active refreshed) and the response carries action="updated".

pbi_model_infoC

Return a full model snapshot in a single call.

pbi_operation_historyA

Return the most-recent N tool operations recorded by the connection manager (newest first).

Each entry: {ts, op, kind: "read"|"write", duration_ms, ok} plus error_type/error_code/error_message when ok is False. Use this to self-diagnose what just happened — e.g. an LLM can pull the last 5 calls after a failure to see which writes already landed.

pbi_system_healthA

Single-call self-diagnostic for stability and dependency status.

Read-only. Skips any TOM/ADOMD probe gracefully when no connection is active. Use as a preflight from any LLM agent: one call answers "can I talk to Power BI right now?" without juggling connect / list / model_info.

pbi_refreshC

Trigger a model or table refresh.

pbi_import_dax_fileC

Parse a .dax file and bulk-create measures.

pbi_create_measuresA

Batch-create or update multiple DAX measures with a single SaveChanges call.

Each item in measures must have at minimum: name, expression. Optional keys: format_string, description, display_folder, is_hidden.

With dry_run=True, every measure is name + expression validated and the per-item planned_action is reported (would_create/would_update/ would_fail), but no model mutation happens — SaveChanges is never called. Use this for an LLM preflight before committing the batch.

pbi_create_time_intelligence_packA

Create a family of time-intelligence measures from a base measure.

Default patterns: YTD, MTD, QTD, SPY, YOY, YOY %, MA3. Each generated measure is named "{base_measure} {suffix}" (e.g. "Sales YTD") and lives on table (typically the same fact table as the base measure). Dependency-aware: requesting YOY% automatically adds YOY and SPY so the whole family resolves.

With format_inherit=True, each measure inherits base_measure's format string (best-effort lookup on the live model). format_string overrides that when supplied. Patterns that prescribe their own format (e.g. YOY %"0.00%") win unless format_string is explicit.

With dry_run=True no model mutation occurs — the response carries a plan listing every measure that would be created/updated/skipped.

pbi_create_variance_measureB

Create a period-over-period variance measure.

DAX template (parametrised by granularity ∈ {year, month, quarter}):

[{base}] - CALCULATE([{base}], DATEADD({date_table}[{date_column}], {offset}, {granularity}))

Default compare_period_offset = -1 ⇒ "current period vs previous one".

pbi_create_contribution_measureB

Create a %-of-total contribution measure.

DAX template:

DIVIDE([{base}], CALCULATE([{base}], ALL({scope_columns})))

scope_columns defines the denominator scope — typically the dimension columns whose total you want each row to be a percentage of (e.g. ["Categorie.Nom catégorie"] for "this category's % of all categories").

pbi_create_topn_measureB

Create a Top-N filter measure.

DAX template:

IF(RANKX(ALL({dim_table}[{dim_column}]), [{rank_measure}], , DESC) <= {N}, [{base}], BLANK())

Use as the value of a chart visual to surface only the top N members of a dimension. rank_measure defaults to base_measure.

pbi_create_rolling_average_measureB

Create a trailing rolling average measure.

DAX template:

AVERAGEX(DATESINPERIOD({date_table}[{date_column}], LASTDATE({date_table}[{date_column}]), -{window}, {granularity}), [{base}])

pbi_apply_format_presetA

Apply a named format preset to a list of measures or columns.

Wraps pbi_set_format_tool so callers don't need to memorise the raw format string. Supported preset families: currency_eur(_k|_m), currency_usd, percent (0dp/1dp/2dp/4dp), thousands, millions, decimal_2, integer, integer_no_sep, date_iso, date_short_fr, date_short_us, date_long_fr, datetime_iso. Use pbi_list_format_presets_tool to inspect them.

pbi_list_format_presetsA

Return the catalogue of format-string presets.

Optional filter_substring is matched (case-insensitive) against each preset's name to narrow the result — useful when an LLM only needs the "percent_*" or "currency_*" subset.

pbi_create_tableC

Create or update a calculated table.

pbi_create_columnC

Create or update a calculated column.

pbi_set_column_data_typeA

Set the DataType (and optionally FormatString) of an existing column.

Works for any column kind (source, calculated, calculated table column). Use when Power Query type hints (Int64.Type etc.) are overridden by PBI's downstream inference and the column ends up as the wrong type.

data_type accepts standard TOM names (Int64, Decimal, Double, String, DateTime, Boolean, Currency, Binary, Variant).

pbi_set_formatA

Batch-apply format strings to measures or columns.

pbi_export_modelC

Export the full model as JSON, optionally writing it to disk.

pbi_generate_dax_context_promptA

Render a compact markdown snapshot of the model — tables, columns, measures, relationships — ready to paste into an LLM system prompt so the LLM can author DAX with full schema context in one round-trip.

Sections:

  • # Model: <name>

  • one ## <Table> per table with Columns: and (optionally) DAX Measures: lines

  • ## Relationships with A[X] → B[Y] (cardinality, active) rows

Output is truncated to max_chars (default 12 000) with a trailing note when truncation kicks in. Set include_dax=False to omit the measure expressions and stay terse.

pbi_validate_modelB

Audit the model for common issues: empty expressions, missing format strings, orphan tables, duplicate measure names.

pbi_get_power_queryC

Read the M expression for a specific table partition.

pbi_list_power_queriesC

List table partitions and their current source expressions.

pbi_parameterize_data_sourceB

Make data sources portable via a Power Query parameter.

Creates (or updates) an M parameter named parameter_name whose default value is file_path. Then rewrites every M partition that string-matches file_path so it calls File.Contents(<parameter_name>) instead of the hardcoded path. After the parameter is wired in, a collaborator can change the file location once via Power BI Desktop's Transform data → Manage parameters dialog without editing each query.

partitions: optional explicit list of "Table[/Partition]" to rewrite. By default every M-source partition that references file_path is rewritten.

pbi_relocate_data_sourceA

Bulk-rewrite a hardcoded file or folder path inside every M partition.

Use when a workbook moves and queries break with DataSource.NotFound. Looks for old_path as a substring of each M-source partition expression and replaces it with new_path. Calculated/query-source partitions are skipped. dry_run=True returns the planned changes without writing.

pbi_set_power_queryC

Write or update an M expression on a table partition.

pbi_create_import_queryC

Generate and inject an Excel import Power Query for a table.

pbi_create_csv_import_queryC

Generate and inject a CSV import Power Query for a table.

pbi_create_folder_import_queryC

Generate and inject a folder import Power Query for a table.

pbi_bulk_import_excelC

Bulk-create Excel import queries for multiple tables.

pbi_import_excel_workbookC

Import an Excel workbook into Power BI tables in one call.

pbi_list_tmdl_filesC

List TMDL files in a Power BI Project semantic model definition folder.

pbi_patch_tmdl_measureC

Create or replace a measure block in one table TMDL file.

pbi_read_tmdl_fileB

Read one TMDL file from a Power BI Project definition folder.

pbi_write_tmdl_fileC

Create or overwrite one TMDL file inside a Power BI Project definition folder.

Prompts

Interactive templates invoked by user choice

NameDescription
model_auditFull model audit: tables, measures, relationships, and improvement suggestions.
time_intelligence_kitGenerate a full time-intelligence measure kit (MTD, QTD, YTD, YoY, YoY%) for a base measure.
star_schema_builderGuide for wiring a star schema: relationships + key measures.
rls_setupSet up Row-Level Security for a given table and filter column.
dead_measure_scanFind measures not referenced by any other measure and suggest cleanup.
bulk_measure_format_fixApply a format string to all measures in a table that are missing one.
excel_to_pbi_pipelineFull pipeline: inspect Excel, create import queries, refresh, validate.
model_snapshot_exportExport the full model as JSON for documentation or version control.

Resources

Contextual data attached and managed by the client

NameDescription
resource_model_schemaFull model snapshot: tables, columns, measures, relationships.
resource_model_measuresAll DAX measures in the active model.
resource_model_relationshipsAll relationships in the active model.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/imnotStealthy/powerbi-mcp-local'

If you have feedback or need assistance with the MCP directory API, please join our Discord server