Operations: planning, absences and cover
Assign cover (preview)
- Permission required
ops.substitutions.manage
When to use it
Prepares the cover of an uncovered class with an instructor (or a chain), with the same checks as the panel's "Assign" button: qualification, overlaps, absences, availability, rest and cap (errors block, warnings are shown). On confirm it is applied as in the panel.
Input
| Field | Type | Description |
|---|---|---|
request_id | integer | Cover request (from ops_uncovered / ops_overview) |
occurrence_id | string | Or the class: sessionId@YYYY-MM-DD (from ops_schedule / ops_find_session) |
worker_idRequired | integer | Who covers the class (from ops_cover_candidates; someone outside the ranking is a manual assignment) |
chain | object | Chain: who takes the class worker_id leaves (option.chain) |
chain.worker_idRequired | integer | |
chain.session_idRequired | integer | |
reason | string | |
organization_id | integer | Optional: can only be the key's organization |
Every tool also accepts lang (es | en) for the language of the text answer.
Output
| Field | Type | Description |
|---|---|---|
summaryRequired | string | What will change, in the caller's language |
effectsRequired | object | Structured detail of the change: affected people, classes, dates… |
confirm_tokenRequired | string | Pass it to confirm_action to execute. Single use, 15 minutes, only for this key |
expires_atRequired | string | ISO time when the token expires |
confirm_withRequired | "confirm_action" |
Examples
Example 1: Have Marta Ruiz cover the class
Call
{
"name": "ops_cover_assign_preview",
"arguments": {
"request_id": 812,
"worker_id": 15
}
}Example 2: Chain: Pol moves to the class and Noa takes Pol's
Call
{
"name": "ops_cover_assign_preview",
"arguments": {
"request_id": 812,
"worker_id": 7,
"chain": {
"worker_id": 9,
"session_id": 140
}
}
}Equivalent JSON-RPC call (POST /mcp)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ops_cover_assign_preview",
"arguments": {
"request_id": 812,
"worker_id": 15
}
}
}