Skip to main content
Glama

tool_export_assignment_scores

Export detailed per-question student scores and statistics for a Gradescope assignment to analyze performance and grading patterns.

Instructions

Export per-question scores for an assignment.

Returns a summary table with student names, total scores, statistics,
and per-question breakdowns. 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 core implementation of the export_assignment_scores function.
    def export_assignment_scores(course_id: str, assignment_id: str) -> str:
        """Export per-question scores for an assignment as a formatted table.
    
        Returns a summary table with student names, total scores, and per-question
        breakdowns. 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: both course_id and assignment_id are required."
    
        try:
            conn = get_connection()
            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: {e}"
    
        if resp.status_code != 200:
            return f"Error: Cannot access scores (status {resp.status_code}). Check permissions."
    
        content_type = resp.headers.get("content-type", "")
        if "csv" not in content_type and "text" not in content_type:
            return f"Error: Unexpected content type: {content_type}"
    
        # Parse the CSV
        reader = csv.DictReader(io.StringIO(resp.text))
  • Registration of the tool_export_assignment_scores as an MCP tool, which calls the grading utility function.
    @mcp.tool()
    def tool_export_assignment_scores(course_id: str, assignment_id: str) -> str:
        """Export per-question scores for an assignment.
    
        Returns a summary table with student names, total scores, statistics,
        and per-question breakdowns. Requires instructor/TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
        """
        return export_assignment_scores(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. It discloses access requirements ('Requires instructor/TA access') and output behavior ('Returns a summary table...'), which is helpful. However, it misses details like rate limits, error handling, or whether the export is destructive (e.g., file generation). The description doesn't contradict annotations, as none exist.

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 appropriately sized and front-loaded, starting with the core purpose, followed by output details, access requirements, and parameter explanations in a logical flow. Every sentence adds value without redundancy, 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 has an output schema), the description is reasonably complete. It covers purpose, output, access needs, and parameter semantics. With an output schema present, it doesn't need to detail return values, though it could mention behavioral aspects like side effects or limitations.

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 adds meaning by explaining that 'course_id' is 'The Gradescope course ID' and 'assignment_id' is 'The assignment ID,' providing context beyond the schema's generic titles. This clarifies the parameters' roles, though it could specify format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Export per-question scores for an assignment' with specific verb ('Export') and resource ('per-question scores for an assignment'). It distinguishes itself from siblings like 'tool_get_assignment_statistics' by focusing on export functionality, though it doesn't explicitly contrast with all related tools.

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

Usage Guidelines3/5

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

The description provides some usage context with 'Requires instructor/TA access,' indicating prerequisites. However, it lacks explicit guidance on when to use this tool versus alternatives like 'tool_get_assignment_statistics' or 'tool_get_assignment_submissions,' leaving the agent to infer based on the 'export' focus.

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