Skip to main content
Glama

tool_get_assignment_graders

Retrieve the list of graders assigned to a specific question for instructors and TAs to manage grading responsibilities.

Instructions

Get the list of graders assigned to a specific question (instructor/TA only).

Args:
    course_id: The Gradescope course ID.
    question_id: The question ID within the assignment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
question_idYes

Implementation Reference

  • Implementation of tool_get_assignment_graders, which fetches and filters the list of graders assigned to a specific Gradescope question.
    def get_assignment_graders(course_id: str, question_id: str) -> str:
        """Get the list of graders for a specific question (instructor/TA only).
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID within the assignment.
        """
        if not course_id or not question_id:
            return "Error: both course_id and question_id are required."
    
        try:
            conn = get_connection()
            graders = conn.account.get_assignment_graders(course_id, question_id)
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error fetching graders: {e}"
    
        if not graders:
            return f"No graders found for question `{question_id}` in course `{course_id}`."
    
        # Filter: some question types return raw user IDs or internal labels
        _DIRTY_GRADER_PATTERNS = {"(needs labeling)", "(none)", "(unassigned)"}
        named_graders = [
            g for g in graders
            if not str(g).isdigit()
            and str(g).lower().strip() not in _DIRTY_GRADER_PATTERNS
        ]
        id_only = [g for g in graders if str(g).isdigit()]
        dirty_labels = [
            g for g in graders
            if str(g).lower().strip() in _DIRTY_GRADER_PATTERNS
        ]
    
        lines = [
            f"## Graders for Question {question_id}\n",
            f"**Total graders:** {len(named_graders)}\n",
        ]
        for grader in sorted(named_graders):
            lines.append(f"- {grader}")
    
        if id_only or dirty_labels:
            extras_count = len(id_only) + len(dirty_labels)
            lines.append(
                f"\n⚠️ **Note:** {extras_count} system/auto-grader "
                f"{'entry was' if extras_count == 1 else 'entries were'} "
                "filtered from the list."
            )
    
        return "\n".join(lines)
  • Registration of tool_get_assignment_graders in the MCP server.
    def tool_get_assignment_graders(
        course_id: str, question_id: str
    ) -> str:
        """Get the list of graders assigned to a specific question (instructor/TA only).
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID within the assignment.
        """
        return get_assignment_graders(course_id, question_id)

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