Skip to main content
Glama

get_submission_rubric_assessment

Retrieve rubric assessment scores for a student's submission in Canvas by providing course, assignment, and user identifiers.

Instructions

Get rubric assessment scores for a specific submission.

    Args:
        course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
        assignment_id: The Canvas assignment ID
        user_id: The Canvas user ID of the student
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes
assignment_idYes
user_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the get_submission_rubric_assessment tool. It fetches the submission via Canvas API, anonymizes data, retrieves the rubric assessment, matches it with rubric criteria, and formats a detailed report.
    async def get_submission_rubric_assessment(course_identifier: str | int,
                                             assignment_id: str | int,
                                             user_id: str | int) -> str:
        """Get rubric assessment scores for a specific submission.
    
        Args:
            course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
            assignment_id: The Canvas assignment ID
            user_id: The Canvas user ID of the student
        """
        course_id = await get_course_id(course_identifier)
        assignment_id_str = str(assignment_id)
        user_id_str = str(user_id)
    
        # Get submission with rubric assessment
        response = await make_canvas_request(
            "get",
            f"/courses/{course_id}/assignments/{assignment_id_str}/submissions/{user_id_str}",
            params={"include[]": ["rubric_assessment", "full_rubric_assessment"]}
        )
    
        if "error" in response:
            return f"Error fetching submission rubric assessment: {response['error']}"
    
        # Anonymize submission data to protect student privacy
        try:
            response = anonymize_response_data(response, data_type="submissions")
        except Exception as e:
            log_error(
                "Failed to anonymize rubric assessment data",
                exc=e,
                course_id=course_id,
                assignment_id=assignment_id,
                user_id=user_id
            )
            # Continue with original data for functionality
    
        # Check if submission has rubric assessment
        rubric_assessment = response.get("rubric_assessment")
    
        if not rubric_assessment:
            # Get user and assignment names for better error message
            assignment_response = await make_canvas_request(
                "get", f"/courses/{course_id}/assignments/{assignment_id_str}"
            )
            assignment_name = assignment_response.get("name", "Unknown Assignment") if "error" not in assignment_response else "Unknown Assignment"
    
            course_display = await get_course_code(course_id) or course_identifier
            return f"No rubric assessment found for user {user_id} on assignment '{assignment_name}' in course {course_display}."
    
        # Get assignment details for context
        assignment_response = await make_canvas_request(
            "get", f"/courses/{course_id}/assignments/{assignment_id_str}",
            params={"include[]": ["rubric"]}
        )
    
        assignment_name = assignment_response.get("name", "Unknown Assignment") if "error" not in assignment_response else "Unknown Assignment"
        rubric_data = assignment_response.get("rubric", []) if "error" not in assignment_response else []
    
        # Format rubric assessment
        course_display = await get_course_code(course_id) or course_identifier
    
        result = f"Rubric Assessment for User {user_id} on '{assignment_name}' in Course {course_display}:\n\n"
    
        # Submission details
        submitted_at = format_date(response.get("submitted_at"))
        graded_at = format_date(response.get("graded_at"))
        score = response.get("score", "Not graded")
    
        result += "Submission Details:\n"
        result += f"  Submitted: {submitted_at}\n"
        result += f"  Graded: {graded_at}\n"
        result += f"  Score: {score}\n\n"
    
        # Rubric assessment details
        result += "Rubric Assessment:\n"
        result += "=" * 30 + "\n"
    
        total_rubric_points = 0
    
        for criterion_id, assessment in rubric_assessment.items():
            # Find criterion details from rubric data
            criterion_info = None
            for criterion in rubric_data:
                if str(criterion.get("id")) == str(criterion_id):
                    criterion_info = criterion
                    break
    
            criterion_description = criterion_info.get("description", f"Criterion {criterion_id}") if criterion_info else f"Criterion {criterion_id}"
            points = assessment.get("points", 0)
            comments = assessment.get("comments", "")
            rating_id = assessment.get("rating_id")
    
            result += f"\n{criterion_description}:\n"
            result += f"  Points Awarded: {points}\n"
    
            if rating_id and criterion_info:
                # Find the rating description
                for rating in criterion_info.get("ratings", []):
                    if str(rating.get("id")) == str(rating_id):
                        result += f"  Rating: {rating.get('description', 'N/A')} ({rating.get('points', 0)} pts)\n"
                        break
    
            if comments:
                result += f"  Comments: {comments}\n"
    
            total_rubric_points += points
    
        result += f"\nTotal Rubric Points: {total_rubric_points}"
    
        return result
  • The call to register_rubric_tools which registers the get_submission_rubric_assessment tool among others.
    register_rubric_tools(mcp)
    register_peer_review_tools(mcp)
  • Import of register_rubric_tools function used for tool registration.
    from .rubrics import register_rubric_tools
  • Helper function to build form data for rubric assessments, used in grading tools but supports the overall rubric functionality.
    def build_rubric_assessment_form_data(
        rubric_assessment: dict[str, Any],
        comment: str | None = None
    ) -> dict[str, str]:
        """Convert rubric assessment dict to Canvas form-encoded format.
    
        Canvas API expects rubric assessment data as form-encoded parameters with
        bracket notation: rubric_assessment[criterion_id][field]=value
    
        Args:
            rubric_assessment: Dict mapping criterion IDs to assessment data
                              Format: {"criterion_id": {"points": X, "rating_id": Y, "comments": Z}}
            comment: Optional overall comment for the submission
    
        Returns:
            Flattened dict with Canvas bracket notation keys
    
        Example:
            Input: {"_8027": {"points": 2, "rating_id": "blank", "comments": "Great work"}}
            Output: {
                "rubric_assessment[_8027][points]": "2",
                "rubric_assessment[_8027][rating_id]": "blank",
                "rubric_assessment[_8027][comments]": "Great work"
            }
        """
        form_data: dict[str, str] = {}
    
        # Transform rubric_assessment object into Canvas's form-encoded format
        for criterion_id, assessment in rubric_assessment.items():
            # Points are required
            if "points" in assessment:
                form_data[f"rubric_assessment[{criterion_id}][points]"] = str(assessment["points"])
    
            # Rating ID is optional but recommended
            if "rating_id" in assessment:
                form_data[f"rubric_assessment[{criterion_id}][rating_id]"] = str(assessment["rating_id"])
    
            # Comments are optional
            if "comments" in assessment:
                form_data[f"rubric_assessment[{criterion_id}][comments]"] = str(assessment["comments"])
    
        # Add optional overall comment
        if comment:
            form_data["comment[text_comment]"] = comment
    
        return form_data
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' data, implying a read-only operation, but doesn't clarify permissions required (e.g., instructor vs. student access), rate limits, error conditions (e.g., if the submission lacks a rubric), or what happens if parameters are invalid. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by a parameter list. There's no wasted text, and the structure is clear. However, the parameter explanations are brief and could be more integrated into the flow, slightly affecting readability.

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

Completeness3/5

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

Given the tool has an output schema (which covers return values), no annotations, and 3 parameters with 0% schema coverage, the description is minimally adequate. It explains the purpose and parameters but lacks behavioral context (e.g., error handling) and usage guidelines. For a read operation with output schema support, it meets basic needs but leaves room for improvement in guiding the agent.

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 0%, so the schema provides no parameter descriptions. The description adds value by explaining each parameter's purpose (e.g., 'course_identifier: The Canvas course code or ID'), but it doesn't detail format constraints (e.g., specific code patterns) or relationships between parameters. This partially compensates for the schema gap but doesn't fully document semantics like valid ID ranges or examples beyond the course code.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get rubric assessment scores for a specific submission.' This specifies the verb ('Get'), resource ('rubric assessment scores'), and scope ('for a specific submission'). However, it doesn't explicitly differentiate from sibling tools like 'get_assignment_rubric_details' or 'get_rubric_details', which might retrieve rubric information without submission-specific scores.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether the submission must exist or be graded), nor does it compare to siblings like 'get_assignment_rubric_details' or 'grade_with_rubric'. The only implied context is retrieving scores for a submission, but no explicit usage scenarios or exclusions are stated.

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

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