Skip to main content
Glama

Publicar lote de avaliações aprovado pelo professor (idempotente, auditado e com controle de concorrência)

commit_grading_batch
Idempotent

Commits an authorized grading plan to Moodle after validating the approved hash and reviewer confirmation, with idempotent writes and audit logging.

Instructions

Executa exclusivamente um plano preparado por prepare_grading_batch e formalmente autorizado pelo professor. Distingue 4 níveis de controle: (1) validação técnica do plano, (2) integridade criptográfica pelo approvedPlanHash, (3) confirmação declarada via confirmedByReviewer=true e (4) autorização humana efetiva do docente. Se o plano não contiver alterações efetivas (status="prepared_no_changes"), commit_grading_batch retorna "unchanged_no_action_required" com 0 escritas no Moodle de forma totalmente idempotente. Protegido por verificação otimista de concorrência e registro em log de auditoria local redigido.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "planId": "<planId>",
      "approvedPlanHash": "<approvedPlanHash>",
      "confirmedByReviewer": "<confirmedByReviewer>",
      "operationId": "<operationId>",
      "publicationState": "<publicationState>",
      "notificationPolicy": "<notificationPolicy>"
    },
    "name": "commit_grading_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
planIdYesIdentificador planId retornado por prepare_grading_batch.
operationIdYesChave única de idempotência da operação (repetir o mesmo operationId não duplica escritas nem notificações).
reviewerNoteNoObservação opcional de auditoria registrada pelo revisor.
approvedPlanHashYesHash SHA-256 exato (planHash) aprovado pelo professor revisor.
publicationStateYesEstado explícito de publicação: "inmarking", "readyforreview", "inreview", "readyforrelease" ou "released". Se markingworkflow=0 na tarefa, estados não liberados são bloqueados em vez de publicar silenciosamente.
resumeFailedOnlyNoEm caso de retomada de partial_failure com o mesmo operationId, reexecuta apenas os registros pendentes/com falha (padrão: true).
notificationPolicyYesPolítica explícita de notificação aos estudantes: "suppress" (suprimir notificação), "moodle_default" ou "notify_students".
confirmedByReviewerYesDeclaração formal do cliente/agente de que o professor revisou e autorizou o plano. NOTA: Este parâmetro isolado não comprova de forma autônoma a autorização humana; a interface cliente deve colher a aprovação efetiva do docente antes de enviar true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare idempotentHint=true and destructiveHint=false, but the description adds real substance beyond them: the four-level authorization chain, optimistic concurrency checking, a redacted local audit log, and the concrete zero-write idempotent return "unchanged_no_action_required". It does not describe failure behavior (hash mismatch, partial failure surface) in the same depth, which keeps it below a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The prerequisite and exclusivity constraint are front-loaded, followed by a numbered list of control levels and then the no-op case, so an agent reading only the first sentence already knows the routing rule. The numbered breakdown is slightly dense but every clause carries operational information; nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter mutation with no output schema, the description supplies the essential calling context: prerequisite producer tool, idempotency key semantics, concurrency protection, and the specific no-changes return value. It leaves gaps around error responses (hash validation failure) and the shape of a successful commit result, which an agent would have to learn from the schema or trial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented individually, which sets the baseline at 3. The description adds conceptual framing by placing approvedPlanHash, confirmedByReviewer and publicationState into an explicit four-level control ladder, but it does not add syntax, formats, or edge-case meaning beyond that framing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb and scope: it executes ONLY a plan produced by prepare_grading_batch and authorized by the teacher. The exclusivity clause plus the explicit sibling reference makes it unmistakable versus prepare_grading_batch and verify_grading_batch, and the no-op path (status="prepared_no_changes") is named concretely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly states the precondition for use (a plan prepared by prepare_grading_batch and confirmed by the reviewer) and the resume scenario via operationId, which is solid when-to-use context. It stops short of naming verify_grading_batch as the pre-check alternative or stating when NOT to commit (e.g., unverified batch), so the routing guidance is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.