Skip to main content
Glama

tool_get_student_submission

Retrieve a student's latest submission files from Gradescope to review or grade their work. Requires course ID, assignment ID, and student email.

Instructions

Get a specific student's most recent submission (instructor/TA only).

Returns links to the submission files.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.
    student_email: The student's email address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes
student_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Actual implementation logic for getting student submission content.
    def get_student_submission_content(course_id: str, assignment_id: str,
                                        student_email: str) -> str:
        """Get the full content of a student's submission, including text answers and image URLs.
    
        Supports two submission formats:
        1. **Online assignments**: Extracts text answers and uploaded file URLs from
           the AssignmentSubmissionViewer React component.
        2. **Scanned PDF exams**: Extracts per-page scanned images and the full PDF
           from embedded JSON in the raw HTML.
    
        Requires instructor/TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            student_email: The student's email address.
        """
        if not course_id or not assignment_id or not student_email:
            return "Error: course_id, assignment_id, and student_email are required."
    
        try:
            conn = get_connection()
            # First, find the submission ID for the student
            url = f"{conn.gradescope_base_url}/courses/{course_id}/assignments/{assignment_id}/scores"
            resp = conn.session.get(url)
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error fetching scores to find submission: {e}"
    
        if resp.status_code != 200:
            return f"Error accessing scores (status {resp.status_code})."
    
        # Find the student's submission ID
        reader = csv.DictReader(io.StringIO(resp.text))
        sub_id = None
        student_name = student_email
        for row in reader:
            if row.get("Email") == student_email:
                if row.get("Status") == "Missing" or not row.get("Submission ID"):
                    return f"Student {student_email} has no submission for this assignment."
                sub_id = row.get("Submission ID")
                student_name = f"{row.get('First Name', '')} {row.get('Last Name', '')}".strip()
  • MCP tool wrapper registration for get_student_submission.
    def tool_get_student_submission(
        course_id: str, assignment_id: str, student_email: str
    ) -> str:
        """Get a specific student's most recent submission (instructor/TA only).
    
        Returns links to the submission files.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            student_email: The student's email address.
        """
        return get_student_submission(course_id, assignment_id, student_email)
  • Intermediate helper function that bridges the MCP tool wrapper and the core logic.
    def get_student_submission(
        course_id: str, assignment_id: str, student_email: str
    ) -> str:
        """Get the full content of a specific student's submission.
    
        Requires instructor/TA access. Returns the student's text answers for each
        question, as well as direct URLs to any uploaded files or images.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            student_email: The student's email address.
        """
        if not course_id or not assignment_id or not student_email:
            return "Error: course_id, assignment_id, and student_email are required."
    
        return get_student_submission_content(course_id, assignment_id, student_email)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that it returns links to submission files, which is helpful behavioral information. However, it doesn't disclose important traits like whether this is a read-only operation, potential rate limits, authentication requirements beyond the role hint, or what happens if no submission exists. For a tool with zero annotation coverage, this leaves significant gaps.

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 a clear purpose statement, role restriction, return value information, and parameter explanations in a bullet-like format. Every sentence earns its place with no wasted words, and the most important information (what the tool does) is front-loaded.

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

Completeness3/5

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

Given that there's an output schema (which handles return value documentation), the description doesn't need to explain return values in detail. However, for a tool with 3 parameters, 0% schema coverage, and no annotations, the description should provide more behavioral context about error conditions, permissions, and operational constraints to be fully complete.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic meaning for all three parameters (course_id, assignment_id, student_email), explaining what each represents. This adds substantial value beyond the bare schema, though it doesn't specify format details like email validation or ID patterns.

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 a specific student's most recent submission'), identifies the resource (submission files), and distinguishes it from siblings like tool_get_assignment_submissions (which likely returns all submissions) by specifying it's for a single student's most recent submission. The instructor/TA restriction further clarifies the access context.

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 explicitly states 'instructor/TA only', providing clear context about when to use this tool based on user role. However, it doesn't mention when to use alternatives like tool_get_assignment_submissions or tool_smart_read_submission, nor does it specify prerequisites beyond the parameters.

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