MCPDocumentation
On this page

Operations: planning, absences and cover

Class counts

ops_stats
Read
Permission required
ops.planning.view

When to use it

How many classes (and hours) in a period grouped by instructor (who actually teaches), activity, room, day or status: who teaches most, how many were cancelled, which days are lighter.

Input

FieldTypeDescription
date_fromstring
date_tostringMax 93 days
group_byRequired"worker" | "activity" | "space" | "day" | "status"
status"all" | "planned" | "pending_cover" | "substituted" | "cancelled"
worker_idinteger
service_idinteger
space_idinteger
location_idintegerCentre (id). Without it: every centre you can see
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
fromRequiredstring
toRequiredstring
group_byRequiredstring
totalRequirednumber
hoursRequirednumber
groupsRequiredobject[]
groups[].keyRequiredstring
groups[].classesRequirednumber
groups[].hoursRequirednumber

Examples

Example 1: Classes per instructor this month

Call

JSON
{
  "name": "ops_stats",
  "arguments": {
    "date_from": "2026-11-01",
    "date_to": "2026-11-30",
    "group_by": "worker"
  }
}

Equivalent JSON-RPC call (POST /mcp)

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ops_stats",
    "arguments": {
      "date_from": "2026-11-01",
      "date_to": "2026-11-30",
      "group_by": "worker"
    }
  }
}