Extract an agent template
cs_extract_agent_templateExport an existing Copilot Studio agent's topics, settings, and components as a reusable YAML template for use in other environments or solutions.
Instructions
Write a reusable YAML template from an existing agent (its topics, settings and components), for cs_create_agent_from_template in another environment or solution. Runs 'pac copilot extract-template' with the active pac auth profile.
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": {
"bot": "<bot>",
"templateFile": "<templateFile>"
},
"name": "cs_extract_agent_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bot | Yes | Agent id or schema name | |
| cwd | No | Working directory for pac (for project commands: the solution project folder) | |
| profile | No | pac auth profile to run as: the admin account for tenant commands. Defaults to CPS_ADMIN_PROFILE for admin commands and CPS_PAC_PROFILE otherwise, then the active profile. cs_init lists the profiles. | |
| overwrite | No | Overwrite the file if it exists | |
| background | No | Run in the background and return a jobId immediately, for a command that takes longer than the client will wait. Poll cs_job_status. | |
| environment | No | Environment id or URL; default: the environment of the active pac auth profile | |
| templateFile | Yes | Path of the YAML template to write | |
| templateName | No | Template name (default kickStartTemplate) | |
| timeoutSeconds | No | Default 600 | |
| templateVersion | No | Template version X.Y.Z (default 1.0.0) |