Skip to main content
Glama

tool_get_extensions

Retrieve student extensions for a specific Gradescope assignment, displaying user IDs, names, and modified dates for instructor or TA access.

Instructions

Get all student extensions for a specific assignment.

Returns a table of extensions with user ID, name, and modified dates.
Requires instructor or 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 MCP tool handler function for 'tool_get_extensions'. It wraps the core 'get_extensions' logic.
    def tool_get_extensions(course_id: str, assignment_id: str) -> str:
        """Get all student extensions for a specific assignment.
    
        Returns a table of extensions with user ID, name, and modified dates.
        Requires instructor or TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
        """
        return get_extensions(course_id, assignment_id)
  • The actual implementation of 'get_extensions' which communicates with the Gradescope API.
    def get_extensions(course_id: str, assignment_id: str) -> str:
        """Get all extensions for a specific assignment.
    
        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()
            extensions = gs_get_extensions(
                session=conn.session,
                course_id=course_id,
                assignment_id=assignment_id,
            )
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            err = str(e)
            if "401" in err or "Status code: 401" in err:
                return (
                    f"⚠️ Extensions are not available for assignment `{assignment_id}`. "
                    "Some assignment types (e.g. exam-style or scanned PDF assignments) "
                    "do not support the extensions API endpoint, even for instructors. "
                    "You can still manage extensions via the Gradescope web UI."
                )
            return f"Error fetching extensions: {e}"
    
        if not extensions:
            return f"No extensions found for assignment `{assignment_id}` in course `{course_id}`."
    
        lines = [f"## Extensions for Assignment {assignment_id}\n"]
        lines.append("| User ID | Name | Release Date | Due Date | Late Due Date |")
        lines.append("|---------|------|-------------|----------|---------------|")
    
        for user_id, ext in extensions.items():
            lines.append(
  • The registration of 'tool_get_extensions' as an MCP tool using the @mcp.tool() decorator.
    @mcp.tool()
    def tool_get_extensions(course_id: str, assignment_id: str) -> str:
Behavior3/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 discloses access requirements ('Requires instructor or TA access') and return format ('Returns a table of extensions with user ID, name, and modified dates'), which adds useful behavioral context. However, it lacks details on rate limits, error handling, or pagination, leaving gaps for a read operation with no annotation support.

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: the first sentence states the purpose, followed by return details and access requirements, with parameter explanations in a clear 'Args' section. Every sentence adds value without redundancy, making it efficient and well-structured.

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 mostly complete. It covers purpose, access requirements, parameters, and return format. Since an output schema exists, it need not explain return values in detail, but it could benefit from mentioning sibling tool relationships or error cases for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, but the description compensates by listing and briefly explaining both parameters ('course_id: The Gradescope course ID' and 'assignment_id: The assignment ID'). This adds meaning beyond the bare schema. However, it does not provide format examples, constraints, or links to other tools, so it meets the baseline for partial compensation.

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: 'Get all student extensions for a specific assignment.' It specifies the verb ('Get'), resource ('student extensions'), and scope ('for a specific assignment'), making it easy to understand. However, it does not explicitly differentiate from sibling tools like 'tool_set_extension' or 'tool_modify_assignment_dates', which prevents a score of 5.

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 for usage: 'Requires instructor or TA access.' This indicates prerequisites and when the tool is applicable. However, it does not explicitly state when to use this tool versus alternatives (e.g., 'tool_set_extension' for modifying extensions or 'tool_get_assignment_details' for general assignment info), so it falls short of a 5.

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