Skip to main content
Glama

Assign a user to an environment

cs_admin_assign_user

Assigns a security role to a user or application user in a Power Platform environment. Requires confirm: true for live changes; otherwise returns a dry run.

Instructions

Give a user (or an application user) a security role in an environment. Changes a live environment: requires confirm: true. Runs 'pac admin assign-user' with the active pac auth profile. Mutates a live environment: requires confirm: true (a dry run otherwise).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for pac (for project commands: the solution project folder)
roleYesSecurity role name or id (cs_admin_list_security_roles)
userYesObject id or UPN, or the application id for an application user
confirmNoRequired to actually perform a change in a live environment. Without it the tool returns a dry run.
profileNopac auth profile to run as: the admin account for tenant commands. Defaults to CPS_ADMIN_PROFILE for admin commands and CPS_PAC_PROFILE otherwise, then the active profile. cs_init lists the profiles.
backgroundNoRun in the background and return a jobId immediately, for a command that takes longer than the client will wait. Poll cs_job_status.
environmentNoEnvironment id or URL
businessUnitNoBusiness unit id
timeoutSecondsNoDefault 600
applicationUserNoThe user is an application (service principal)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.8
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv0.1.5

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose the key trait: it mutates a live environment and is gated by confirm:true with a dry run otherwise. But the confirm/dry-run fact is already spelled out in the schema's confirm parameter description, and the description adds no auth/permission, idempotency, or failure behavior beyond naming the underlying 'pac admin assign-user' command and auth profile.

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

Conciseness2/5

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

The description says essentially the same thing twice: 'Changes a live environment: requires confirm: true' and 'Mutates a live environment: requires confirm: true (a dry run otherwise).' That duplication wastes a large share of an otherwise short description and buries the one novel detail (the pac command/profile) in the middle.

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

Completeness3/5

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

For a 10-parameter mutation tool with no annotations and no output schema, the description covers purpose, mutation nature, and the dry-run gate, which is the minimum viable set. It omits what the tool returns, how errors (e.g., unknown role) surface, and how it relates to the plural sibling, so it is adequate but not complete.

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

Parameters3/5

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

Schema description coverage is 100%, so all ten parameters are already documented in the schema (user, role, environment, applicationUser, businessUnit, profile, confirm, etc.). The description adds no syntax, format, or default detail beyond what the schema provides, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource: giving a user (or application user) a security role in an environment, which maps cleanly onto the required user/role/environment parameters. However, it does not differentiate itself from the near-identical sibling cs_admin_assign_users (plural), which an agent would have to disambiguate on its own.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance and no mention of alternatives, despite a confusingly similar sibling (cs_admin_assign_users) and related tools like cs_admin_list_security_roles and cs_admin_assign_group. The confirm requirement is stated, but that is a precondition, not usage routing.

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