Skip to main content
Glama

Adicionar participante(s) a um grupo da disciplina

add_group_member
Idempotent

Adds one or more enrolled students to an existing Moodle group, validating managegroups permission, course enrollment, participant limits, and group uniqueness before confirming the final state.

Instructions

Adiciona um ou mais alunos matriculados a um grupo existente, validando moodle/course:managegroups, matrícula na disciplina, limite máximo de participantes (maxMembers do mod_groupselect) e unicidade de grupo. Operação idempotente e auditada que confirma o estado final no Moodle antes de retornar.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "groupId": "<groupId>"
    },
    "name": "add_group_member"
  }
}

Input Schema

NameRequiredDescriptionDefault
userIdNoID de um usuário/aluno (userid) a adicionar ao grupo.
groupIdYesID do grupo (groupId) no Moodle.
userIdsNoLista opcional de IDs de usuários a adicionar ao grupo (alternativa ou complemento a userId).
courseIdNoID opcional da disciplina (validado contra o grupo).
activityCmidNoCourse module ID opcional (ex: 1569070, mod_groupselect) cujas regras de limite máximo e agrupamento devem ser respeitadas.
idempotencyKeyNoChave opcional de idempotência para auditoria e repetição segura.
allowMultipleGroupsNoSe false (padrão), impede adicionar um aluno que já pertença a outro grupo no escopo da mesma atividade mod_groupselect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Goes well beyond the annotations by naming the required capability (moodle/course:managegroups), the enrollment precondition, the maxMembers limit from mod_groupselect, group-uniqueness enforcement, audit logging, and the post-write verification of final Moodle state. It does not cover partial-failure behavior when several users are supplied, which keeps it short of a 5.

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

Conciseness4/5

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

A single dense sentence that front-loads the action and then the validations, with no filler. It is slightly overloaded with parenthetical technical references, but every clause carries information an agent needs.

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 a mutation tool with no output schema, it covers permissions, preconditions, limits, idempotency and confirmation of the resulting state, which is most of what an agent needs. The main gap is outcome semantics for multi-user calls, such as whether failures are all-or-nothing.

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 3; the description earns an extra point by tying activityCmid to the maxMembers/grouping rules and by framing idempotency and auditing, giving the agent context the schema fields only state flatly. It says nothing about allowMultipleGroups or the userId/userIds relationship, leaving some meaning to the schema alone.

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?

States a specific verb and resource ('Adiciona um ou mais alunos matriculados a um grupo existente') and immediately narrows scope to existing groups, which cleanly separates it from create_course_group, create_group_with_members, remove_group_member and get_group_members.

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?

Implies the usage context (group must already exist, students must be enrolled, mod_groupselect limits apply) but never states when to prefer this over create_group_with_members or how to proceed after a rejection. Guidance is inferable rather than explicit, and no alternatives are named.

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