Skip to main content
Glama

tool_get_course_roster

Retrieve course roster with student, TA, and instructor details including names, emails, IDs, and submission counts for Gradescope course management.

Instructions

Get the full roster (students, TAs, instructors) for a course.

Returns a table grouped by role with name, email, SID, and submission count.
Requires instructor or TA access to the course.

Args:
    course_id: The Gradescope course ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core implementation of the roster retrieval logic.
    def get_course_roster(course_id: str) -> str:
        """Get the roster of students and staff for a course.
    
        Uses a custom HTML parser (the gradescopeapi library's parser
        has a bug with the column indexing when sections are present).
    
        Args:
            course_id: The Gradescope course ID.
        """
        if not course_id:
            return "Error: course_id is required."
    
        try:
            conn = get_connection()
            # Fetch the memberships page directly
            url = f"{conn.gradescope_base_url}/courses/{course_id}/memberships"
            resp = conn.session.get(url)
            if resp.status_code != 200:
                return f"Error: Unable to access roster (status {resp.status_code}). Check your permissions."
    
            soup = BeautifulSoup(resp.text, "html.parser")
            members = _parse_roster(soup, course_id)
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error fetching roster: {e}"
    
        if not members:
            return f"No members found for course `{course_id}`, or you don't have permission to view the roster."
    
        # Group by role
        by_role: dict[str, list] = {}
        for member in members:
            role = member["role"]
            by_role.setdefault(role, []).append(member)
  • The MCP tool registration and wrapper function for get_course_roster.
    @mcp.tool()
    def tool_get_course_roster(course_id: str) -> str:
        """Get the full roster (students, TAs, instructors) for a course.
    
        Returns a table grouped by role with name, email, SID, and submission count.
        Requires instructor or TA access to the course.
    
        Args:
            course_id: The Gradescope course ID.
        """
        return get_course_roster(course_id)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the return format ('table grouped by role with name, email, SID, and submission count') and access requirements ('instructor or TA access'), covering key behavioral aspects. It doesn't mention rate limits or pagination, but provides sufficient context for safe use.

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 efficiently structured with three sentences: purpose, return format, access requirements, and parameter explanation. Each sentence adds essential information without redundancy, making it easy to scan and understand.

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

Completeness5/5

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

Given the tool's moderate complexity (single parameter, read-only operation), no annotations, and the presence of an output schema (which handles return value details), the description is complete. It covers purpose, access control, return format, and parameter semantics, leaving no significant gaps for the agent to operate effectively.

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 schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that 'course_id' is 'The Gradescope course ID', clarifying the parameter's purpose beyond the schema's generic title 'Course Id'. This adequately covers the single parameter's semantics.

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 action ('Get'), resource ('full roster for a course'), and scope ('students, TAs, instructors'), distinguishing it from sibling tools like tool_get_assignment_submissions or tool_get_student_submission that focus on submissions rather than roster data.

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

Usage Guidelines4/5

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

It specifies when to use this tool by stating 'Requires instructor or TA access to the course', providing clear context about prerequisites. However, it doesn't explicitly mention when not to use it or name alternatives among siblings, such as tool_get_assignment_graders which might overlap in some contexts.

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

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