Skip to main content
Glama

tool_set_extension

Set or update assignment due date extensions for students in Gradescope courses to accommodate individual needs.

Instructions

Add or update an extension for a student on an assignment.

If the student already has an extension, it will be overwritten.
At least one date must be provided. Dates must be in order:
release_date <= due_date <= late_due_date.

Requires instructor or TA access.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.
    user_id: The student's Gradescope user ID (found via get_course_roster).
    release_date: Extension release date (ISO format: YYYY-MM-DDTHH:MM).
    due_date: Extension due date (ISO format: YYYY-MM-DDTHH:MM).
    late_due_date: Extension late due date (ISO format: YYYY-MM-DDTHH:MM).
    confirm_write: Must be True to apply the extension update.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes
user_idYes
release_dateNo
due_dateNo
late_due_dateNo
confirm_writeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that receives the request and calls the underlying extension utility.
    def tool_set_extension(
        course_id: str,
        assignment_id: str,
        user_id: str,
        release_date: str | None = None,
        due_date: str | None = None,
        late_due_date: str | None = None,
        confirm_write: bool = False,
    ) -> str:
        """Add or update an extension for a student on an assignment.
    
        If the student already has an extension, it will be overwritten.
        At least one date must be provided. Dates must be in order:
        release_date <= due_date <= late_due_date.
    
        Requires instructor or TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            user_id: The student's Gradescope user ID (found via get_course_roster).
            release_date: Extension release date (ISO format: YYYY-MM-DDTHH:MM).
            due_date: Extension due date (ISO format: YYYY-MM-DDTHH:MM).
            late_due_date: Extension late due date (ISO format: YYYY-MM-DDTHH:MM).
            confirm_write: Must be True to apply the extension update.
        """
        return set_extension(
            course_id,
  • The core logic implementation for setting an extension.
    def set_extension(
        course_id: str,
        assignment_id: str,
        user_id: str,
        release_date: str | None = None,
        due_date: str | None = None,
        late_due_date: str | None = None,
        confirm_write: bool = False,
    ) -> str:
        """Add or update an extension for a student on an assignment.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            user_id: The student's Gradescope user ID. Use get_course_roster to find user IDs.
            release_date: Extension release date in ISO format (YYYY-MM-DDTHH:MM), or None.
            due_date: Extension due date in ISO format (YYYY-MM-DDTHH:MM), or None.
            late_due_date: Extension late due date in ISO format (YYYY-MM-DDTHH:MM), or None.
            confirm_write: Must be True to perform the update.
        """
        if not all([course_id, assignment_id, user_id]):
            return "Error: course_id, assignment_id, and user_id are all required."
    
        if not any([release_date, due_date, late_due_date]):
            return "Error: at least one date must be provided."
    
        def parse_date(date_str: str | None) -> datetime.datetime | None:
            if date_str is None:
                return None
            try:
                return datetime.datetime.fromisoformat(date_str)
            except ValueError:
                raise ValueError(f"Invalid date format: '{date_str}'. Use ISO format: YYYY-MM-DDTHH:MM")
    
        try:
            rd = parse_date(release_date)
            dd = parse_date(due_date)
            ldd = parse_date(late_due_date)
        except ValueError as e:
            return f"Error: {e}"
    
        if not confirm_write:
            details = [
                f"course_id=`{course_id}`",
                f"assignment_id=`{assignment_id}`",
                f"user_id=`{user_id}`",
            ]
  • Registration of the tool_set_extension function as an MCP tool.
    @mcp.tool()
Behavior4/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 effectively describes key behaviors: the overwrite behavior ('If the student already has an extension, it will be overwritten'), permission requirements ('Requires instructor or TA access'), and the confirmation mechanism ('confirm_write: Must be True to apply the extension update'). It doesn't mention error conditions, rate limits, or what the output contains, but provides substantial operational context.

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 purpose first, then behavioral notes, then detailed parameter explanations. Every sentence earns its place: the first states the core function, the next three describe critical behaviors, and the parameter section provides essential context. There's no redundant or verbose content.

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?

For a mutation tool with 7 parameters, 0% schema coverage, no annotations, but with an output schema present, the description is quite complete. It covers purpose, behavior, permissions, parameter semantics, and constraints. The presence of an output schema means return values don't need explanation. Minor gaps include lack of error case descriptions and no explicit distinction from sibling tools like 'tool_modify_assignment_dates'.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all 7 parameters. It clarifies the purpose of each parameter, provides format requirements ('ISO format: YYYY-MM-DDTHH:MM'), ordering constraints ('Dates must be in order: release_date <= due_date <= late_due_date'), and special requirements ('At least one date must be provided', 'confirm_write: Must be True'). This adds significant value beyond the bare schema.

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 ('Add or update an extension for a student on an assignment') and identifies the resources involved (student, assignment, extension). It distinguishes itself from sibling tools like 'tool_get_extensions' (which reads extensions) and 'tool_modify_assignment_dates' (which modifies assignment-level dates rather than student-specific extensions).

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 when to use this tool: when managing student-specific assignment extensions. It mentions prerequisites ('Requires instructor or TA access') and references a related tool ('user_id... found via get_course_roster'). However, it doesn't explicitly state when NOT to use it (e.g., vs. modifying assignment-level dates with 'tool_modify_assignment_dates') or provide alternatives for related operations.

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