Skip to main content
Glama

list_rubrics

Read-only

Retrieve all rubrics for a given course, with an option to include detailed criteria and ratings.

Instructions

List all rubrics in a specific course with optional detailed criteria.

    Args:
        course_identifier: Course code or Canvas ID
        include_criteria: Include detailed criteria and ratings (default: True)
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes
include_criteriaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The list_rubrics async function that lists all rubrics in a course, optionally including detailed criteria and ratings. Uses fetch_all_paginated_results to get rubrics from Canvas API and formats the output with rubric info, criteria descriptions, and rating details.
    async def list_rubrics(course_identifier: str | int,
                              include_criteria: bool = True) -> str:
        """List all rubrics in a specific course with optional detailed criteria.
    
        Args:
            course_identifier: Course code or Canvas ID
            include_criteria: 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
  • The register_rubric_tools function that registers all rubric-related MCP tools including list_rubrics via the @mcp.tool decorator on line 754.
    def register_rubric_tools(mcp: FastMCP) -> None:
        """Register all rubric-related MCP tools."""
  • Server registration of rubric tools (including list_rubrics) called when role is 'educator' or 'all'.
    register_rubric_tools(mcp)
  • Export of register_rubric_tools from the tools package.
    from .rubrics import register_rubric_tools
    from .student_tools import register_student_tools
    
    __all__ = [
        'register_accessibility_tools',
        'register_admin_tools',
        'register_code_execution_tools',
        'register_course_tools',
        'register_discovery_tools',
        'register_educator_assignment_tools',
        'register_educator_discussion_tools',
        'register_educator_file_tools',
        'register_educator_messaging_tools',
        'register_educator_module_tools',
        'register_educator_page_crud_tools',
        'register_page_tools',
        'register_peer_review_comment_tools',
        'register_peer_review_tools',
        'register_rubric_tools',
        'register_shared_assignment_tools',
        'register_shared_content_tools',
        'register_shared_discussion_tools',
        'register_shared_file_tools',
        'register_shared_messaging_tools',
        'register_shared_module_tools',
        'register_student_tools',
    ]
  • Docstring and signature of list_rubrics: parameters course_identifier (str|int) and include_criteria (bool, default True), returns str.
    """List all rubrics in a specific course with optional detailed criteria.
    
    Args:
        course_identifier: Course code or Canvas ID
        include_criteria: Include detailed criteria and ratings (default: True)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true. The description adds that include_criteria defaults to True, clarifying optional behavior. No contradictions. It doesn't discuss rate limits or auth, but given annotations cover safety profile, this is adequate.

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 concise: one line purpose plus a short Args section. No superfluous words. Front-loaded with the main action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with output schema, the description completely covers the tool's purpose and parameters. It's sufficient for an agent to use correctly.

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 description explains course_identifier as 'course code or Canvas ID' and include_criteria as including detailed criteria with default True. This adds meaning beyond the schema, which only has types. Schema coverage is 0% by text, so description compensates well.

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 verb 'list', the resource 'rubrics', and the scope 'in a specific course'. It also mentions optional detailed criteria, which helps differentiate from siblings like get_rubric.

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?

It indicates when to use: to list rubrics in a course. Though it does not explicitly exclude alternatives, the context (siblings like get_rubric) implies when not to use it. A mention of 'use get_rubric for a specific rubric' would earn a 5.

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/vishalsachdev/canvas-mcp'

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