Skip to main content
Glama

get_my_course_grades

Retrieve current grades, enrollment status, and recent performance for all enrolled courses in Canvas.

Instructions

Get your current grades across all enrolled courses.

Returns your current grade, enrollment status, and recent performance for each active course.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_my_course_grades' tool. It fetches the user's active courses with total_scores and current_grading_period_scores included, then extracts and formats the computed current grade or final score for each course.
    @mcp.tool()
    async def get_my_course_grades() -> str:
        """Get your current grades across all enrolled courses.
    
        Returns your current grade, enrollment status, and recent performance
        for each active course.
        """
        courses = await fetch_all_paginated_results(
            "/courses",
            params={
                "enrollment_state": "active",
                "include[]": ["total_scores", "current_grading_period_scores"],
                "per_page": 100
            }
        )
    
        if isinstance(courses, dict) and "error" in courses:
            return f"Error fetching courses: {courses['error']}"
    
        if not courses:
            return "No active course enrollments found."
    
        output_lines = ["Your Course Grades:\n"]
    
        for course in courses:
            name = course.get("name", "Unnamed Course")
            course_code = course.get("course_code", "")
    
            # Get enrollment data (grades)
            enrollments = course.get("enrollments", [])
            if enrollments:
                enrollment = enrollments[0]  # Student typically has one enrollment per course
    
                # Current score
                current_score = enrollment.get("computed_current_score")
                final_score = enrollment.get("computed_final_score")
                current_grade = enrollment.get("computed_current_grade", "N/A")
    
                # Format grade info
                if current_score is not None:
                    grade_info = f"{current_grade} ({current_score:.1f}%)"
                elif final_score is not None:
                    grade_info = f"{final_score:.1f}%"
                else:
                    grade_info = "No grade yet"
    
                output_lines.append(
                    f"• {course_code}: {name}\n"
                    f"  Current Grade: {grade_info}\n"
                )
            else:
                output_lines.append(
                    f"• {course_code}: {name}\n"
                    f"  Current Grade: No enrollment data\n"
                )
    
        return "\n".join(output_lines)
  • The call to register_student_tools(mcp) in the register_all_tools function, which invokes the registration of student tools including get_my_course_grades.
    register_student_tools(mcp)
  • Import of register_student_tools from student_tools.py in tools/__init__.py, enabling its use in server.py.
    from .student_tools import register_student_tools
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the tool's read-only nature implicitly ('Get') and outlines return content (grades, enrollment status, performance), but lacks details on permissions, rate limits, or error handling. It adds basic behavioral context but misses critical operational traits.

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?

The description is front-loaded with the core purpose in the first sentence, followed by a concise breakdown of return values. Both sentences earn their place by clarifying scope and output without redundancy or fluff, making it highly efficient.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, output schema exists), the description is largely complete. It explains what the tool does and what it returns, though it could benefit from more behavioral context (e.g., authentication needs). The output schema reduces the need for detailed return value explanations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately omits parameter details, focusing on the tool's purpose and output. A baseline of 4 is applied as it efficiently handles the parameter-free case.

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?

The description clearly states the specific action ('Get your current grades') and resource ('across all enrolled courses'), distinguishing it from siblings like 'get_assignment_analytics' or 'get_student_analytics' that focus on different data. It precisely defines the scope as personal grades for active courses.

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

Usage Guidelines3/5

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

The description implies usage for retrieving personal grade summaries, but does not explicitly state when to use this tool versus alternatives like 'get_my_submission_status' or 'get_my_todo_items'. No exclusions or prerequisites are mentioned, leaving usage context inferred rather than guided.

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