list_all_rubrics
Retrieve all rubrics for a Canvas course to view grading criteria and ratings for assignments.
Instructions
List all rubrics in a specific course with optional detailed criteria.
Args:
course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
include_criteria: Whether to include detailed criteria and ratings (default: True)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_identifier | Yes | ||
| include_criteria | No |
Implementation Reference
- src/canvas_mcp/tools/rubrics.py:790-880 (handler)The handler function that implements the list_all_rubrics MCP tool. It fetches all rubrics for a given course using Canvas API, optionally includes detailed criteria and ratings, and formats them into a readable summary.async def list_all_rubrics(course_identifier: str | int, include_criteria: bool = True) -> str: """List all rubrics in a specific course with optional detailed criteria. Args: course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID include_criteria: Whether to include detailed criteria and ratings (default: True) """ course_id = await get_course_id(course_identifier) # Fetch all rubrics for the course rubrics = await fetch_all_paginated_results(f"/courses/{course_id}/rubrics") if isinstance(rubrics, dict) and "error" in rubrics: return f"Error fetching rubrics: {rubrics['error']}" if not rubrics: course_display = await get_course_code(course_id) or course_identifier return f"No rubrics found for course {course_display}." # Get course display name course_display = await get_course_code(course_id) or course_identifier result = f"All Rubrics for Course {course_display}:\n\n" for i, rubric in enumerate(rubrics, 1): rubric_id = rubric.get("id", "N/A") title = rubric.get("title", "Untitled Rubric") points_possible = rubric.get("points_possible", 0) reusable = rubric.get("reusable", False) read_only = rubric.get("read_only", False) data = rubric.get("data", []) result += "=" * 80 + "\n" result += f"Rubric #{i}: {title} (ID: {rubric_id})\n" result += f"Total Points: {points_possible} | Criteria: {len(data)} | " result += f"Reusable: {'Yes' if reusable else 'No'} | " result += f"Read-only: {'Yes' if read_only else 'No'}\n" if include_criteria and data: result += "\nCriteria Details:\n" result += "-" * 16 + "\n" for j, criterion in enumerate(data, 1): criterion_id = criterion.get("id", "N/A") description = criterion.get("description", "No description") long_description = criterion.get("long_description", "") points = criterion.get("points", 0) ratings = criterion.get("ratings", []) result += f"\n{j}. {description} (ID: {criterion_id}) - {points} points\n" if long_description and long_description != description: # Truncate long descriptions to keep output manageable truncated_desc = truncate_text(long_description, 150) result += f" Description: {truncated_desc}\n" if ratings: # Sort ratings by points (highest to lowest) sorted_ratings = sorted(ratings, key=lambda x: x.get("points", 0), reverse=True) for rating in sorted_ratings: rating_description = rating.get("description", "No description") rating_points = rating.get("points", 0) rating_id = rating.get("id", "N/A") result += f" - {rating_description} ({rating_points} pts) [ID: {rating_id}]\n" # Include long description if it exists and differs rating_long_desc = rating.get("long_description", "") if rating_long_desc and rating_long_desc != rating_description: truncated_rating_desc = truncate_text(rating_long_desc, 100) result += f" {truncated_rating_desc}\n" else: result += " No rating scale defined for this criterion.\n" elif include_criteria: result += "\nNo criteria defined for this rubric.\n" result += "\n" # Add summary result += "=" * 80 + "\n" result += f"Total Rubrics Found: {len(rubrics)}\n" if include_criteria: result += "\nNote: Use the criterion and rating IDs shown above with the grade_with_rubric tool.\n" result += "Example: {\"criterion_id\": {\"points\": X, \"comments\": \"...\", \"rating_id\": \"rating_id\"}}\n" else: result += "\nTo see detailed criteria and ratings, run this command with include_criteria=True.\n" return result
- src/canvas_mcp/server.py:51-51 (registration)The call to register_rubric_tools(mcp) within register_all_tools, which registers the list_all_rubrics tool among other rubric tools.register_rubric_tools(mcp)
- src/canvas_mcp/tools/__init__.py:7-7 (registration)Import of register_rubric_tools from rubrics.py, enabling its use in server.py for tool registration.from .rubrics import register_rubric_tools