pq_upsert_expression
Creates or updates a shared Power Query M expression or parameter in a Power BI project’s expressions.tmdl file, enabling reusable queries or parameter definitions.
Instructions
Create or update a shared Power Query M expression or parameter in definition/expressions.tmdl.
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": {
"projectPath": "<projectPath>",
"name": "<name>",
"mExpression": "<mExpression>"
},
"name": "pq_upsert_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Expression or parameter name | |
| description | No | Optional documentation comment | |
| isParameter | No | Mark as a Power Query parameter (adds meta [IsParameterQuery=true, ...]) | |
| mExpression | Yes | Power Query M expression or literal parameter value (e.g. '"https://api.example.com"' or 'let ... in ...') | |
| projectPath | Yes | Path to the .pbip file or project root folder | |
| parameterType | No | Parameter type when isParameter is true |