Skip to main content
Glama

tool_list_courses

Retrieve all Gradescope courses for authenticated users, organized by instructor or student roles with details like course ID, name, semester, and assignment counts.

Instructions

List all Gradescope courses for the authenticated user.

Returns courses grouped by role (instructor vs student), including course ID, name, semester, and assignment count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of the logic for listing courses.
    def list_courses() -> str:
        """List all courses for the authenticated user.
    
        Returns courses grouped by role (instructor vs student).
        """
        try:
            conn = get_connection()
            courses = conn.account.get_courses()
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error fetching courses: {e}"
    
        lines = []
    
        instructor_courses = courses.get("instructor", {})
        if instructor_courses:
            lines.append("## Instructor Courses\n")
            for course_id, course in instructor_courses.items():
                lines.append(
                    f"- **{course.name}** ({course.full_name})\n"
  • The registration of the 'tool_list_courses' tool using @mcp.tool() decorator.
    @mcp.tool()
    def tool_list_courses() -> str:
        """List all Gradescope courses for the authenticated user.
    
        Returns courses grouped by role (instructor vs student),
        including course ID, name, semester, and assignment count.
        """
        return list_courses()

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/Yuanpeng-Li/gradescope-mcp'

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