Edit action

From microsoft/skills-for-copilot-studio · View interactive version

Edit action is an AI agent skill from the GitHub repository microsoft/skills-for-copilot-studio. Edit 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.

How to use this skill

Skill file

Edit Action

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.

Connector Lookup

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.

When the connector IS available, use the lookup tool to help the user before they go to the UI:

node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js list                              # List connectors
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operations <connector>            # List operations
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operation <connector> <opId>      # Full input/output details
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js search <keyword>                  # Search operations

Use schema lookup for structural properties:

node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary TaskDialog
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary InvokeConnectorTaskAction
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary InvokeExternalAgentTaskAction
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary ModelContextProtocolMetadata

Instructions

  1. Auto-discover the agent directory:

```

Glob: **/agent.mcs.yml

```

If multiple agents found, ask which one.

  1. Find the action file to edit:

```

Glob: <agent-dir>/actions/*.mcs.yml

```

Read the action file. If the user's request is ambiguous and multiple actions exist, list them and ask which one.

  1. Identify the connector and operation:

```bash

node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operation <connector> <operationId>

```

```

Read: ${CLAUDE_SKILL_DIR}/sharepoint-actions.md

```

This covers OData filter syntax, the critical "'$filter'" quoting pattern, which inputs should be Manual vs Automatic, and dynamic output handling.

  1. Determine the action type from the YAML:
  1. Read the appropriate template for structural reference:

```

Read: ${CLAUDE_SKILL_DIR}/../../templates/actions/connector-action.mcs.yml

```

```

Read: ${CLAUDE_SKILL_DIR}/../../templates/actions/mcp-action.mcs.yml

```

Use this alongside the connector-lookup output from step 3 to understand the YAML structure and available inputs/outputs.

  1. Make the requested edits using the Edit tool. Common modifications:

### Modify Input Descriptions

Update description on AutomaticTaskInput entries to improve how the orchestrator fills them:

```yaml

inputs:

propertyName: body

description: The email body content in HTML format # <-- edit this

```

### Add or Remove Inputs

Cross-reference the connector definition to see all available input properties. Add new ones or remove unnecessary ones:

```yaml

# Add a new input from the connector definition

propertyName: importance

description: The importance level of the email (Low, Normal, High)

```

### Switch Between AutomaticTaskInput and ManualTaskInput

```yaml

# Change from automatic to manual (hardcode a value)

propertyName: timeZone

value: "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"

```

### Modify Outputs

Add or remove output properties. Cross-reference the connector definition for available outputs:

```yaml

outputs:

description: The unique ID of the created item

```

### Change modelDisplayName / modelDescription

These control how the orchestrator understands and routes to this action:

```yaml

modelDisplayName: Send a Teams message

modelDescription: Posts a message to a Teams chat or channel on behalf of the user

```

### Change Connection Mode

```yaml

action:

connectionProperties:

mode: Invoker # or Maker

```

### MCP Actions — Editable Fields

MCP actions (InvokeExternalAgentTaskAction with ModelContextProtocolMetadata) have a simpler structure than connector actions. The MCP protocol handles tool discovery, so there are no explicit inputs/outputs.

Safe to edit:

```yaml

modelDisplayName: Microsoft Learn Docs MCP Server # display name for the orchestrator

modelDescription: MCP Server to search Microsoft Learn content # routing description

action:

connectionProperties:

mode: Invoker # or Maker

```

MCP actions may also have ManualTaskInput entries for passing context to the MCP server (e.g., user identity as a header):

```yaml

inputs:

propertyName: userid

value: =System.User.Email

```

This is fine — ManualTaskInput with Power Fx expressions can pass user context. But do NOT add AutomaticTaskInput entries — MCP handles tool parameter discovery dynamically.

Do NOT edit on MCP actions:

  1. Validate the edited file:

```bash

node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js validate <action-file-path>

```

  1. Inform the user about next steps:

Important Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.