Skip to main content
Glama

get_assignment_rubric_details

Retrieve detailed rubric criteria and rating descriptions for Canvas assignments to understand grading expectations and requirements.

Instructions

Get detailed rubric criteria and rating descriptions for an 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
NameRequiredDescriptionDefault
course_identifierYes
assignment_idYes

Implementation Reference

  • The handler function implementing the get_assignment_rubric_details tool. It fetches assignment details including rubric from Canvas API and formats a detailed text response with criteria, ratings, and descriptions.
    async def get_assignment_rubric_details(course_identifier: str | int,
                                          assignment_id: str | int) -> str:
        """Get detailed rubric criteria and rating descriptions for an 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 full 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 rubric details: {response['error']}"
    
        # Check if assignment has rubric
        rubric = response.get("rubric")
        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 detailed rubric information
        assignment_name = response.get("name", "Unknown Assignment")
        course_display = await get_course_code(course_id) or course_identifier
        rubric_settings = response.get("rubric_settings", {})
        use_rubric_for_grading = response.get("use_rubric_for_grading", False)
    
        result = f"Detailed Rubric for Assignment '{assignment_name}' in Course {course_display}:\n\n"
    
        # Rubric metadata
        result += f"Assignment ID: {assignment_id}\n"
        result += f"Used for Grading: {'Yes' if use_rubric_for_grading else 'No'}\n"
        if rubric_settings:
            result += f"Total Points Possible: {rubric_settings.get('points_possible', 'N/A')}\n"
        result += f"Number of Criteria: {len(rubric)}\n\n"
    
        # Detailed criteria and ratings
        result += "Detailed Criteria and Rating Scales:\n"
        result += "=" * 60 + "\n"
    
        total_points = 0
        for i, criterion in enumerate(rubric, 1):
            criterion_id = criterion.get("id", "N/A")
            description = criterion.get("description", "No description")
            long_description = criterion.get("long_description", "")
            points = criterion.get("points", 0)
            ratings = criterion.get("ratings", [])
    
            result += f"\nCriterion #{i}: {description}\n"
            result += f"Criterion ID: {criterion_id}\n"
            result += f"Maximum Points: {points}\n"
    
            if long_description and long_description != description:
                result += f"Full Description: {long_description}\n"
    
            if ratings:
                result += f"\nRating Scale ({len(ratings)} levels):\n"
                # Sort ratings by points (highest to lowest)
                sorted_ratings = sorted(ratings, key=lambda x: x.get("points", 0), reverse=True)
    
                for _, rating in enumerate(sorted_ratings):
                    rating_description = rating.get("description", "No description")
                    rating_points = rating.get("points", 0)
                    rating_id = rating.get("id", "N/A")
                    long_desc = rating.get("long_description", "")
    
                    result += f"  {rating_points} pts: {rating_description}"
                    if rating_id != "N/A":
                        result += f" [ID: {rating_id}]"
                    result += "\n"
    
                    if long_desc and long_desc != rating_description:
                        # Format long description nicely
                        formatted_desc = long_desc.replace("\\n", "\n    ")
                        result += f"    Details: {formatted_desc}\n"
            else:
                result += "No rating scale defined for this criterion.\n"
    
            total_points += points
            result += "\n" + "-" * 40 + "\n"
    
        result += f"\nTotal Rubric Points: {total_points}"
    
        return result
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vishalsachdev/canvas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server