Add a tool (connector, MCP server, flow, prompt, agent, or raw)
cs_add_toolAdds an action to a Copilot Studio agent by writing its .mcs.yml definition. Supports connector, MCP, flow, prompt, connected-agent, child-agent, or raw types; previews file changes first and writes only after confirmation.
Instructions
Create actions/.mcs.yml. type 'connector': a connector operation (connectorId like shared_office365, operationId like SendEmailV2; use cs_list_connectors / cs_describe_connector to find them). type 'mcp': an MCP server exposed through a connector. type 'flow': a cloud flow by id. type 'prompt': an AI Builder prompt by model id (cs_list_prompts). type 'connected-agent': another Copilot Studio agent by schema name. type 'child-agent': a child agent's GPT component. type 'raw': any other TaskAction kind with the action object supplied. When the connector definition is cached, the operationId is checked and required inputs are filled from the catalog unless inputs are given. Connector and MCP tools need a connection that only the portal can authorise; the tool writes the connection-reference stub and returns the portal step. 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 | ||
| type | Yes | ||
| action | No | type raw: full TaskAction object with kind | |
| flowId | No | ||
| inputs | No | ||
| 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. | |
| outputs | No | ||
| aiModelId | No | type prompt: AI Builder model id | |
| overwrite | No | ||
| workspace | No | Path to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory. | |
| connectorId | No | shared_<name> or a display name from the catalog | |
| description | Yes | Also used as modelDescription unless overridden; the orchestrator routes on it | |
| operationId | No | ||
| botSchemaName | No | type connected-agent | |
| connectionMode | No | Invoker = end user's connection; Maker = the maker's shared connection | |
| modelDescription | No | ||
| inputsFromCatalog | No | Default true: when no inputs are given and the connector definition is cached, add automatic inputs for the operation's required parameters | |
| connectionReference | No | Existing logical name from connectionreferences.mcs.yml | |
| gptComponentSchemaName | No | type child-agent |