Skip to main content
Glama

list_assignments

Retrieve all assignments for a specific Canvas course using the course identifier to help users track and manage academic tasks.

Instructions

List assignments for a specific course.

Args: course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes

Implementation Reference

  • The handler function for the 'list_assignments' tool. It fetches and formats assignments for a given Canvas course identifier using the Canvas API.
    @validate_params async def list_assignments(course_identifier: str | int) -> str: """List assignments for a specific course. Args: course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID """ course_id = await get_course_id(course_identifier) params = { "per_page": 100, "include[]": ["all_dates", "submission"] } all_assignments = await fetch_all_paginated_results(f"/courses/{course_id}/assignments", params) if isinstance(all_assignments, dict) and "error" in all_assignments: return f"Error fetching assignments: {all_assignments['error']}" if not all_assignments: return f"No assignments found for course {course_identifier}." assignments_info = [] for assignment in all_assignments: assignment_id = assignment.get("id") name = assignment.get("name", "Unnamed assignment") due_at = assignment.get("due_at", "No due date") points = assignment.get("points_possible", 0) assignments_info.append( f"ID: {assignment_id}\nName: {name}\nDue: {due_at}\nPoints: {points}\n" ) # Try to get the course code for display course_display = await get_course_code(course_id) or course_identifier return f"Assignments for Course {course_display}:\n\n" + "\n".join(assignments_info)
  • Registration call to register_assignment_tools(mcp), which registers the list_assignments tool among others via decorators.
    register_assignment_tools(mcp)

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