Skip to main content
Glama

change_role

Assigns a course-level role (student, teacher, editing teacher, manager) to a user while preserving existing roles, as Moodle allows multiple roles per context.

Instructions

Assign a course-level role to a user (student / teacher / editingteacher / manager). Does NOT unassign previous roles — Moodle supports multiple roles per user per context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
new_roleYes
course_idYes
context_levelNoOnly course-level role assignment is supported in v0.5.course
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently states that previous roles are not unassigned and explains Moodle's multi-role-per-context behavior, which is critical for a mutation tool. It could be improved by mentioning permissions or failure modes, but the key side effect is clearly disclosed.

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 two sentences with no filler. The first sentence states the action and allowed roles; the second adds the critical caveat. Information is front-loaded, and every word earns its place.

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 tool with 4 parameters and no output schema, the description covers the main action and a crucial behavioral nuance, but it omits aspects like permission requirements, expected return value, and the v0.5 course-level-only limitation (which appears only in the schema description). It is adequate but not fully comprehensive.

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?

The schema description coverage is only 25%, so the description needs to compensate. It adds meaning for new_role by enumerating the accepted values and clarifies context_level as 'course-level'. However, it does not explain user_id or course_id beyond their names, which are intuitive but not explicitly defined. The description partially bridges the schema gap.

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 uses a specific verb ('Assign') and resource ('course-level role to a user'), and explicitly lists the supported roles. It clearly distinguishes the tool from sibling tools like enrol_csv by focusing on role assignment rather than enrolment. The added note about not unassigning previous roles further sharpens its purpose.

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

Usage Guidelines3/5

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

The description implies when to use the tool by noting that it does NOT unassign previous roles, indicating a use case where retaining existing roles is important. However, it does not explicitly state alternatives or contrast with sibling tools like enrol_csv or unenrol_student, so the guidance is mostly implied rather than explicit.

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/sernobre/moodle-mcp-sernobre'

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