Skip to main content
Glama

delete_rubric

Remove a rubric from a Canvas course and delete all its associations to clean up course materials.

Instructions

Delete a rubric and remove all its associations.

    Args:
        course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
        rubric_id: The ID of the rubric to delete
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes
rubric_idYes

Implementation Reference

  • The delete_rubric tool handler. Deletes a specified rubric from a Canvas course by making a DELETE request to the Canvas API /courses/{course_id}/rubrics/{rubric_id} endpoint. Fetches rubric title beforehand for confirmation in the response.
    @mcp.tool()
    @validate_params
    async def delete_rubric(course_identifier: str | int,
                          rubric_id: str | int) -> str:
        """Delete a rubric and remove all its associations.
    
        Args:
            course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
            rubric_id: The ID of the rubric to delete
        """
        course_id = await get_course_id(course_identifier)
        rubric_id_str = str(rubric_id)
    
        # Get rubric details before deletion for confirmation
        rubric_response = await make_canvas_request(
            "get",
            f"/courses/{course_id}/rubrics/{rubric_id_str}"
        )
    
        rubric_title = "Unknown Rubric"
        if "error" not in rubric_response:
            rubric_title = rubric_response.get("title", "Unknown Rubric")
    
        # Delete the rubric
        response = await make_canvas_request(
            "delete",
            f"/courses/{course_id}/rubrics/{rubric_id_str}"
        )
    
        if "error" in response:
            return f"Error deleting rubric: {response['error']}"
    
        course_display = await get_course_code(course_id) or course_identifier
    
        result = f"Rubric deleted successfully from course {course_display}!\n\n"
        result += "Deleted Rubric Details:\n"
        result += f"  ID: {rubric_id}\n"
        result += f"  Title: {rubric_title}\n"
        result += "  All associations have been removed\n"
    
        return result
  • Registration of rubric tools (including delete_rubric) via register_rubric_tools(mcp) call in the main server setup.
    register_rubric_tools(mcp)
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/vishalsachdev/canvas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server