Skip to main content
Glama

tool_get_regrade_requests

List pending and completed regrade requests for a Gradescope assignment to review student submissions, questions, grader feedback, and status details.

Instructions

List all regrade requests for an assignment.

Returns a table of pending and completed regrade requests with student name,
question, grader, status, and identifiers for fetching details.
Requires instructor/TA access.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function `get_regrade_requests` which fetches and parses the regrade requests page for an assignment.
    def get_regrade_requests(course_id: str, assignment_id: str) -> str:
        """List all regrade requests for an assignment.
    
        Returns a table of pending and completed regrade requests with student name,
        question, grader, and status. Requires instructor/TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
        """
        if not course_id or not assignment_id:
            return "Error: course_id and assignment_id are required."
    
        try:
            conn = get_connection()
            url = (
                f"{conn.gradescope_base_url}/courses/{course_id}"
                f"/assignments/{assignment_id}/regrade_requests"
            )
            resp = conn.session.get(url)
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error fetching regrade requests: {e}"
    
        if resp.status_code != 200:
            return f"Error: Cannot access regrade requests (status {resp.status_code})."
    
        soup = BeautifulSoup(resp.text, "html.parser")
        table = soup.find("table")
        if not table:
            return f"No regrade requests found for assignment `{assignment_id}`. (Regrade requests may not be enabled.)"
    
        rows = table.find_all("tr")
        if len(rows) <= 1:
            return f"No regrade requests for assignment `{assignment_id}`."
    
        lines = [f"## Regrade Requests — Assignment {assignment_id}\n"]
        lines.append("| # | Status | Student | Question | Grader | Review Link |")
        lines.append("|---|--------|---------|----------|--------|-------------|")
    
        pending_count = 0
        completed_count = 0
    
        for i, row in enumerate(rows[1:], 1):
            cells = row.find_all("td")
            if len(cells) < 5:
                continue
    
            student = cells[0].text.strip()
            section = cells[1].text.strip()
            question = cells[2].text.strip()
            grader = cells[3].text.strip()
            completed = cells[4].text.strip()
    
            # Extract links for question_id and submission_id
            review_link = ""
            for a in row.find_all("a"):
                href = a.get("href", "")
                if "/grade" in href:
                    review_link = href
                    break
    
            # Extract IDs from review link
            qid_match = re.search(r"/questions/(\d+)", review_link)
            sid_match = re.search(r"/submissions/(\d+)", review_link)
            qid = qid_match.group(1) if qid_match else ""
            sid = sid_match.group(1) if sid_match else ""
    
            status = "✅" if completed else "⏳"
            if completed:
                completed_count += 1
            else:
                pending_count += 1
    
            id_info = f"qid={qid}, sid={sid}" if qid else ""
            lines.append(
                f"| {i} | {status} | {student} | {question} | {grader} | {id_info} |"
            )
    
        lines.append("")
        lines.append(f"**Pending:** {pending_count} | **Completed:** {completed_count} | **Total:** {pending_count + completed_count}")
        lines.append("")
        lines.append(
            "_Use `get_regrade_detail(course_id, question_id, submission_id)` to see "
            "the student's message and rubric for a specific request._"
        )
    
        return "\n".join(lines)
  • The MCP tool registration for `tool_get_regrade_requests`.
    def tool_get_regrade_requests(course_id: str, assignment_id: str) -> str:
        """List all regrade requests for an assignment.
    
        Returns a table of pending and completed regrade requests with student name,
        question, grader, status, and identifiers for fetching details.
        Requires instructor/TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
        """
        return get_regrade_requests(course_id, assignment_id)
Behavior3/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 adds useful context: it mentions the return format ('table of pending and completed regrade requests') and access requirements ('Requires instructor/TA access'). However, it lacks details on potential side effects, rate limits, or error handling, leaving some behavioral aspects unclear.

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 return details and access requirements, then parameter explanations. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

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 moderate complexity (2 parameters, no annotations, but with an output schema), the description is largely complete. It covers purpose, return format, access requirements, and parameters. Since an output schema exists, it needn't explain return values in detail, but it could benefit from mentioning any limitations (e.g., pagination) to achieve full completeness.

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 explicitly lists and describes both parameters ('course_id: The Gradescope course ID' and 'assignment_id: The assignment ID'), adding clear meaning beyond the bare schema. This fully compensates for the lack of schema descriptions, though it doesn't provide examples or format specifics.

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 ('List all regrade requests') and resource ('for an assignment'), distinguishing it from siblings like tool_get_regrade_detail (which fetches details for a specific request) and tool_get_assignment_submissions (which focuses on submissions rather than regrade requests). The verb 'List' is precise and the scope 'all regrade requests' is well-defined.

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?

The description provides clear context by specifying 'Requires instructor/TA access,' which indicates when to use this tool based on user permissions. However, it does not explicitly state when not to use it or name alternatives (e.g., tool_get_regrade_detail for fetching details of a specific request), which prevents a perfect score.

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