add_class_staff
Add teachers, assistants, or room parents to a class while preserving existing staff. Assign roles and skip duplicates in one update.
Instructions
Assign teachers, assistants, or room parents to a class. Requires PS_ENABLE_WRITES.
SAFETY: Never call this tool or remove_class_staff in parallel, even for different sections. ParentSquare replaces the full staff list, and concurrent writes have caused unrelated associations to disappear. The server serializes calls within this process; still use one call at a time and verify with a fresh get_class read before the next class-staff write.
The class's existing staff are read first and preserved — only the listed people are added, all in a single update. Anyone already holding the role is skipped; anyone on the class under a different role is moved to this one. Room parents are ordinary guardians: get their user_id from list_parents. Teachers and assistants come from list_staff.
Args: section_id: Class/section ID (from list_classes) user_ids: One or more user IDs (list_staff for staff, list_parents for room parents) role: One of TEACHER, ASSISTANT, ROOM_PARENT — applied to everyone in user_ids class_title: Optional label shown on the class (defaults to the role name)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes | ||
| user_ids | Yes | ||
| section_id | Yes | ||
| class_title | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |