Skip to content
AI & Agents
Skill

/chat-sdk

Send a message to a Copilot Studio agent via the Copilot Studio Client SDK (M365). Use for agents with integrated auth (Entra ID SSO). Requires an App Registration Client ID.

From plugin
copilot-studio
49631 skills4 agents1 hook

Claude Code

$ npx -y skills add microsoft/skills-for-copilot-studio --skill chat-sdk --agent claude-code

SKILL.md

chat-sdk.SKILL.md
user-invocable: false
description: Send a message to a Copilot Studio agent via the Copilot Studio Client SDK (M365). Use for agents with integrated auth (Entra ID SSO). Requires an App Registration Client ID.
argument-hint: <utterance>
allowed-tools: Bash(node *chat-with-agent.bundle.js *), Read, Glob
agent: copilot-studio-test

Chat via Copilot Studio SDK

Send a single utterance to a published agent via the Copilot Studio Client SDK. Use this for agents with **integrated authentication / Entra ID SSO** (authenticationmode 2).

Prerequisites

Requires prior authentication via `/copilot-studio:test-auth`. Do NOT ask the user for a client ID yourself — the test-auth skill handles app registration setup and authentication.

Instructions

1. Run the script with `--client-id` and the utterance from `$ARGUMENTS`:

   node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js \
     --client-id "<clientId>" "<utterance>" [--agent-dir <path>]

2. **Authentication**: Requires prior authentication via `/copilot-studio:test-auth`. The token is cached in the `"test-agent"` slot and shared with the eval API. If auth fails or the SDK hangs, tell the caller to re-run `test-auth`.

3. Parse the JSON output from stdout:

{
  "status": "ok",
  "protocol": "m365",
  "utterance": "hello",
  "conversation_id": "abc123-...",
  "start_activities": [ ... ],
  "activities": [ ... ]
}

Display the agent's response from the `activities` array:

  • **Text**: activities where `type === "message"` — show `text`
  • **Suggested actions**: `suggestedActions.actions` array
  • **Adaptive cards**: `attachments` with `contentType === "application/vnd.microsoft.card.adaptive"`

**Save `conversation_id`** for follow-ups.

Multi-turn

Pass `--conversation-id` from the previous response:

node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js \
  --client-id "<id>" "<follow-up>" --conversation-id "<id>"

SDK sessions do not expire as quickly as DirectLine. Reuse `conversation_id` automatically for follow-ups.

Error Handling

| Error | Cause | Resolution | |-------|-------|------------| | `Authentication failed` | Wrong client ID or tenant | Verify app registration and permissions | | `Could not obtain conversation_id` | Agent not published or wrong config | Verify agent is published |

Read more
@microsoft
Ships withcopilot-studio

A plugin for Claude Code, GitHub Copilot CLI, and VS Code that enables authoring, testing, and troubleshooting Microsoft Copilot Studio STANDARD agents through YAML files — directly from your terminal or editor.

49631 skills4 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
496
Star history of microsoft/skills-for-copilot-studio on GitHub, a chart by star-history.com

Other skills on copilot-studio.

add-action

add-action

Guide users through adding a new connector action to a Copilot Studio agent. Connector actions require UI-based connection setup,…

add-knowledge

add-knowledge

Add a knowledge source (public website or SharePoint) to a Copilot Studio agent. Use when the user asks to add a knowledge…

add-node

add-node

Add or modify a node in an existing Copilot Studio topic. Use when the user asks to add a question, message, condition, variable,…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3w393k
@openclaw@openclawInstall Skill

Questions about chat-sdk.

Which coding agents can use chat-sdk?
chat-sdk installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.