KosmoKrator

analytics

Microsoft Power BI Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Microsoft Power BI KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.powerbi.*. Use lua_read_doc("integrations.powerbi") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Microsoft Power BI workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.powerbi.list_workspaces({top = 1}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("powerbi"))' --json
kosmo integrations:lua --eval 'print(docs.read("powerbi.list_workspaces"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local powerbi = app.integrations.powerbi
local result = powerbi.list_workspaces({top = 1})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.powerbi, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.powerbi.default.* or app.integrations.powerbi.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Microsoft Power BI, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Microsoft Power BI Integration

Tools for interacting with the Microsoft Power BI REST API.

The namespace is powerbi. Use workspace IDs returned by powerbi_list_workspaces when querying workspace-scoped datasets and reports. The Power BI REST API does not expose a general current-user profile endpoint in this package; credential checks use a lightweight workspace-list probe.

Tools

powerbi_list_workspaces

List Power BI workspaces (groups) the authenticated user has access to.

Parameters:

  • top (integer, optional): Maximum number of workspaces to return. Default: 100.

Returns: Array of workspace objects with id, name, isReadOnly, isOnDedicatedCapacity, etc.


powerbi_get_workspace

Get details for a specific Power BI workspace by its ID.

Parameters:

  • id (string, required): The workspace (group) ID (a GUID).

Returns: Workspace object with full metadata.


powerbi_list_datasets

List datasets within a Power BI workspace.

Parameters:

  • workspace_id (string, required): The workspace (group) ID (a GUID).

Returns: Array of dataset objects with id, name, webUrl, addRowsAPIEnabled, isRefreshable, etc.


powerbi_get_dataset

Get details for a specific dataset within a workspace.

Parameters:

  • workspace_id (string, required): The workspace (group) ID (a GUID).
  • dataset_id (string, required): The dataset ID (a GUID).

Returns: Dataset object with schema and configuration details.


powerbi_list_reports

List reports within a Power BI workspace.

Parameters:

  • workspace_id (string, required): The workspace (group) ID (a GUID).

Returns: Array of report objects with id, name, webUrl, embedUrl, datasetId, etc.


powerbi_get_report

Get details for a specific report within a workspace.

Parameters:

  • workspace_id (string, required): The workspace (group) ID (a GUID).
  • report_id (string, required): The report ID (a GUID).

Returns: Report object with embed URL, description, and associated dataset.

Raw agent markdown
# Microsoft Power BI Integration

Tools for interacting with the Microsoft Power BI REST API.

The namespace is `powerbi`. Use workspace IDs returned by
`powerbi_list_workspaces` when querying workspace-scoped datasets and reports.
The Power BI REST API does not expose a general current-user profile endpoint in
this package; credential checks use a lightweight workspace-list probe.

## Tools

### powerbi_list_workspaces
List Power BI workspaces (groups) the authenticated user has access to.

**Parameters:**
- `top` (integer, optional): Maximum number of workspaces to return. Default: 100.

**Returns:** Array of workspace objects with `id`, `name`, `isReadOnly`, `isOnDedicatedCapacity`, etc.

---

### powerbi_get_workspace
Get details for a specific Power BI workspace by its ID.

**Parameters:**
- `id` (string, required): The workspace (group) ID (a GUID).

**Returns:** Workspace object with full metadata.

---

### powerbi_list_datasets
List datasets within a Power BI workspace.

**Parameters:**
- `workspace_id` (string, required): The workspace (group) ID (a GUID).

**Returns:** Array of dataset objects with `id`, `name`, `webUrl`, `addRowsAPIEnabled`, `isRefreshable`, etc.

---

### powerbi_get_dataset
Get details for a specific dataset within a workspace.

**Parameters:**
- `workspace_id` (string, required): The workspace (group) ID (a GUID).
- `dataset_id` (string, required): The dataset ID (a GUID).

**Returns:** Dataset object with schema and configuration details.

---

### powerbi_list_reports
List reports within a Power BI workspace.

**Parameters:**
- `workspace_id` (string, required): The workspace (group) ID (a GUID).

**Returns:** Array of report objects with `id`, `name`, `webUrl`, `embedUrl`, `datasetId`, etc.

---

### powerbi_get_report
Get details for a specific report within a workspace.

**Parameters:**
- `workspace_id` (string, required): The workspace (group) ID (a GUID).
- `report_id` (string, required): The report ID (a GUID).

**Returns:** Report object with embed URL, description, and associated dataset.
Metadata-derived Lua example
local result = app.integrations.powerbi.list_workspaces({top = 1})
print(result)

Functions

list_workspaces Read

List Power BI workspaces (groups) the authenticated user has access to. Returns workspace IDs and names that can be used to query datasets and reports.

Lua path
app.integrations.powerbi.list_workspaces
Full name
powerbi.powerbi_list_workspaces
ParameterTypeRequiredDescription
top integer no Maximum number of workspaces to return (default: 100).
get_workspace Read

Get details for a specific Power BI workspace (group) by its ID.

Lua path
app.integrations.powerbi.get_workspace
Full name
powerbi.powerbi_get_workspace
ParameterTypeRequiredDescription
id string yes The workspace (group) ID (a GUID).
list_datasets Read

List datasets within a Power BI workspace. Returns dataset IDs, names, and configuration details.

Lua path
app.integrations.powerbi.list_datasets
Full name
powerbi.powerbi_list_datasets
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID containing the datasets (a GUID).
get_dataset Read

Get details for a specific Power BI dataset within a workspace, including schema and refresh configuration.

Lua path
app.integrations.powerbi.get_dataset
Full name
powerbi.powerbi_get_dataset
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID (a GUID).
dataset_id string yes The dataset ID (a GUID).
list_reports Read

List reports within a Power BI workspace. Returns report IDs, names, embed URLs, and associated dataset IDs.

Lua path
app.integrations.powerbi.list_reports
Full name
powerbi.powerbi_list_reports
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID containing the reports (a GUID).
get_report Read

Get details for a specific Power BI report within a workspace, including embed URL and associated dataset.

Lua path
app.integrations.powerbi.get_report
Full name
powerbi.powerbi_get_report
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID (a GUID).
report_id string yes The report ID (a GUID).