Add a global variable
cs_add_variableAdd a conversation-scope variable to a Copilot Studio agent by generating the YAML definition. Review the proposed diff on the first call, then confirm to write the file.
Instructions
Create variables/.variable.mcs.yml (GlobalVariableComponent, conversation scope). The first call changes nothing: it returns the files it would write, as a diff against what is there now, for the user to approve. Call it again with the same arguments plus confirm: true to write them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| confirm | No | Required to write the change to the file. Without it the tool returns a preview - the changed lines against the current ones, and the character count - and writes nothing. | |
| overwrite | No | ||
| workspace | No | Path to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory. | |
| description | No | ||
| aiVisibility | No | ||
| defaultValue | No |