Skip to main content
Glama

moodle_save_grade

Destructive

Saves a participant's assignment grade and feedback comments after teacher confirmation, making them visible to the student and triggering notifications if enabled.

Instructions

Saves a participant's grade for an assignment and writes feedback comments. THE STUDENT WILL SEE the grade and feedback (immediately, or after release if marking workflow is enabled) and may receive a notification. Call only after the teacher has explicitly confirmed the grade and the text. The grade is checked against the assignment maximum. If feedback is omitted, the existing feedback is kept unchanged.

Input Schema

NameRequiredDescriptionDefault
gradeYesGrade: points from 0 to the assignment maximum; for a scale, the item number from 1
userIdYesParticipant id (userId from moodle_list_submissions)
feedbackNoFeedback comments for the student; if omitted, the existing feedback is kept
addAttemptNoOpen a new attempt for the student (if the assignment allows it)
applyToAllNoFor group assignments, apply the grade to the whole group
assignmentIdYesAssignment id from moodle_list_assignments (the id field, NOT the cmid from the mod/assign/view.php?id=… URL)
attemptNumberNoAttempt number; -1 means the latest
workflowStateNoMarking workflow state (if enabled): notmarked, inmarking, readyforreview, inreview, readyforrelease, released
feedbackFormatNofeedback format: plain — plain text (paragraphs separated by a blank line), markdown, htmlplain

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructive/non-idempotent/open-world, and the description adds consequences the annotations cannot express: the student will see the grade and feedback (immediately or after release under marking workflow), a notification may fire, the grade is validated against the assignment maximum, and omitted feedback is preserved rather than cleared.

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

Conciseness5/5

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

Five short sentences, each carrying a distinct obligation (effect, visibility, precondition, validation, feedback-default), with the highest-stakes fact ('THE STUDENT WILL SEE') emphasized early.

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

Completeness5/5

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

For a 9-parameter destructive mutation with no output schema, the description covers the write's side effects, the release/notification path, validation behavior, and the confirmation prerequisite. Nothing needed to invoke it safely is missing.

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 the baseline is 3. The description echoes two points already in the schema (grade checked against the maximum, omitted feedback retained) but adds no syntax or format detail for parameters like workflowState, addAttempt, or applyToAll beyond what the schema states.

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?

States a specific verb and resource ('Saves a participant's grade for an assignment') plus the secondary write ('writes feedback comments'), which is unambiguous next to the read-only siblings like moodle_get_submission and moodle_list_submissions.

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?

Gives a firm precondition: 'Call only after the teacher has explicitly confirmed the grade and the text,' which is exactly the kind of gating guidance a write tool needs. It does not name an alternative tool for correcting or deleting a grade, but sibling read tools are clearly not substitutes here.

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