Skip to main content
Glama

tool_delete_rubric_item

Remove a rubric item from a question in Gradescope, automatically updating all submissions and recalculating scores.

Instructions

Delete a rubric item from a question.

**WARNING**: Removes the item from ALL submissions and recalculates scores.

Args:
    course_id: The Gradescope course ID.
    question_id: The question ID.
    rubric_item_id: The rubric item ID to delete.
    confirm_write: Must be True to delete the item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
question_idYes
rubric_item_idYes
confirm_writeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the delete_rubric_item tool handler.
    def delete_rubric_item(
        course_id: str,
        question_id: str,
        rubric_item_id: str,
        confirm_write: bool = False,
    ) -> str:
        """Delete a rubric item from a question.
    
        **WARNING**: Deleting a rubric item removes it from ALL submissions.
        Any students who had this item applied will have their scores recalculated.
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID.
            rubric_item_id: The rubric item ID to delete.
            confirm_write: Must be True to delete the item.
        """
        if not course_id or not question_id or not rubric_item_id:
            return "Error: course_id, question_id, and rubric_item_id are required."
    
        if not confirm_write:
            return write_confirmation_required(
                "delete_rubric_item",
                [
                    f"course_id=`{course_id}`",
                    f"question_id=`{question_id}`",
                    f"rubric_item_id=`{rubric_item_id}`",
                    "⚠️ This permanently deletes the item and recalculates ALL affected scores.",
                ],
            )
    
        try:
            conn = get_connection()
            subs_url = (
                f"{conn.gradescope_base_url}/courses/{course_id}"
                f"/questions/{question_id}/submissions"
            )
            resp = conn.session.get(subs_url)
            if resp.status_code != 200:
                return f"Error accessing question page (status {resp.status_code})."
    
            soup = BeautifulSoup(resp.text, "html.parser")
            csrf_meta = soup.find("meta", {"name": "csrf-token"})
            csrf_token = csrf_meta.get("content", "") if csrf_meta else ""
        except AuthError as e:
            return f"Authentication error: {e}"
        except Exception as e:
            return f"Error: {e}"
    
        delete_url = (
            f"{conn.gradescope_base_url}/courses/{course_id}"
            f"/questions/{question_id}/rubric_items/{rubric_item_id}"
        )
    
        headers = {
            "X-CSRF-Token": csrf_token,
            "Accept": "application/json",
            "X-Requested-With": "XMLHttpRequest",
        }
    
        try:
            resp = conn.session.delete(delete_url, headers=headers)
        except Exception as e:
            return f"Error deleting rubric item: {e}"
    
        if resp.status_code in (200, 204):
            return (
                f"✅ Rubric item `{rubric_item_id}` deleted.\n"
                f"All affected submissions have been recalculated."
            )
        else:
            return f"Error: Delete failed (status {resp.status_code}). Response: {resp.text[:300]}"
  • The registration of tool_delete_rubric_item with the MCP server.
    def tool_delete_rubric_item(
        course_id: str,
        question_id: str,
        rubric_item_id: str,
        confirm_write: bool = False,
    ) -> str:
        """Delete a rubric item from a question.
    
        **WARNING**: Removes the item from ALL submissions and recalculates scores.
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID.
            rubric_item_id: The rubric item ID to delete.
            confirm_write: Must be True to delete the item.
        """
        return delete_rubric_item(
            course_id, question_id, rubric_item_id, 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 of behavioral disclosure. It effectively describes the destructive nature ('WARNING: Removes the item from ALL submissions and recalculates scores'), which is crucial for a mutation tool. It also mentions the 'confirm_write' parameter as a safety measure, adding context beyond basic functionality.

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 well-structured and front-loaded with the core purpose and critical warning, followed by a clear parameter list. Every sentence adds value, with no wasted words, 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 complexity (destructive mutation) and lack of annotations, the description does a good job covering purpose, impact, and parameters. Since an output schema exists, it need not explain return values. However, it could benefit from more details on prerequisites or error conditions.

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?

The schema description coverage is 0%, so the description must compensate. It lists all four parameters with brief explanations (e.g., 'The Gradescope course ID'), which adds meaning beyond the schema's titles. However, it does not provide detailed semantics like format examples or constraints, leaving some gaps.

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 ('Delete a rubric item from a question'), identifies the resource ('rubric item'), and distinguishes it from siblings like 'tool_create_rubric_item' and 'tool_update_rubric_item' by specifying deletion rather than creation or modification.

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 (to delete a rubric item) and includes a warning about the impact ('Removes the item from ALL submissions and recalculates scores'), which helps guide usage. However, it does not explicitly mention when not to use it or name specific alternatives among siblings.

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