Skip to main content
Glama

get_course_details

Retrieve comprehensive course information from Canvas LMS using a course code or ID to access details like assignments, materials, and announcements.

Instructions

Get detailed information about 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 'get_course_details' MCP tool. It resolves the course identifier to an ID, fetches course details from the Canvas API, updates caches, and returns a formatted string with key course information including code, name, dates, time zone, etc.
    @mcp.tool() @validate_params async def get_course_details(course_identifier: str | int) -> str: """Get detailed information about 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) response = await make_canvas_request("get", f"/courses/{course_id}") if "error" in response: return f"Error fetching course details: {response['error']}" # Update our caches with the course data if "id" in response and "course_code" in response: course_code_to_id_cache[response["course_code"]] = str(response["id"]) id_to_course_code_cache[str(response["id"])] = response["course_code"] details = [ f"Code: {response.get('course_code', 'N/A')}", f"Name: {response.get('name', 'N/A')}", f"Start Date: {format_date(response.get('start_at'))}", f"End Date: {format_date(response.get('end_at'))}", f"Time Zone: {response.get('time_zone', 'N/A')}", f"Default View: {response.get('default_view', 'N/A')}", f"Public: {response.get('is_public', False)}", f"Blueprint: {response.get('blueprint', False)}" ] # Prefer to show course code in the output course_display = response.get("course_code", course_identifier) return f"Course Details for {course_display}:\n\n" + "\n".join(details)
  • The registration call for course tools (including get_course_details) in the main server setup function register_all_tools.
    register_course_tools(mcp)
  • The function that registers all course-related tools, including get_course_details, by applying @mcp.tool() decorators to the handler functions.
    def register_course_tools(mcp: FastMCP):

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