MCPDocumentation
On this page

Operations: planning, absences and cover

Assign cover (preview)

ops_cover_assign_preview
Two-phase write
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

FieldTypeDescription
request_idintegerCover request (from ops_uncovered / ops_overview)
occurrence_idstringOr the class: sessionId@YYYY-MM-DD (from ops_schedule / ops_find_session)
worker_idRequiredintegerWho covers the class (from ops_cover_candidates; someone outside the ranking is a manual assignment)
chainobjectChain: who takes the class worker_id leaves (option.chain)
chain.worker_idRequiredinteger
chain.session_idRequiredinteger
reasonstring
organization_idintegerOptional: can only be the key's organization

Every tool also accepts lang (es | en) for the language of the text answer.

Output

FieldTypeDescription
summaryRequiredstringWhat will change, in the caller's language
effectsRequiredobjectStructured detail of the change: affected people, classes, dates…
confirm_tokenRequiredstringPass it to confirm_action to execute. Single use, 15 minutes, only for this key
expires_atRequiredstringISO time when the token expires
confirm_withRequired"confirm_action"

Examples

Example 1: Have Marta Ruiz cover the class

Call

JSON
{
  "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

JSON
{
  "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)

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ops_cover_assign_preview",
    "arguments": {
      "request_id": 812,
      "worker_id": 15
    }
  }
}