Create an agent from a template
cs_create_agent_from_templateCreate a new Copilot Studio agent in a solution from a template YAML file, running pac copilot create with a required confirm flag for live environments.
Instructions
Create a new agent in a solution from a template produced by cs_extract_agent_template. Runs 'pac copilot create' with the active pac auth profile. Mutates a live environment: requires confirm: true (a dry run otherwise).
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": {
"schemaName": "<schemaName>",
"templateFile": "<templateFile>",
"displayName": "<displayName>",
"solution": "<solution>"
},
"name": "cs_create_agent_from_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for pac (for project commands: the solution project folder) | |
| confirm | No | Required to actually perform a change in a live environment. Without it the tool returns a dry run. | |
| 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. | |
| solution | Yes | Unique name of the solution to create the agent in | |
| 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. | |
| schemaName | Yes | Schema (unique) name of the new agent, e.g. contoso_HelpDesk | |
| displayName | Yes | Display name of the new agent | |
| environment | No | Environment id or URL; default: the environment of the active pac auth profile | |
| templateFile | Yes | Template YAML from cs_extract_agent_template | |
| timeoutSeconds | No | Default 900 |