Skip to content
alyn
Microsoft Official

Detect Mode skill

Detect a Copilot Studio agent's authentication mode (DirectLine vs M365) by querying Dataverse. Returns the mode and connection details needed to chat.

$npx skills add microsoft/skills-for-copilot-studio --skill detect-mode
View this skill on GitHubmicrosoft/skills-for-copilot-studio/skills/detect-mode/SKILL.md
Pack stars
490
Pack installs
331
Alyn Score
46/99
Updated
6 days ago
License
MIT
– views – installs via Alyn

Install Detect Mode

Pick your agent. Every command is ready to paste.

$npx skills add microsoft/skills-for-copilot-studio --skill detect-mode

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads detect-mode when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the detect-mode skill”. In Codex, type $detect-mode.

The skill itself

SKILL.md

FolderGitHub

Detect Agent Authentication Mode

Query the Dataverse bots entity to determine whether the agent uses DirectLine (no auth / manual auth) or the Copilot Studio SDK (integrated auth / Entra ID SSO).

Instructions

  1. Run the detect-only command:

    node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js --detect-only $ARGUMENTS
    

    If the agent is not at the project root, pass --agent-dir <path>.

  2. Parse the JSON output from stdout:

    DirectLine mode (authenticationmode 1 or 3)

    { "status": "ok", "mode": "directline", "authenticationmode": 1, "tokenEndpoint": "https://...", "schemaName": "..." }
    

    The agent uses no authentication or manual authentication. No user credentials needed. The tokenEndpoint is ready to use with /copilot-studio:chat-directline.

    M365 mode (authenticationmode 2)

    { "status": "ok", "mode": "m365", "authenticationmode": 2, "schemaName": "..." }
    

    The agent uses integrated authentication (Entra ID SSO). An App Registration Client ID is needed for /copilot-studio:chat-sdk.

  3. Return the result to the caller. Do not proceed to chat — that is a separate step.

Error Handling

Error Cause Resolution
No agent.mcs.yml found No agent in workspace Clone the agent first
No .mcs/conn.json found Agent not cloned via VS Code extension Clone with the extension
Could not detect authentication mode No cached Dataverse token Run a push/pull first to cache tokens, or ask the user about their auth config

Tips for Detect Mode

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 30 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Detect Mode

What does the Detect Mode skill do?

Detect a Copilot Studio agent's authentication mode (DirectLine vs M365) by querying Dataverse. Returns the mode and connection details needed to chat.

How do I install Detect Mode?

Run "npx skills add microsoft/skills-for-copilot-studio --skill detect-mode" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Detect Mode work in Cursor and Codex?

Yes. Detect Mode uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Detect Mode free?

Detect Mode is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.

Who made Detect Mode?

Detect Mode is published by Microsoft in the microsoft/skills-for-copilot-studio repository, together with 29 other skills.

Similar skills. From other creators.