Create or update a Fabric data agent from the plan (dry run by default)
create_data_agentCreates a Fabric data agent over the source, with the plan as its instructions (business names, the joins that are safe and those that are not, header amounts not to sum over lines), the plan's tables selected and 3–5 example question/T-SQL pairs over safe joins, or updates the agent of that name in place. Only joins validate=true counted are called safe. Requires workspace, source and name; Item.ReadWrite.All or DataAgent.ReadWrite.All. Returns JSON with the instructions, examples, sizes against the documented limits and the REST calls; with dry_run=false also the result, or kind consent. Changes Fabric only with dry_run=false: instructions, data source and examples are replaced; nothing is deleted. Errors: {error, kind, hint}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"source": "<source>",
"name": "<name>"
},
"name": "create_data_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | Primary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}. | |
| name | Yes | Display name of the data agent; an existing item with this name is updated in place. Example: "shop_agent". | |
| schema | No | Schema in the source. Default "dbo". | dbo |
| source | Yes | Lakehouse, warehouse or SQL database, name or id. | |
| dry_run | No | true (default) returns what would be created and the REST calls, changing nothing; false creates or updates. | |
| publish | No | true (default) publishes the agent after creating or updating it; false leaves a draft. Example: false. | |
| validate | No | true runs validate_plan's counting queries and includes the counts; false (default) reads metadata only. | |
| confirmed | No | Relationships the user confirmed, added to the plan. Default none. Example: [{"source": "orders", "source_cols": ["ship_to_id"], "target": "addresses", "target_cols": ["address_id"]}]. | |
| workspace | Yes | Fabric workspace, name or id. | |
| test_questions | No | true also checks the plan against the rows (counts only, as validate_plan) and drafts 10-20 test questions for the agent, each with the T-SQL that gives the right answer, the answer's shape and the finding it tests. Default false. | |
| show_personal_data | No | true includes columns named like personal data; false (default) masks or omits them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |