tool_apply_grade
Apply grades to student submissions by setting rubric items, point adjustments, and comments within the Gradescope grading system.
Instructions
Apply a grade to a student's question submission.
Can apply/remove rubric items, set point adjustments, and add comments.
**WARNING**: This modifies student grades.
Args:
course_id: The Gradescope course ID.
question_id: The question ID.
submission_id: The question submission ID.
rubric_item_ids: List of rubric item IDs to apply (checked). Items NOT
in this list will be unchecked. Pass None to keep unchanged.
point_adjustment: Submission-specific point adjustment. Pass None to keep.
comment: Grader comment. Pass None to keep unchanged.
confidence: Agent's self-assessed grading confidence (0.0-1.0).
Below 0.6 = rejected. 0.6-0.8 = warning. Above 0.8 = OK.
Pass None to skip confidence gating (manual mode).
confirm_write: Must be True to save the grade.Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | ||
| question_id | Yes | ||
| submission_id | Yes | ||
| rubric_item_ids | No | ||
| point_adjustment | No | ||
| comment | No | ||
| confidence | No | ||
| confirm_write | No |
Implementation Reference
- The core implementation of the grading logic that validates confidence levels and interacts with the Gradescope API.
def apply_grade( course_id: str, question_id: str, submission_id: str, rubric_item_ids: list[str] | None = None, point_adjustment: float | None = None, comment: str | None = None, confidence: float | None = None, confirm_write: bool = False, ) -> str: - src/gradescope_mcp/server.py:398-435 (registration)The wrapper function `tool_apply_grade` exposed to the MCP server that delegates to `apply_grade`.
def tool_apply_grade( course_id: str, question_id: str, submission_id: str, rubric_item_ids: list[str] | None = None, point_adjustment: float | None = None, comment: str | None = None, confidence: float | None = None, confirm_write: bool = False, ) -> str: """Apply a grade to a student's question submission. Can apply/remove rubric items, set point adjustments, and add comments. **WARNING**: This modifies student grades. Args: course_id: The Gradescope course ID. question_id: The question ID. submission_id: The question submission ID. rubric_item_ids: List of rubric item IDs to apply (checked). Items NOT in this list will be unchecked. Pass None to keep unchanged. point_adjustment: Submission-specific point adjustment. Pass None to keep. comment: Grader comment. Pass None to keep unchanged. confidence: Agent's self-assessed grading confidence (0.0-1.0). Below 0.6 = rejected. 0.6-0.8 = warning. Above 0.8 = OK. Pass None to skip confidence gating (manual mode). confirm_write: Must be True to save the grade. """ return apply_grade( course_id, question_id, submission_id, rubric_item_ids, point_adjustment, comment, confidence, confirm_write, )