skills/chat-sdk/SKILL.md
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.
npx skillsauth add microsoft/skills-for-copilot-studio skills/chat-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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).
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.
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>]
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.
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:
type === "message" — show textsuggestedActions.actions arrayattachments with contentType === "application/vnd.microsoft.card.adaptive"Save conversation_id for follow-ups.
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 | 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 |
testing
Validate Copilot Studio agent YAML files using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references). Use when the user asks to check, validate, or verify YAML files.
development
Authenticate for Copilot Studio evaluation API and SDK chat. Caches a token that is shared across run-eval and chat-sdk skills. Run this before any eval or SDK chat workflow. Requires an App Registration with MakerOperations and Copilots.Invoke permissions.
development
Run a batch test suite via the Copilot Studio Kit (Dataverse API). Uses the Power CAT Copilot Studio Kit to execute test cases against a published agent and produces pass/fail results with latencies. Requires the Kit installed in the environment, an App Registration with Dataverse permissions, and a published agent.
development
Run evaluations against a Copilot Studio agent via the Power Platform Evaluation API. Works on DRAFT agents — no publish step required. Lists test sets, starts a run, polls until complete, fetches results, and proposes YAML fixes for failures. Use when the user wants to test agent changes without publishing.