Add a tool (connector, MCP server, flow, prompt, agent, or raw)
cs_add_toolCreate a Copilot Studio agent action by generating a .mcs.yml file with type, inputs, and outputs; supports connectors, flows, prompts, and child agents, and handles connection references for portal authorization.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| type | Yes | ||
| action | No | type raw: full TaskAction object with kind | |
| flowId | No | ||
| inputs | No | ||
| 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 |