Skip to main content
Glama

get_page_content

Retrieve the complete content body of a specific page from a Canvas course using either the course code or ID and page URL or identifier.

Instructions

Get the full content body of a specific page.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes
page_url_or_idYes

Implementation Reference

  • The core handler function for the 'get_page_content' MCP tool. It fetches the content of a Canvas course page using the Canvas API and formats the response with title, status, and course information. Registered via @mcp.tool() decorator inside register_other_tools.
    @mcp.tool() @validate_params async def get_page_content(course_identifier: str | int, page_url_or_id: str) -> str: """Get the full content body of a specific page. Args: course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID page_url_or_id: The page URL or page ID """ course_id = await get_course_id(course_identifier) response = await make_canvas_request("get", f"/courses/{course_id}/pages/{page_url_or_id}") if "error" in response: return f"Error fetching page content: {response['error']}" title = response.get("title", "Untitled") body = response.get("body", "") published = response.get("published", False) if not body: return f"Page '{title}' has no content." course_display = await get_course_code(course_id) or course_identifier status = "Published" if published else "Unpublished" return f"Page Content for '{title}' in Course {course_display} ({status}):\n\n{body}"
  • Top-level registration call to register_other_tools(mcp) in the register_all_tools function of the main server.py file, which triggers the definition and registration of the get_page_content tool.
    register_other_tools(mcp)
  • The registration function register_other_tools that contains the nested definition of the get_page_content handler with @mcp.tool() decorator.
    def register_other_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