# Apply students to exams

`add_exams_for_students`

- Writes
- Needs confirmation

Applies a batch of this account’s students to exams — up to fifty students, up to twenty exams each — using student handles and exam ids from find_exams_for_student. The first call answers a summary of how many students and how many applications, and a confirmation value; nothing is created until the same call is repeated with that confirmation. The answer says per student which exams were created, which were already held and which were refused. Nothing is charged: follow with get_students_payment_link.

- **For**: Teachers and partners
- **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

- `brand`string

  Which olympiad this is about. Required unless the connection covers exactly one, in which case that one is used.

  one of`coding``gmath``hilingua``neo``stem`
- `items`array of objectrequired

  One entry per student. Entries for the same student are not merged, so list each student once.

  min items`1`max items`50`

  2 fields of each item

  - `student`stringrequired

    The opaque student handle from a roster tool.

    pattern`^stu_[A-Za-z0-9._-]{1,1000}$`min length`5`max length`1024`
  - `exam_ids`array of stringrequired

    The exam ids from find_exams_for_student for this student’s grade.

    min items`1`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`**
- **`confirmation_required`**
- **`confirmation_expired`**
- **`exam_not_eligible`**
- **`not_found`**
