# Register new students

`register_students`

- Writes
- Needs confirmation

Registers new students for this teacher, up to fifty in one call, each on one to five olympiads at once, and enters them for the exams their row names on each. Every row needs the student’s own e-mail address, one no other Main Team account uses, and its olympiads, each one this account works on as a teacher; at most 100 student-olympiad pairs a call. The platform e-mails each new student their username and a generated password, and the student confirms the address the first time they sign in; neither the teacher nor this assistant ever sees the username or the password. The first call checks every row on every olympiad. If anything is wrong it answers needs_changes with the problems by row, column and olympiad, and nobody is registered; correct the rows with the teacher and call again, and never guess an address. Otherwise it answers a summary and a confirmation value, and nothing is created until the same call is repeated with that confirmation. The answer gives each new student’s handle on each olympiad, for the other student tools, and what each exam entry did. A student who already has an account is not registered again: they link themselves to the teacher with link_my_teacher. The columns come from get_student_registration_template, the exam ids from find_exams_for_grade.

- **For**: Teachers
- **Needs**: Read and write access (`mcp:write`)
- **What it changes**: **Writes.** The first call only shows what would change and returns a confirmation handle. Nothing changes until the agent calls again with that handle, after you agree.
- **Repeating it**: Not safe: the same call twice can change data twice.

## Inputs

- `students`array of objectrequired

  One entry per new student, at most 50, in the order of the sheet: a problem names its row by its place here, counting from 0.

  min items`1`max items`50`

  10 fields of each item

  - `first_name`stringrequired

    As the student writes it.

    min length`1`max length`60`
  - `last_name`stringrequired

    As the student writes it.

    min length`1`max length`60`
  - `email`stringrequired

    The student’s own address, which no other Main Team account uses. Their username and a generated password are sent here, and they confirm it at their first sign-in. Never a guess.

    format`email`min length`3`max length`254`
  - `birth_date`stringrequired

    DD/MM/YYYY.

    pattern`^\d{2}/\d{2}/\d{4}$`min length`10`max length`10`
  - `sex`stringrequired

    f or m.

    one of`f``m`
  - `grade`stringrequired

    The student’s school grade, "1" to "12".

    one of`1``2``3``4``5``6``7``8``9``10``11``12`
  - `phone`string

    Optional: digits, + ( ) - and spaces. Leave it out, or blank, when there is none.

    max length`30`
  - `city`string

    Optional: leave it out, or blank, for the teacher’s own city.

    max length`80`
  - `school`string

    Optional: leave it out, or blank, for the teacher’s own school. Required when city is given.

    max length`120`
  - `olympiads`array of objectrequired

    The olympiads to register this student on, each named once, at most 5. The account is made on the first; the student is linked to this teacher on each.

    min items`1`max items`5`

    2 fields of each item

    - `brand`stringrequired

      An olympiad this account works on as a teacher.

      one of`coding``gmath``hilingua``neo``stem`
    - `exam_ids`array of string

      Optional: the exam ids find_exams_for_grade answers on this olympiad for this student’s grade, at most 20.

      max items`20`
- `confirmation`string

  The `confirmation` value from this tool’s own `confirmation_required` answer. Send it back with exactly the same other arguments to go ahead; never invent one.

  pattern`^cfm_[A-Za-z0-9._-]{1,4000}$`min length`5`max length`4096`

The server refuses a call that carries any field not listed here, and says which one.

## Answers instead of a result

What the tool says when it cannot do what was asked, and what to do about it.

- **`not_connected`**
- **`insufficient_scope`**
- **`rate_limited`**
- **`writes_disabled`**
- **`temporarily_unavailable`**
- **`upstream_error`**
- **`brand_not_allowed`**
- **`role_required`**
- **`tenant_account_missing`**
- **`not_allowed_here`**
- **`confirmation_required`**
- **`confirmation_expired`**
