list_assignment_rubrics
Retrieve grading rubrics for a specific Canvas assignment to understand evaluation criteria and assessment requirements.
Instructions
Get rubrics attached to a specific assignment.
Args:
course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
assignment_id: The Canvas assignment ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignment_id | Yes | ||
| course_identifier | Yes |
Implementation Reference
- src/canvas_mcp/tools/rubrics.py:297-376 (handler)The core handler function implementing the 'list_assignment_rubrics' tool. It fetches assignment details including rubric and settings from Canvas API, checks for rubric presence, and formats a detailed summary of the rubric criteria, points, and settings.@mcp.tool() @validate_params async def list_assignment_rubrics(course_identifier: str | int, assignment_id: str | int) -> str: """Get rubrics attached to a specific assignment. Args: course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID assignment_id: The Canvas assignment ID """ course_id = await get_course_id(course_identifier) assignment_id_str = str(assignment_id) # Get assignment details with rubric information response = await make_canvas_request( "get", f"/courses/{course_id}/assignments/{assignment_id_str}", params={"include[]": ["rubric", "rubric_settings"]} ) if "error" in response: return f"Error fetching assignment rubrics: {response['error']}" # Check if assignment has rubric rubric = response.get("rubric") rubric_settings = response.get("rubric_settings", {}) use_rubric_for_grading = response.get("use_rubric_for_grading", False) if not rubric: assignment_name = response.get("name", "Unknown Assignment") course_display = await get_course_code(course_id) or course_identifier return f"No rubric found for assignment '{assignment_name}' in course {course_display}." # Format rubric information assignment_name = response.get("name", "Unknown Assignment") course_display = await get_course_code(course_id) or course_identifier result = f"Rubric for Assignment '{assignment_name}' in Course {course_display}:\n\n" # Rubric settings if rubric_settings: result += "Rubric Settings:\n" result += f" Used for Grading: {'Yes' if use_rubric_for_grading else 'No'}\n" result += f" Points Possible: {rubric_settings.get('points_possible', 'N/A')}\n" result += f" Hide Score Total: {'Yes' if rubric_settings.get('hide_score_total') else 'No'}\n" result += f" Hide Points: {'Yes' if rubric_settings.get('hide_points') else 'No'}\n\n" # Rubric criteria summary result += "Criteria Overview:\n" total_points = 0 for i, criterion in enumerate(rubric, 1): criterion_description = criterion.get("description", "No description") criterion_points = criterion.get("points", 0) ratings_count = len(criterion.get("ratings", [])) result += f"{i}. {criterion_description}\n" result += f" Points: {criterion_points}\n" result += f" Rating Levels: {ratings_count}\n" total_points += criterion_points result += f"\nTotal Possible Points: {total_points}\n" result += f"Number of Criteria: {len(rubric)}\n" # Extract rubric ID for use with get_rubric_details rubric_id = None if rubric and len(rubric) > 0: # The rubric ID might be in the first criterion or in rubric_settings if rubric_settings and "id" in rubric_settings: rubric_id = rubric_settings["id"] elif "id" in rubric[0]: # Sometimes the rubric ID is embedded in the criteria rubric_id = rubric[0].get("id") if rubric_id: result += f"Rubric ID: {rubric_id}\n" result += f"\nTo get detailed criteria descriptions, use: get_assignment_rubric_details with assignment_id {assignment_id}" return result
- src/canvas_mcp/server.py:51-51 (registration)Registration call in the main server setup that invokes register_rubric_tools(mcp), which defines and registers the list_assignment_rubrics tool along with other rubric tools.register_rubric_tools(mcp)
- src/canvas_mcp/tools/__init__.py:7-7 (registration)Import of register_rubric_tools from rubrics.py, making it available for server registration.from .rubrics import register_rubric_tools
- src/canvas_mcp/tools/rubrics.py:294-294 (registration)The registration function that contains the @mcp.tool() decorator for list_assignment_rubrics and other rubric tools.def register_rubric_tools(mcp: FastMCP) -> None: