Skip to main content
Glama

update_user_role_user

Idempotent

Update an existing LearnWorlds user's role by providing the new role_id and optional assignments. Adjust permissions or responsibilities without deleting and recreating the user.

Instructions

🟡 WRITE · updates data · PUT /v2/users/{id}/user-role

Updates the role assigned to the user.

Behavior: replaces the fields you send on an existing record in the live school. Idempotent: repeating it leaves the same state. Auth (admin API token + Lw-Client id) is injected server-side, never by the model; calls are throttled to stay under LearnWorlds' 30-per-10s cap and retried on 429/5xx. Parameters: the whole JSON payload goes in the single body argument, forwarded verbatim (the spec leaves body optional, but this endpoint expects one). Returns: HTTP <status> followed by the LearnWorlds JSON response body. A non-2xx reply surfaces as a tool error with that status and the API error payload — 401 bad/expired token, 403 not permitted, 404 no such record, 422 rejected input. Use when: only when the user asked to change an existing record. Read it first so you overwrite just the fields you mean to; use the create tool if it does not exist yet. Related Users tools: get_user_role_user, enroll_user_product, get_courses_enrollments_user, get_products_user, get_seat_offerings_that_user_is_member.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUser Id or email
bodyNoRequired fields change depending of role_id. If role_id is instructor, then assigned courses must be filled.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

The description goes well beyond the annotations by explaining the write behavior, idempotency, server-side auth injection, throttling/retry behavior, and exact return/error semantics. This gives the agent a strong operational model of what happens when the tool is invoked.

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 well-organized with labeled sections, front-loaded purpose, and no filler. Each sentence earns its place: behavior, auth, retry, parameters, returns, errors, and usage guidance are all covered without unnecessary repetition.

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

Completeness5/5

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

Given the nested body schema, role-dependent required fields, and absence of an output schema, the description supplies the missing operational context: return shape, error status meanings, idempotency, and the 'read first' overwrite warning. Together with the detailed input schema, an agent has everything needed to invoke this tool 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?

Schema coverage is 100%, so the baseline is solid, but the description adds meaningful extra context: the entire payload must go in the single 'body' argument, is forwarded verbatim, and the endpoint expects a body even though the spec marks it optional. This compensates for a potential schema ambiguity without repeating every field.

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 verb and resource: 'Updates the role assigned to the user.' It also distinguishes itself from related tools by explicitly framing this as changing an existing record and pointing to the create tool when the user does not exist yet.

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?

The 'Use when' section explicitly says to call this only when changing an existing record, advises reading the current record first to avoid overwriting unintended fields, and directs to the create tool if the record does not exist. It also lists related user tools, making alternative selection clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ohneben/Learnworlds-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server