$npx -y skills add microsoft/skills-for-copilot-studio --skill edit-actionEdit an existing action (TaskDialog) in a Copilot Studio agent. Supports connector actions and MCP server actions. Modify inputs, outputs, descriptions, connection mode, and other properties.
| 1 | # Edit Action |
| 2 | |
| 3 | Edit an existing action (`kind: TaskDialog`) in a Copilot Studio agent. Supports both regular connector actions (`InvokeConnectorTaskAction`) and MCP server actions (`InvokeExternalAgentTaskAction`). Uses connector definitions to understand the full operation schema (inputs, outputs, types) and action templates as structural reference. |
| 4 | |
| 5 | ## Connector Lookup |
| 6 | |
| 7 | Help the user find the right connector and operation before they go to the UI. Use the connector lookup tool. Important: The connector lookup script only covers a subset of connectors (run `list` to see which ones). If the user's requested connector is not in the list, tell the user they need to find and add the connector action entirely through the Copilot Studio portal, then ask them to pull again the files locally. Once pulled, `/copilot-studio:edit-action` can still be used to customize the YAML. |
| 8 | |
| 9 | When the connector IS available, use the lookup tool to help the user before they go to the UI: |
| 10 | |
| 11 | ```bash |
| 12 | node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js list # List connectors |
| 13 | node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operations <connector> # List operations |
| 14 | node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operation <connector> <opId> # Full input/output details |
| 15 | node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js search <keyword> # Search operations |
| 16 | ``` |
| 17 | |
| 18 | Use schema lookup for structural properties: |
| 19 | |
| 20 | ```bash |
| 21 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary TaskDialog |
| 22 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary InvokeConnectorTaskAction |
| 23 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary InvokeExternalAgentTaskAction |
| 24 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary ModelContextProtocolMetadata |
| 25 | ``` |
| 26 | |
| 27 | ## Instructions |
| 28 | |
| 29 | 1. **Auto-discover the agent directory**: |
| 30 | ``` |
| 31 | Glob: **/agent.mcs.yml |
| 32 | ``` |
| 33 | If multiple agents found, ask which one. |
| 34 | |
| 35 | 2. **Find the action file** to edit: |
| 36 | ``` |
| 37 | Glob: <agent-dir>/actions/*.mcs.yml |
| 38 | ``` |
| 39 | Read the action file. If the user's request is ambiguous and multiple actions exist, list them and ask which one. |
| 40 | |
| 41 | 3. **Identify the connector and operation**: |
| 42 | - Read the action YAML to find `action.operationId` and the connector API name from `connectionreferences.mcs.yml` |
| 43 | - Look up the full operation details (if the connector is available in the lookup script): |
| 44 | ```bash |
| 45 | node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operation <connector> <operationId> |
| 46 | ``` |
| 47 | - This gives you the complete list of available inputs and outputs for the operation |
| 48 | - If the connector is not found, try broader terms. If still not found, inform the user and proceed with edits based on the existing action YAML and schema-lookup only |
| 49 | - **If the connector is SharePoint (`shared_sharepointonline`)**, read the SharePoint-specific reference before making any edits: |
| 50 | ``` |
| 51 | Read: ${CLAUDE_SKILL_DIR}/sharepoint-actions.md |
| 52 | ``` |
| 53 | This covers OData filter syntax, the critical `"'$filter'"` quoting pattern, which inputs should be Manual vs Automatic, and dynamic output handling. |
| 54 | |
| 55 | 4. **Determine the action type** from the YAML: |
| 56 | - If `action.kind` is `InvokeConnectorTaskAction` → regular connector action |
| 57 | - If `action.kind` is `InvokeExternalAgentTaskAction` → MCP server action |
| 58 | |
| 59 | 5. **Read the appropriate template** for structural reference: |
| 60 | - Connector actions: |
| 61 | ``` |
| 62 | Read: ${CLAUDE_SKILL_DIR}/../../templates/actions/connector-action.mcs.yml |
| 63 | ``` |
| 64 | - MCP actions: |
| 65 | ``` |
| 66 | Read: ${CLAUDE_SKILL_DIR}/../../templates/actions/mcp-action.mcs.yml |
| 67 | ``` |
| 68 | Use this alongside the connector-lookup output from step 3 to understand the YAML structure and available inputs/outputs. |
| 69 | |
| 70 | 6. **Make the requested edits** using the Edit tool. Common modifications: |
| 71 | |
| 72 | ### Modify Input Descriptions |
| 73 | Update `description` on `AutomaticTaskInput` entries to improve how the orchestrator fills them: |
| 74 | ```yaml |
| 75 | inputs: |
| 76 | - kind: AutomaticTaskInput |
| 77 | propertyName: body |
| 78 | description: The email body content in HTML format # <-- edit this |
| 79 | ``` |
| 80 | |
| 81 | ### Add or Remove Inputs |
| 82 | Cross-reference the connector definition to see all available input properties. Add new ones or remove unnecessary ones: |
| 83 | ```yaml |
| 84 | # Add a new input from the connector definition |
| 85 | - kind: AutomaticTaskInput |
| 86 | propertyNa |