Skip to main content
Glama

Sign in (MSAL)

cs_login

Authenticate to Microsoft Copilot Studio cloud tools by acquiring a Microsoft Entra token. Supports interactive browser sign-in or device code flow.

Instructions

Acquire a Microsoft Entra token for the cloud tools (evaluations, environments, agents, publish, chat, drift). mode 'interactive' (default) starts a browser sign-in and returns within waitSeconds: status 'ok' when it completed, otherwise status 'pending' with the sign-in URL. If no browser opened, show the user that URL to open on the machine running this server; the page redirects to localhost and the login completes in the background (check cs_login_status or call any cloud tool). mode 'device_code' returns a code to enter at microsoft.com/devicelogin (some tenants block this flow). Not needed for pac commands, which use 'pac auth create'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoDefault interactive
scopeNoWhich resource to pre-authorise. Default powerplatform (evaluations); 'flow' is the Power Automate service used by the flow-run tools; 'graph' reads the Microsoft 365 agent catalogue and 'graph_write' also blocks and reassigns. Others are acquired silently later when possible.
clientIdNoEntra app (client) id for MSAL. Defaults to CPS_CLIENT_ID, then the first-party VS Code id.
tenantIdNoEntra tenant id. Defaults to the workspace sync metadata, then CPS_TENANT_ID.
workspaceNoPath to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory.
openBrowserNointeractive: try to open the browser from the server (default true). Set false when the server runs where no browser can appear.
waitSecondsNointeractive: how long to wait for the sign-in before returning 'pending' (default 15; keep it below the client's tool timeout)
dataverseUrlNoRequired when scope is dataverse, e.g. https://org.crm.dynamics.com

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden. It discloses the interactive flow, pending/ok statuses, the sign-in URL fallback, the localhost redirect, device-code behavior, and tenant blocking. It does not explicitly say whether an existing token is replaced or how long the token remains valid, so it is not fully exhaustive, but it is transparent about the main operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but dense: every sentence conveys operational information. It is front-loaded with the purpose, then organizes the interactive flow, device-code flow, and pac exclusion without filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter authentication tool with no output schema and no annotations, the description covers the return statuses, the pending-URL fallback, the device-code path, the status-check route, and the pac alternative. The only notable gap is that it does not specify exact response field names or behavior when already authenticated, but it is sufficient for an agent to invoke and interpret the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% parameter coverage, so the baseline is 3. The description adds value beyond the schema by clarifying the behavior of mode ('interactive' returns pending with URL, 'device_code' returns an entry code), the wait/return semantics, and the openBrowser fallback. It does not discuss every parameter, but the ones it addresses are the genuinely complex ones.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action and resource: 'Acquire a Microsoft Entra token for the cloud tools.' It immediately distinguishes the tool's purpose from pac commands and references the related status tool, so an agent can tell cs_login apart from cs_login_status and cs_logout without inspecting schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when the tool is not needed ('Not needed for pac commands, which use pac auth create'), and it gives clear mode-selection guidance: interactive is default, device_code is blocked by some tenants. It also directs the agent to check cs_login_status or call any cloud tool after a pending login. This is strong routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools