Skip to main content
Glama

tool_modify_assignment_dates

Change assignment dates in Gradescope by updating release, due, or late due dates for instructors and TAs.

Instructions

Modify the dates of an assignment (release, due, late due).

At least one date must be provided. Only the provided dates will be changed.
Requires instructor or TA access.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.
    release_date: New release date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
    due_date: New due date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
    late_due_date: New late due date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
    confirm_write: Must be True to apply the date change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes
release_dateNo
due_dateNo
late_due_dateNo
confirm_writeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the logic for modifying assignment dates, including argument parsing and calling the lower-level API.
    def modify_assignment_dates(
        course_id: str,
        assignment_id: str,
        release_date: str | None = None,
        due_date: str | None = None,
        late_due_date: str | None = None,
        confirm_write: bool = False,
    ) -> str:
        """Modify the dates of an assignment.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            release_date: New release date in ISO format (YYYY-MM-DDTHH:MM), or None to keep unchanged.
            due_date: New due date in ISO format (YYYY-MM-DDTHH:MM), or None to keep unchanged.
            late_due_date: New late due date in ISO format (YYYY-MM-DDTHH:MM), or None to keep unchanged.
            confirm_write: Must be True to perform the update.
        """
        if not course_id or not assignment_id:
            return "Error: both course_id and assignment_id are 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}`",
            ]
            if release_date:
                details.append(f"release_date={release_date}")
            if due_date:
                details.append(f"due_date={due_date}")
            if late_due_date:
                details.append(f"late_due_date={late_due_date}")
            return write_confirmation_required("modify_assignment_dates", details)
    
        try:
            conn = get_connection()
            success = update_assignment_date(
                session=conn.session,
                course_id=course_id,
                assignment_id=assignment_id,
                release_date=rd,
                due_date=dd,
                late_due_date=ldd,
            )
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error updating assignment dates: {e}"
    
        if success:
            updates = []
            if release_date:
                updates.append(f"Release date → {release_date}")
            if due_date:
                updates.append(f"Due date → {due_date}")
            if late_due_date:
                updates.append(f"Late due date → {late_due_date}")
            return f"✅ Assignment `{assignment_id}` dates updated successfully:\n" + "\n".join(f"- {u}" for u in updates)
        else:
            return f"❌ Failed to update dates for assignment `{assignment_id}`. Check your permissions."
  • The tool registration and the wrapper function exposed to the MCP server.
    def tool_modify_assignment_dates(
        course_id: str,
        assignment_id: str,
        release_date: str | None = None,
        due_date: str | None = None,
        late_due_date: str | None = None,
        confirm_write: bool = False,
    ) -> str:
        """Modify the dates of an assignment (release, due, late due).
    
        At least one date must be provided. Only the provided dates will be changed.
        Requires instructor or TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            release_date: New release date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
            due_date: New due date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
            late_due_date: New late due date (ISO format: YYYY-MM-DDTHH:MM), or None to keep unchanged.
            confirm_write: Must be True to apply the date change.
        """
        return modify_assignment_dates(
            course_id,
            assignment_id,
            release_date,
            due_date,
            late_due_date,
            confirm_write,
        )
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 and does well by disclosing key behavioral traits: it's a mutation operation (implied by 'Modify'), requires specific permissions ('instructor or TA access'), has a safety mechanism ('confirm_write: Must be True'), and explains update behavior ('Only the provided dates will be changed'). It doesn't mention rate limits or error conditions.

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 perfectly structured and front-loaded: the first sentence states the purpose, followed by constraints, permissions, then detailed parameter explanations. Every sentence earns its place with no wasted words.

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 6 parameters, no annotations, but with an output schema, the description is quite complete. It covers purpose, constraints, permissions, and all parameters thoroughly. The output schema presumably handles return values, so the description doesn't need to explain them. It could mention potential side effects more explicitly.

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?

The schema has 0% description coverage, but the description fully compensates by explaining all 6 parameters in detail: their purpose, format requirements ('ISO format: YYYY-MM-DDTHH:MM'), null behavior ('or None to keep unchanged'), and constraints ('At least one date must be provided'). This adds substantial 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 ('Modify the dates of an assignment') and identifies the exact resources affected ('release, due, late due'), distinguishing it from siblings like 'tool_rename_assignment' or 'tool_set_extension' which handle different aspects of assignments.

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 about when to use it ('Modify the dates of an assignment') and prerequisites ('Requires instructor or TA access'), but doesn't explicitly state when not to use it or name alternative tools for related date 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