$npx -y skills add microsoft/skills-for-copilot-studio --skill int-referenceReference tables for Copilot Studio YAML authoring: triggers, actions, variables, entities, Power Fx functions, templates. Preloaded by author and advisor agents.
| 1 | # Copilot Studio YAML Reference |
| 2 | |
| 3 | ## Core File Types |
| 4 | |
| 5 | | File | Purpose | |
| 6 | |------|---------| |
| 7 | | `agent.mcs.yml` | Main agent metadata (kind: GptComponentMetadata) | |
| 8 | | `settings.mcs.yml` | Agent settings and configuration | |
| 9 | | `connectionreferences.mcs.yml` | Connector references | |
| 10 | | `topics/*.mcs.yml` | Conversation topics (kind: AdaptiveDialog) | |
| 11 | | `actions/*.mcs.yml` | Connector-based actions (kind: TaskDialog) | |
| 12 | | `knowledge/*.mcs.yml` | Knowledge sources (kind: KnowledgeSourceConfiguration) | |
| 13 | | `variables/*.mcs.yml` | Global variables (kind: GlobalVariableComponent) | |
| 14 | | `agents/*.mcs.yml` | Child agents (kind: AgentDialog) | |
| 15 | |
| 16 | ## Trigger Types |
| 17 | |
| 18 | Topics with `OnRecognizedIntent` have two routing mechanisms — which one matters depends on the orchestration mode: |
| 19 | |
| 20 | - **`modelDescription`** — used by **generative orchestration** (`GenerativeActionsEnabled: true`). The AI orchestrator reads this to decide routing. Primary mechanism for generative agents. |
| 21 | - **Trigger phrases** (`triggerQueries`) — used by **classic orchestration**. Pattern-matched against the user's utterance. Secondary hints when generative orchestration is enabled. |
| 22 | |
| 23 | System triggers (`OnConversationStart`, `OnUnknownIntent`, `OnError`, etc.) fire automatically and don't use either mechanism. |
| 24 | |
| 25 | | Kind | Purpose | |
| 26 | |------|---------| |
| 27 | | `OnRecognizedIntent` | Trigger phrases matched | |
| 28 | | `OnConversationStart` | Conversation begins | |
| 29 | | `OnUnknownIntent` | No topic matched (fallback) | |
| 30 | | `OnEscalate` | User requests human agent | |
| 31 | | `OnError` | Error handling | |
| 32 | | `OnSystemRedirect` | Triggered by redirect only | |
| 33 | | `OnSelectIntent` | Multiple topics matched (disambiguation) | |
| 34 | | `OnSignIn` | Authentication required | |
| 35 | | `OnToolSelected` | Child agent invocation | |
| 36 | | `OnKnowledgeRequested` | Custom knowledge source search triggered (YAML-only, no UI) | |
| 37 | | `OnGeneratedResponse` | Intercept AI-generated response before sending | |
| 38 | | `OnOutgoingMessage` | **Non-functional (2026-03-15)** — exists in schema but does not fire at runtime. Do not use. | |
| 39 | |
| 40 | ### YAML-Only Features |
| 41 | |
| 42 | These features work at runtime but are **not visible in the Copilot Studio UI**. Warn users that UI edits may silently remove them. |
| 43 | |
| 44 | | Feature | Notes | |
| 45 | |---------|-------| |
| 46 | | `triggerCondition` on knowledge sources | The UI only exposes this as an on/off toggle (`=false` to exclude from `UniversalSearchTool`). Arbitrary Power Fx expressions (e.g., `=Global.UserDepartment = "HR"`) work at runtime but can only be set via YAML. Use with caution. (2026-03-16) | |
| 47 | |
| 48 | ## Action Types |
| 49 | |
| 50 | | Kind | Purpose | |
| 51 | |------|---------| |
| 52 | | `SendActivity` | Send a message | |
| 53 | | `Question` | Ask user for input | |
| 54 | | `SetVariable` | Set/compute a variable (Power Fx expression, prefix `=`) | |
| 55 | | `SetTextVariable` | Set a text variable using template interpolation (`{}`). Useful for converting non-text types (e.g., Number) to text: `"You have {Topic.Count} items"` | |
| 56 | | `ConditionGroup` | Branching logic | |
| 57 | | `BeginDialog` | Call another topic | |
| 58 | | `ReplaceDialog` | Replace current topic | |
| 59 | | `EndDialog` | End current topic | |
| 60 | | `CancelAllDialogs` | Cancel all topics | |
| 61 | | `ClearAllVariables` | Clear variables | |
| 62 | | `SearchAndSummarizeContent` | Generative answers (grounded in knowledge) | |
| 63 | | `AnswerQuestionWithAI` | AI answer (conversation history + general knowledge only) | |
| 64 | | `EditTable` | Modify a collection | |
| 65 | | `CSATQuestion` | Customer satisfaction | |
| 66 | | `LogCustomTelemetryEvent` | Logging | |
| 67 | | `OAuthInput` | Sign-in prompt | |
| 68 | | `SearchKnowledgeSources` | Search knowledge sources (returns raw results, no AI summary) | |
| 69 | | `CreateSearchQuery` | AI-generated search query from user input | |
| 70 | |
| 71 | ## Connector Actions (TaskDialog) |
| 72 | |
| 73 | Connector actions (`kind: TaskDialog`) invoke external connector operations. They are stored in `actions/` and require a connection reference in `connectionreferences.mcs.yml`. |
| 74 | |
| 75 | **Use `/add-action` to create new actions from available connectors.** The schema describes the structural properties of `TaskDialog` and `InvokeConnectorTaskAction`, but the specific inputs and outputs for each connector operation are connector-specific — use the connector lookup script (`connector-lookup.bundle.js`) to get the full operation details. |
| 76 | |
| 77 | ### Action Structure |
| 78 | |
| 79 | | Field | Purpose | |
| 80 | |-------|---------| |
| 81 | | `kind: TaskDialog` | Identifies this as a connector action | |
| 82 | | `inputs` | Inputs: `AutomaticTaskInput` (AI-provided) or `ManualTaskInput` (fixed value) | |
| 83 | | `modelDisplayName` | Display name for AI orchestrator routing | |
| 84 | | `modelDescription` | Description for AI orchestrator routing | |
| 85 | | `outputs` | Output property names returned by the connector | |
| 86 | | `action.kind` | Always `InvokeConnectorTaskAction` for connector actions | |
| 87 | | `action.connectionReference` | Logical name of the connection (registered in `connectionreference |