Chat via Copilot Studio SDK
SkillCommunicationLets your agent send a message to a published Copilot Studio agent and show its reply.
Then ask your AI: use the Chat via Copilot Studio SDK skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add it as a step in a pipeline you build on Ahel, or connect Ahel to Claude, ChatGPT, Cursor, Claude Code or Codex and ask your AI to use it.
About this skill
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.
What this skill tells your AI
The instructions your AI receives, as published by microsoft/skills-for-copilot-studio in skills/chat-sdk/SKILL.md and read by Ahel’s review.
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
-
Run the script with
--client-idand the utterance from$ARGUMENTS:node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js \ --client-id "<clientId>" "<utterance>" [--agent-dir <path>] -
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-runtest-auth. -
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"— showtext - Suggested actions:
suggestedActions.actionsarray - Adaptive cards:
attachmentswithcontentType === "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 |
Signals
- GitHub stars
- 462
- Forks
- 100
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
chat-sdk-microsoft- Source
- github.com/microsoft/skills-for-copilot-studio
github.com/microsoft/skills-for-copilot-studio
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · sickn33
The pick for JavaScriptslack-gif-creator
Skill · anthropics
More in Communicationerror-handling
Skill · affaan-m
More in Communicationemails
Skill · coreyhaines31
More in Communicationwait-what
Skill · mattpocock
More in Communication