Skip to main content
Glama

get_page_content

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

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 main handler function for the 'get_page_content' tool. It resolves the course ID, makes a Canvas API request to fetch the page, extracts the title, body, and published status, formats the response, and returns the page content.
    @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}"
  • The call to register_other_tools(mcp) within register_all_tools, which defines and registers the get_page_content tool (along with other page tools) using the @mcp.tool() decorator inside the register_other_tools function.
    register_other_tools(mcp)
  • Invocation of register_all_tools in the main server startup, which chains to the registration of the get_page_content tool.
    register_all_tools(mcp)
  • Type hints and docstring Args section define the input schema for the tool, used by FastMCP for tool schema generation.
    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 """
  • The register_other_tools function contains the nested definition of get_page_content and its @mcp.tool() registration.
    def register_other_tools(mcp: FastMCP):
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