get_front_page
Retrieve the front page content for a Canvas course using its identifier or code to access course materials and announcements.
Instructions
Get the front page content for a course.
Args:
course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_identifier | Yes |
Implementation Reference
- Handler function implementing the get_front_page tool. Registered via @mcp.tool() decorator. Fetches course front page content from Canvas API using course_identifier, formats and returns the title, body, and update date.@mcp.tool() @validate_params async def get_front_page(course_identifier: str | int) -> str: """Get the front page content for a 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}/front_page") if "error" in response: return f"Error fetching front page: {response['error']}" title = response.get("title", "Untitled") body = response.get("body", "") updated_at = format_date(response.get("updated_at")) if not body: return f"Course front page '{title}' has no content." # Try to get the course code for display course_display = await get_course_code(course_id) or course_identifier return f"Front Page '{title}' for Course {course_display} (Updated: {updated_at}):\n\n{body}"
- src/canvas_mcp/server.py:50-50 (registration)Top-level registration call that invokes register_other_tools(mcp), which defines and registers the get_front_page tool among others.register_other_tools(mcp)