Skip to main content
Glama

tool_rename_assignment

Change the title of an existing assignment on Gradescope to update course materials or correct naming errors.

Instructions

Rename an assignment on Gradescope.

Requires instructor or TA access.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.
    new_title: The new title for the assignment.
    confirm_write: Must be True to perform the rename.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes
new_titleYes
confirm_writeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool definition and registration for tool_rename_assignment.
    def tool_rename_assignment(
        course_id: str,
        assignment_id: str,
        new_title: str,
        confirm_write: bool = False,
    ) -> str:
        """Rename an assignment on Gradescope.
    
        Requires instructor or TA access.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            new_title: The new title for the assignment.
            confirm_write: Must be True to perform the rename.
        """
        return rename_assignment(course_id, assignment_id, new_title, confirm_write)
  • The core implementation logic for renaming an assignment, which interfaces with the Gradescope API.
    def rename_assignment(
        course_id: str,
        assignment_id: str,
        new_title: str,
        confirm_write: bool = False,
    ) -> str:
        """Rename an assignment.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            new_title: The new title for the assignment. Cannot be all whitespace.
            confirm_write: Must be True to perform the rename.
        """
        if not all([course_id, assignment_id, new_title]):
            return "Error: course_id, assignment_id, and new_title are all required."
    
        if not new_title.strip():
            return "Error: new_title cannot be all whitespace."
    
        if not confirm_write:
            return write_confirmation_required(
                "rename_assignment",
                [
                    f"course_id=`{course_id}`",
                    f"assignment_id=`{assignment_id}`",
                    f"new_title={new_title}",
                ],
            )
    
        try:
            conn = get_connection()
            success = update_assignment_title(
                session=conn.session,
                course_id=course_id,
                assignment_id=assignment_id,
                assignment_name=new_title,
            )
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            error_msg = str(e)
            if "invalid" in error_msg.lower():
                return f"Error: The title '{new_title}' is invalid."
            return f"Error renaming assignment: {e}"
    
        if success:
            return f"✅ Assignment `{assignment_id}` renamed to '{new_title}'."
        else:
            return f"❌ Failed to rename assignment `{assignment_id}`. Check your permissions."
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 of behavioral disclosure. It mentions the access requirement and includes a 'confirm_write' parameter as a safety measure, which adds useful context. However, it lacks details on potential side effects (e.g., if renaming affects linked data), rate limits, or error conditions, leaving gaps for a mutation tool.

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 front-loaded with the core purpose, followed by access requirements and parameter details in a clear, bullet-like structure. Every sentence earns its place with no wasted words, making it highly 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 that this is a mutation tool with no annotations but an output schema exists, the description covers the essential purpose, access needs, and parameters adequately. However, it could benefit from more behavioral context (e.g., confirmation of success/failure outcomes) to fully compensate for the lack of annotations, though the output schema mitigates some gaps.

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 lists all four parameters with brief explanations (e.g., 'The new title for the assignment'), adding meaningful semantics beyond the schema's titles. However, it does not provide format details (e.g., ID formats or title constraints), slightly limiting its utility.

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 ('Rename an assignment') and the platform ('on Gradescope'), distinguishing it from sibling tools like 'tool_modify_assignment_dates' or 'tool_get_assignment_details'. It uses a precise verb ('rename') and identifies the resource ('assignment').

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 'Requires instructor or TA access,' providing clear context for when to use this tool based on user permissions. However, it does not specify when not to use it or mention alternatives (e.g., compared to 'tool_modify_assignment_dates'), which prevents a perfect score.

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